def _handle_wm_normal_hints_change(self): with xswallow: size_hints = X11Window.getSizeHints(self.xid) metalog("WM_NORMAL_HINTS=%s", size_hints) #getSizeHints exports fields using their X11 names as defined in the "XSizeHints" structure, #but we use a different naming (for historical reason and backwards compatibility) #so rename the fields: hints = {} if size_hints: for k, v in size_hints.items(): hints[{ "min_size": "minimum-size", "max_size": "maximum-size", "base_size": "base-size", "resize_inc": "increment", "win_gravity": "gravity", }.get(k, k)] = v sanitize_size_hints(hints) # Don't send out notify and ConfigureNotify events when this property # gets no-op updated -- some apps like FSF Emacs 21 like to update # their properties every time they see a ConfigureNotify, and this # reduces the chance for us to get caught in loops: if self._updateprop("size-hints", hints): if self._setup_done: self._update_client_geometry()
def _handle_wm_normal_hints_change(self): with xswallow: size_hints = X11Window.getSizeHints(self.xid) metalog("WM_NORMAL_HINTS=%s", size_hints) #getSizeHints exports fields using their X11 names as defined in the "XSizeHints" structure, #but we use a different naming (for historical reason and backwards compatibility) #so rename the fields: hints = {} if size_hints: for k,v in size_hints.items(): hints[{"min_size" : "minimum-size", "max_size" : "maximum-size", "base_size" : "base-size", "resize_inc" : "increment", "win_gravity" : "gravity", }.get(k, k)] = v sanitize_size_hints(hints) # Don't send out notify and ConfigureNotify events when this property # gets no-op updated -- some apps like FSF Emacs 21 like to update # their properties every time they see a ConfigureNotify, and this # reduces the chance for us to get caught in loops: if self._updateprop("size-hints", hints): if self._setup_done: self._update_client_geometry()