Community
Participate
Working Groups
Created attachment 196850 [details] Snippet to test the behaviour. I have problems using the forceActive() function in Shell, on Linux-gdk with a Metacity 2.22 window manager. The source code of Shell contains the following lines: /* * Bug in metacity. Calling gdk_window_focus() with a timestamp more * recent than the last user interaction time can cause windows not * to come forward in versions > 2.10.0. The fix is to use the last * user event time. */ if (display.windowManager.toLowerCase ().equals ("metacity")) { OS.gdk_window_focus (window, display.lastUserEventTime); } else { OS.gdk_window_focus (window, OS.GDK_CURRENT_TIME); } In my case the lastUserEventTime hack does not work, but the other line the the OS.GDK_CURRENT_TIME does. To reproduce try my attached snipped. It will create a shell with a tree and waits for input on the command line. For each time pressing enter here (I usually do this from within my Eclise IDEs console), the window should be brought to front, but this does not work here. Only if I override the windowmanager in Display the function works. I do not know in which cases the hack is needed, but for me it just breaks things. PS: Bringing the window to front in my snippet forst works, since lastUserEventTime is still 0 then, which is the same as the OS constant. Please remove this hack altogether until you find more information on when it is really needed. Please contact me if you need more info. PS: I tested this with SWT 3.5.2, but 3.6.2 also still contains this piece of code.
New Gerrit change created: https://git.eclipse.org/r/124799
Gerrit change https://git.eclipse.org/r/124799 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=48e508c2ce47ad9cf833776891ac30e305bfd84e
(In reply to Eclipse Genie from comment #2) > Gerrit change https://git.eclipse.org/r/124799 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=48e508c2ce47ad9cf833776891ac30e305bfd84e Patch is merged, removed dead metacity code.