-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a --max-size option to limit the maximum window size #263
Comments
Oh well, I was hoping that it would be a simple matter of setting some properties using gtk.Window.set-geometry-hints, but unfortunately that does not affect the maximize button... so we'll need something else for that (and probably also deal with fullscreen properly as per #264) Here's a trivial hard-coded patch which limits resizing to 800x600: --- src/xpra/server_source.py (revision 2745)
+++ src/xpra/server_source.py (working copy)
@@ -640,6 +640,15 @@
v = getattr(hints, attr)
if v is not None:
hints_metadata[metakey] = v
+ MAXW = 800
+ MAXH = 600
+ if True:
+ ms = hints_metadata.get("maximum-size")
+ if ms:
+ mw, mh = ms
+ else:
+ mw, mh = 0, 0
+ hints_metadata["maximum-size"] = max(mw, MAXW), max(mh, MAXH)
return {"size-constraints": hints_metadata}
elif propname == "class-instance":
c_i = window.get_property("class-instance") It looks like (preventing window maximisation/minimisation in x window system) it is not possible (at least with x11, and therefore probably with gtk too) to prevent maximization... We can only detect it and resize back down to our maximum size (which will flicker briefly). When doing this, we will have to be careful to not send the maximized dimensions to the server with each resize event (these sizes also need to be clamped). So, if we go with native code instead, we find:
So I think we should go with the easy option for now, and revisit later. |
Well, that's a problem...
You can resize it to any size you like, though interestingly the "maximize" button is greyed out. |
2013-02-25 18:23:17: antoine uploaded file
|
According to gdkevents-win32.c, MINMAXINFO. |
Sent question to the gtk-list: set_geometry_hints max_width/max_height not honoured on win32 |
Since I've had no reply on the mailing list, I've filed a bug on gnome's bugzilla |
Still no answer there - I think we should look at using a different toolkit for the client code, qt or even native versions. Re-scheduling. |
See also #338 |
GTK2 is dead, I'm adding this to #90 instead. |
Looks like the bug got fixed in gtk+ 2.24.23: GDK_HINT_MAX_SIZE ignored on Win32 Now if we could only get a new win32 build of gtk + pygtk... I have found some newer documentation on how to do it here: GTK+ for Windows, and it doesn't look too bad... So we could get a newer GTK build, with newer libpng, etc.. (see #544) without needing to wait for GTK3 (#90) See for example: |
2014-09-15 17:38:00: totaam commented
|
2014-09-16 12:54:41: totaam uploaded file
|
2014-09-16 14:15:12: totaam commented
|
2014-10-02 04:34:05: totaam commented
|
2014-10-03 00:29:21: afarr commented
|
2014-10-03 17:24:48: totaam commented
|
2014-10-03 22:16:57: afarr commented
|
Not sure what that means.. but since things seem to work ok, I'm not going to worry about it! Closing. |
2015-05-18 17:20:05: antoine commented
|
Note: this hook is no longer necessary with GTK3: as of r9737, we skip it with py3k. |
On a 2560x1600 monitor, having maximized windows is generally not a good thing: latency goes way up and the refresh rate collapses, basically the application becomes unusable. (and as big monitors become cheaper, this problem will only worsen - LAN bandwidth has remain pretty static over the last 10 years)
This flag should be either a "server default with client override" or a "server constraint that client can restrict further if desired" (both solutions are acceptable).
We just need to be careful that:
The text was updated successfully, but these errors were encountered: