xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #98: xpra-undecorate.patch

File xpra-undecorate.patch, 2.3 KB (added by Antoine Martin, 10 years ago)

ensures that most window types are undecorated (except NORMAL)

  • xpra/client.py

     
    7373    WINDOW_EVENT_MASK = 0
    7474    OR_TYPE_HINTS = []
    7575    NAME_TO_HINT = { }
     76    HINT_TO_UNDECORATE = {}
    7677    SCROLL_MAP = {}
    7778else:
    7879    def get_modifiers_mask():
     
    135136                "_NET_WM_WINDOW_TYPE_COMBO"     : gdk.WINDOW_TYPE_HINT_COMBO,
    136137                "_NET_WM_WINDOW_TYPE_DND"       : gdk.WINDOW_TYPE_HINT_DND
    137138                }
     139    HINT_TO_DECORATE = {
     140                gdk.WINDOW_TYPE_HINT_MENU           : False,
     141                gdk.WINDOW_TYPE_HINT_TOOLBAR        : False,
     142                gdk.WINDOW_TYPE_HINT_SPLASHSCREEN   : False,
     143                gdk.WINDOW_TYPE_HINT_UTILITY        : False,
     144                gdk.WINDOW_TYPE_HINT_DOCK           : False,
     145                gdk.WINDOW_TYPE_HINT_DESKTOP        : False,
     146                gdk.WINDOW_TYPE_HINT_DROPDOWN_MENU  : False,
     147                gdk.WINDOW_TYPE_HINT_POPUP_MENU     : False,
     148                gdk.WINDOW_TYPE_HINT_TOOLTIP        : False,
     149                gdk.WINDOW_TYPE_HINT_NOTIFICATION   : False,
     150                gdk.WINDOW_TYPE_HINT_COMBO          : False,
     151                gdk.WINDOW_TYPE_HINT_DND            : False,
     152                }
     153   
    138154        # Map scroll directions back to mouse buttons.  Mapping is taken from
    139155        # gdk/x11/gdkevents-x11.c.
    140156    SCROLL_MAP = {gdk.SCROLL_UP: 4,
     
    204220        self.add_events(WINDOW_EVENT_MASK)
    205221        self.move(x, y)
    206222        self.set_default_size(w, h)
     223
     224        transient_for = self.get_transient_for()
     225        type_hint = self.get_type_hint()
     226        log.info("gtk.Window() type_hint=%s, transient_for=%s, override_redirect=%s", type_hint, transient_for, override_redirect)
     227        self.set_decorated(not override_redirect and transient_for is None and HINT_TO_DECORATE.get(type_hint, True))
    207228        if override_redirect:
    208             transient_for = self.get_transient_for()
    209             type_hint = self.get_type_hint()
    210229            if transient_for is not None and transient_for.window is not None and type_hint in OR_TYPE_HINTS:
    211230                transient_for._override_redirect_windows.append(self)
    212231        self.connect("notify::has-toplevel-focus", self._focus_change)