Community
Participate
Working Groups
Currently, there's no direct way in SWT for disabling the move of a shell, other than using the NO_TRIM style hint, that also removes the titlebar and other other trim styles. However, this can be achieved in gtk (we tested this with gtk2, in CentOs running Metacity) and win32 (with Windows8.1). For gtk, one would have to call the gdk_window_set_functions [1] without the GDK_FUNC_MOVE hint[2], while for Windows one would have to disable the SC_MOVE menu item from the window's menu. We were thinking about adding a new style hint to the SWT class and name it NO_MOVE or NOT_MOVABLE. What are your thoughts on this? Would you be interested in a contribution? Best wishes, Alexandra [1] https://developer.gnome.org/gdk2/stable/gdk2-Windows.html#gdk-window-set-functions [2] https://developer.gnome.org/gdk2/stable/gdk2-Windows.html#GdkWMFunction [3] https://msdn.microsoft.com/en-us/library/windows/desktop/ms646360(v=vs.85).aspx
I'm curious, what's the use-case scenario for this?
Hi Leo, We have an e4 application with a perspective and two windows. One of the windows should have a title and be minimizable and closeable, but not movable.
What is the reason for making it 'unmovable' thou :-) ? I'm not so much opposing it, just curious...
Hi Leo, we are dealing with an application which is deployed on a fixed setup of displays. Imagine a control room with mutliple displays. In this scenarios some windows are manditory to been shown at a certain place and therefore it should not be possible to move them. Cheers Jonas
From the SWT/GTK side of things, a gtk3[1] function exists and isn't deprecated. You'll probably have to add a custom function to OS.java. [2] I wouldn't mind doing the testing part for Gtk2/Gtk3. But for theoretical notion of having such feature in gtk, it would be nice to hear from Alex/Arun. [1] https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#gdk-window-set-functions [2] If of use, here are some notes on adding custom functions to swt/gtk: http://leoufimtsev.github.io./org/swt-dev.html#sec-2-3
Let me remind you that in order to add new API to SWT it has to be implemented on supported WSs - GTK/Win32/Cocoa.
New Gerrit change created: https://git.eclipse.org/r/46429
Hi, I have pushed a commit to Gerrit, that adds the functionality for the SWT.NO_MOVE flag for Win32, Cocoa and gtk. The gtk code was tested for gtk2 and Metacity. Cheers, Alexandra
This is API release. The api for 4.5 release has been frozen so will have a look at this in 4.6 release
I've rebased the change on the latest master.
Does someone have the time to review this? Thanks in advance!
This requires some testing before pushing into the master. So targetting for M2
New Gerrit change created: https://git.eclipse.org/r/53872
I have tested this patch. I found a couple of issues 1. When you create a shell without any style, we create with shell trim. If we set only no move style. shell is getting created with No trim. I think this should be mentioned as javadoc saying that this bit has to be used in conjunction with other styles and if only no move is set it will create shell with No trim. 2. When I use shell_trim no move does not work on linux. I think this is probably down to Resize bit. Need to define what should happen when Resize and No_move are set. currently no move does not work. 3. Need to updated shell class constructors javadoc to specify the new style bit
I am using compiz desktop manager.
Created attachment 256386 [details] Windows Patch to fix SWT.NO_MOVE + SWT.TITLE style combination Hi Alexandra, Please apply above changes in your gerrit patch to make SWT.NO_MOVE + SWT.TITLE style combination work on Windows as well. Once this is in, we can have TITLE style default with NO_MOVE for all platforms.
Gerrit change https://git.eclipse.org/r/46429 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=a52ce1661d394623c8e4d867796656d09a0c40c6
Reviewed the code for control example https://git.eclipse.org/r/53872. this code looks good and can be committed This code is not compiling trough gerrit as the api change is not available in the gerrit baseline. So committing through eclipse itself. Committed trough https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=14c42fa651f58062c3fa5f5a0facc201e359da1a
Please fix the problems reported by API Tools: - Missing @since tag on NO_MOVE SWT.java - The minor version should be incremented in version 3.104.0, since new APIs have been added since version 3.104.0 MANIFEST.MF
New Gerrit change created: https://git.eclipse.org/r/56831
Gerrit change https://git.eclipse.org/r/56831 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=b96b7e61dc9b8e1bd223b5c11e9d642e01be1ee4
(In reply to Markus Keller from comment #19) > Please fix the problems reported by API Tools: > > - Missing @since tag on NO_MOVE SWT.java Fixed by commit in comment 21. > - The minor version should be incremented in version 3.104.0, since new APIs > have been added since version 3.104.0 MANIFEST.MF Fixed by Bug 478520.
Verified in I20151026-2000 on GTK2 x86 platform