| Summary: | [GTK] Shell.setFullScreen broken | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Marco Hunsicker <eclipse> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | abuzila, akurtakov, alhashash, eclipse, ericwill, lunxian, OSKozlov |
| Version: | 4.6 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: |
https://bugs.eclipse.org/bugs/show_bug.cgi?id=445456 https://bugs.eclipse.org/bugs/show_bug.cgi?id=493685 https://bugs.eclipse.org/bugs/show_bug.cgi?id=496639 https://bugs.eclipse.org/bugs/show_bug.cgi?id=536017 |
||
| Whiteboard: | |||
I missed this bug sorry for that. Please provide a patch. There has been another ticket opened for this issue, https://bugs.eclipse.org/bugs/show_bug.cgi?id=496639, and a patch has already been committed. I can't check myself right away, but it should be save to close this ticket as well. We might only argue about whether the additional check should be applied constantly in #setVisible() or whether it would be enough to do it once in #createHandle() Is there a hotfix to resolve it. I can fix the bug as now. and can fix it in ver4.6.1 ? This bug has been fixed with the following commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=dc22e68f11f287a803f19c58505ae7441a5aa459 How can I get a patch? (In reply to Xia Lunxian from comment #5) > How can I get a patch? cgit gives you a patch link. But for your convenience here is the direct link http://git.eclipse.org/c/platform/eclipse.platform.swt.git/patch/?id=dc22e68f11f287a803f19c58505ae7441a5aa459 We faced with a new issue related to "Full Screen" mode. When user switch to "Full Screen" mode and try to open "modeless dialog" this approach doesn't work. So as workaround I append additional condition
Shell.java
int mask = SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL;
+ int maskModeless = SWT.CLOSE | SWT.MODELESS| SWT.BORDER | SWT.TITLE;
if ((style & mask) != 0) {
if (visible) {
display.setModalShell (this);
@@ -2353,16 +2354,10 @@
display.clearModal (this);
OS.gtk_window_set_modal (shellHandle, false);
}
+ popupDialogToFront();
+ } if ((style & maskModeless) != 0) {
+ popupDialogToFront();
+ } else {
updateModal ();
}
+
+ /**
+ *
+ * When in full-screen mode, the OS will always consider it to be the top of the display stack unless it is a
+ * dialog. This fix will give modal windows dialog-type priority if the parent is in full-screen, allowing it to be
+ * popped up in front of the full-screen window.
+ */
+ private void popupDialogToFront() {
+ if (parent != null && parent.getShell().getFullScreen()) {faced
+ OS.gtk_window_set_type_hint(shellHandle, OS.GDK_WINDOW_TYPE_HINT_DIALOG);
+ }
+ }
+
Could you please verify this changes? (In reply to Oleksandr Kozlov from comment #8) > Could you please verify this changes? Is this related to bug 535906? Or are they separate issues? No, this problem happen when user first time open modeless dialog. This is a separate issues (In reply to Oleksandr Kozlov from comment #11) > This is a separate issues Alright, please file a new bug ticket with a snippet to reproduce this issue, and upload your patch to gerrit so I can review it. Thanks! Done. Bug 536017 - [GTK] Shell.setFullScreen broken for Modeless window https://bugs.eclipse.org/bugs/show_bug.cgi?id=536017. Patch in attachment. |
In order to be able to maximize screen real estate while on the road using a notebook with a small screen, I've created a simple plugin that allows one to toggle full screen mode for the workbench. public void setMode(IWorkbenchWindow window, Mode mode) { Shell shell = window.getShell(); ... if (shell.getFullScreen() != mode.isFullScreen()) { shell.setFullScreen(mode.isFullScreen()); } } This worked fine with Eclipse Luna, but is broken since Eclipse Mars in that dialogs are no longer displayed. Or at least they are not visible when full screen mode is enabled. Presumably because of the changes introduced with fix #445456. Setting OS.gtk_window_set_type_hint (shellHandle, OS.GDK_WINDOW_TYPE_HINT_DIALOG); seems to be required in full screen mode to have dialogs appear above the full screen window. In order to cater for this use case, I'd suggest that a check is introduced to test whether a parent shell is in full screen mode and if that is the case, set the necessary hint. Shell.java:716 if (!isUndecorated() && isFullScreenParent()) { OS.gtk_window_set_type_hint (shellHandle, OS.GDK_WINDOW_TYPE_HINT_DIALOG); } private boolean isFullScreenParent() { for (Control p = this.parent; p != null; p = p.getParent()) { if (p instanceof Shell) { Shell window = (Shell) p; if (window.getFullScreen()) { return true; } } } return false; } I've you can agree on this, I could submit a patch when desired. Thank you.