diff --git a/src/xpra/client/gl/gtk3/gl_client_window.py b/src/xpra/client/gl/gtk3/gl_client_window.py index 95dd6bb0e1..913b09ad35 100644 --- a/src/xpra/client/gl/gtk3/gl_client_window.py +++ b/src/xpra/client/gl/gtk3/gl_client_window.py @@ -8,6 +8,7 @@ from xpra.client.gtk3.gtk3_client_window import GTK3ClientWindow from xpra.gtk_common.gtk_util import set_visual +from xpra.util import typedict from xpra.log import Logger log = Logger("opengl", "window") @@ -91,6 +92,11 @@ def new_backing(self, bw, bh): set_visual(widget, self._has_alpha) widget.show() self.init_widget_events(widget) + if self.drawing_area and self.size_constraints: + #apply min size to the drawing_area: + thints = typedict(self.size_constraints) + minsize = thints.intpair("minimum-size", (0, 0)) + self.drawing_area.set_size_request(*minsize) self.add(widget) self.drawing_area = widget #maybe redundant?: diff --git a/src/xpra/client/gtk3/gtk3_client_window.py b/src/xpra/client/gtk3/gtk3_client_window.py index 540145a87b..cd4a93ebc4 100644 --- a/src/xpra/client/gtk3/gtk3_client_window.py +++ b/src/xpra/client/gtk3/gtk3_client_window.py @@ -77,7 +77,16 @@ def can_use_header_bar(self, metadata): return False if hbl in TRUE_OPTIONS: sc = metadata.dictget("size-constraints") - return sc is None + if sc is None: + return True + tsc = typedict(sc) + mins = tsc.intpair("minimum-size") + maxs = tsc.intpair("maximum-size") + if maxs and maxs!=(0, 0) and maxs!=mins: + return False + if tsc.intpair("increment", (0, 0))!=(0, 0): + return False + return True if hbl=="force": return True return False @@ -175,6 +184,14 @@ def apply_geometry_hints(self, hints): "min_aspect_ratio" : "min_aspect", "max_aspect_ratio" : "max_aspect", } + thints = typedict(hints) + if self.drawing_area: + #apply min size to the drawing_area: + #(for CSD mode, ie: headerbar) + minw = thints.intget("min_width", 0) + minh = thints.intget("min_width", 0) + self.drawing_area.set_size_request(minw, minh) + geom = Gdk.Geometry() mask = 0 for k,v in hints.items(): diff --git a/src/xpra/client/gtk_base/gtk_client_window_base.py b/src/xpra/client/gtk_base/gtk_client_window_base.py index 4ec7351a61..b152e0de78 100644 --- a/src/xpra/client/gtk_base/gtk_client_window_base.py +++ b/src/xpra/client/gtk_base/gtk_client_window_base.py @@ -218,6 +218,7 @@ def init_window(self, metadata): def init_drawing_area(self): widget = Gtk.DrawingArea() widget.set_app_paintable(True) + widget.set_size_request(*self._size) widget.show() self.drawing_area = widget self.init_widget_events(widget) @@ -1687,6 +1688,11 @@ def do_map_event(self, event): if self._iconified: self.deiconify() self.process_map_event() + #use the drawing area to enforce the minimum size: + #(as this also honoured correctly with CSD, + # whereas set_geometry_hints is not..) + minw, minh = self.size_constraints.intpair("minimum-size", (0, 0)) + self.drawing_area.set_size_request(minw, minh) def process_map_event(self): x, y, w, h = self.get_drawing_area_geometry()