Esempio n. 1
0
 def __init__(self, *args):
     ClientWindowBase.__init__(self, *args)
     self.move(*self._pos)
     self.resize(*self._size)
     self.setMouseTracking(True)
     geom = self._pos+self._size
     self.setGeometry(*geom)
Esempio n. 2
0
 def __init__(self, *args):
     ClientWindowBase.__init__(self, *args)
     self.move(*self._pos)
     self.resize(*self._size)
     self.setMouseTracking(True)
     geom = self._pos + self._size
     self.setGeometry(*geom)
Esempio n. 3
0
    def setup_window(self):
        self.set_app_paintable(True)
        self.add_events(self.WINDOW_EVENT_MASK)
        self.set_alpha()

        if self._override_redirect:
            transient_for = self.get_transient_for()
            type_hint = self.get_type_hint()
            if transient_for is not None and type_hint in self.OR_TYPE_HINTS:
                transient_for._override_redirect_windows.append(self)

        if not self._override_redirect:
            self.connect("notify::has-toplevel-focus", self._focus_change)

        def focus_in(*args):
            focuslog("focus-in-event for wid=%s", self._id)

        def focus_out(*args):
            focuslog("focus-out-event for wid=%s", self._id)

        self.connect("focus-in-event", focus_in)
        self.connect("focus-out-event", focus_out)
        self.connect("property-notify-event", self.property_changed)
        self.connect("window-state-event", self.window_state_updated)

        #this will create the backing:
        ClientWindowBase.setup_window(self)

        #honour the initial position if the flag is set
        #(or just if non zero, for older servers)
        if self._pos != (0, 0) or self._set_initial_position:
            self.move(*self._pos)
        self.set_default_size(*self._size)
Esempio n. 4
0
    def setup_window(self):
        ClientWindowBase.setup_window(self)
        self.set_app_paintable(True)
        self.add_events(self.WINDOW_EVENT_MASK)
        if self._override_redirect:
            transient_for = self.get_transient_for()
            type_hint = self.get_type_hint()
            if transient_for is not None and transient_for.window is not None and type_hint in self.OR_TYPE_HINTS:
                transient_for._override_redirect_windows.append(self)
        if not self._override_redirect:
            self.connect("notify::has-toplevel-focus", self._focus_change)

        def focus_in(*args):
            focuslog("focus-in-event for wid=%s", self._id)

        def focus_out(*args):
            focuslog("focus-out-event for wid=%s", self._id)

        self.connect("focus-in-event", focus_in)
        self.connect("focus-out-event", focus_out)
        if self._can_set_workspace:
            self.connect("property-notify-event", self.property_changed)
        self.connect("window-state-event", self.window_state_updated)

        self.move(*self._pos)
        self.set_default_size(*self._size)
Esempio n. 5
0
    def setup_window(self):
        ClientWindowBase.setup_window(self)
        self.set_app_paintable(True)
        self.add_events(self.WINDOW_EVENT_MASK)
        if self._override_redirect:
            transient_for = self.get_transient_for()
            type_hint = self.get_type_hint()
            if transient_for is not None and transient_for.window is not None and type_hint in self.OR_TYPE_HINTS:
                transient_for._override_redirect_windows.append(self)
        if not self._override_redirect:
            self.connect("notify::has-toplevel-focus", self._focus_change)

        def focus_in(*args):
            self.debug("focus-in-event for wid=%s", self._id)

        def focus_out(*args):
            self.debug("focus-out-event for wid=%s", self._id)

        self.connect("focus-in-event", focus_in)
        self.connect("focus-out-event", focus_out)
        if self._can_set_workspace:
            self.connect("property-notify-event", self.property_changed)
        self.connect("window-state-event", self.window_state_updated)

        self.move(*self._pos)
        self.set_default_size(*self._size)
Esempio n. 6
0
 def destroy(self):
     if self._client._set_window_menu:
         self._client.set_window_menu(False, self._id, {})
     self.on_realize_cb = {}
     ClientWindowBase.destroy(self)
     gtk.Window.destroy(self)
     self._unfocus()
Esempio n. 7
0
    def setup_window(self):
        self.set_app_paintable(True)
        self.add_events(self.WINDOW_EVENT_MASK)
        self.set_alpha()

        if self._override_redirect:
            transient_for = self.get_transient_for()
            type_hint = self.get_type_hint()
            if transient_for is not None and type_hint in self.OR_TYPE_HINTS:
                transient_for._override_redirect_windows.append(self)

        if not self._override_redirect:
            self.connect("notify::has-toplevel-focus", self._focus_change)
        def focus_in(*args):
            focuslog("focus-in-event for wid=%s", self._id)
        def focus_out(*args):
            focuslog("focus-out-event for wid=%s", self._id)
        self.connect("focus-in-event", focus_in)
        self.connect("focus-out-event", focus_out)
        self.connect("property-notify-event", self.property_changed)
        self.connect("window-state-event", self.window_state_updated)

        #this will create the backing:
        ClientWindowBase.setup_window(self)

        #honour the initial position if the flag is set
        #(or just if non zero, for older servers)
        if self._pos!=(0, 0) or self._set_initial_position:
            self.move(*self._pos)
        self.set_default_size(*self._size)
Esempio n. 8
0
 def init_window(self, metadata):
     self._fullscreen = None
     self._iconified = False
     self._resize_counter = 0
     self._window_workspace = self._client_properties.get("workspace")
     self._desktop_workspace = -1
     ClientWindowBase.init_window(self, metadata)
     self._can_set_workspace = HAS_X11_BINDINGS and CAN_SET_WORKSPACE
Esempio n. 9
0
 def init_window(self, metadata):
     self._fullscreen = None
     self._iconified = False
     self._resize_counter = 0
     self._window_workspace = self._client_properties.get("workspace")
     self._desktop_workspace = -1
     ClientWindowBase.init_window(self, metadata)
     self._can_set_workspace = HAS_X11_BINDINGS and CAN_SET_WORKSPACE
Esempio n. 10
0
 def init_window(self, metadata):
     self._window_state = {}
     self._maximized = False
     self._iconfified = False
     self._fullscreen = None
     self._resize_counter = 0
     self._window_workspace = self._client_properties.get("workspace", -1)
     workspacelog("init_window(..) workspace=%s", self._window_workspace)
     self._desktop_workspace = -1
     ClientWindowBase.init_window(self, metadata)
     self._can_set_workspace = HAS_X11_BINDINGS and CAN_SET_WORKSPACE
Esempio n. 11
0
 def init_window(self, metadata):
     self._window_state = {}
     self._maximized = False
     self._iconfified = False
     self._fullscreen = None
     self._resize_counter = 0
     self._window_workspace = self._client_properties.get("workspace", -1)
     workspacelog("init_window(..) workspace=%s", self._window_workspace)
     self._desktop_workspace = -1
     ClientWindowBase.init_window(self, metadata)
     self._can_set_workspace = HAS_X11_BINDINGS and CAN_SET_WORKSPACE
Esempio n. 12
0
    def setup_window(self):
        self.set_app_paintable(True)
        self.add_events(self.WINDOW_EVENT_MASK)

        #try to enable alpha on this window if needed,
        #and if the backing class can support it:
        bc = self.get_backing_class()
        log("setup_window() has_alpha=%s, %s.HAS_ALPHA=%s", self._has_alpha,
            bc, bc.HAS_ALPHA)
        if self._has_alpha and bc.HAS_ALPHA:
            screen = self.get_screen()
            rgba = screen.get_rgba_colormap()
            if rgba is None:
                log.error("cannot handle window transparency on screen %s",
                          screen)
            else:
                self.set_colormap(rgba)
                self._window_alpha = True

        if self._override_redirect:
            transient_for = self.get_transient_for()
            type_hint = self.get_type_hint()
            if transient_for is not None and transient_for.window is not None and type_hint in self.OR_TYPE_HINTS:
                transient_for._override_redirect_windows.append(self)

        if not self._override_redirect:
            self.connect("notify::has-toplevel-focus", self._focus_change)

        def focus_in(*args):
            focuslog("focus-in-event for wid=%s", self._id)

        def focus_out(*args):
            focuslog("focus-out-event for wid=%s", self._id)

        self.connect("focus-in-event", focus_in)
        self.connect("focus-out-event", focus_out)
        if self._can_set_workspace:
            self.connect("property-notify-event", self.property_changed)
        self.connect("window-state-event", self.window_state_updated)

        #this will create the backing:
        ClientWindowBase.setup_window(self)

        #honour the initial position if the flag is set
        #(or just if non zero, for older servers)
        if self._pos != (0, 0) or self._set_initial_position:
            self.move(*self._pos)
        self.set_default_size(*self._size)
Esempio n. 13
0
    def setup_window(self, *args):
        self.set_alpha()

        if self._override_redirect:
            transient_for = self.get_transient_for()
            type_hint = self.get_type_hint()
            if transient_for is not None and type_hint in self.OR_TYPE_HINTS:
                transient_for._override_redirect_windows.append(self)

        if not self._override_redirect:
            self.connect("notify::has-toplevel-focus", self._focus_change)
        def focus_in(*args):
            focuslog("focus-in-event for wid=%s", self._id)
        def focus_out(*args):
            focuslog("focus-out-event for wid=%s", self._id)
        self.connect("focus-in-event", focus_in)
        self.connect("focus-out-event", focus_out)
        self.connect("property-notify-event", self.property_changed)
        self.connect("window-state-event", self.window_state_updated)

        #this will create the backing:
        ClientWindowBase.setup_window(self, *args)

        #honour the initial position if the flag is set
        #(or just if non zero, for older servers)
        if self._pos!=(0, 0) or self._set_initial_position:
            x,y = self._pos
            geomlog("setup_window() initial position=%s", self._pos)
            if not self.is_OR() and self.get_decorated():
                #try to adjust for window frame size if we can figure it out:
                #Note: we cannot just call self.get_window_frame_size() here because
                #the window is not realized yet, and it may take a while for the window manager
                #to set the frame-extents property anyway
                wfs = self._client.get_window_frame_sizes()
                dx, dy = 0, 0
                if wfs:
                    geomlog("setup_window() window frame sizes=%s", wfs)
                    v = wfs.get("offset")
                    if v:
                        dx, dy = v
                        x = max(0, x-dx)
                        y = max(0, y-dy)
                        self._pos = x, y
                        geomlog("setup_window() adjusted initial position=%s", self._pos)
            self.move(x, y)
        self.set_default_size(*self._size)
Esempio n. 14
0
    def setup_window(self):
        self.set_app_paintable(True)
        self.add_events(self.WINDOW_EVENT_MASK)

        #try to enable alpha on this window if needed,
        #and if the backing class can support it:
        bc = self.get_backing_class()
        log("setup_window() has_alpha=%s, %s.HAS_ALPHA=%s", self._has_alpha, bc, bc.HAS_ALPHA)
        if self._has_alpha and bc.HAS_ALPHA:
            screen = self.get_screen()
            rgba = screen.get_rgba_colormap()
            if rgba is None:
                log.error("cannot handle window transparency on screen %s", screen)
            else:
                self.set_colormap(rgba)
                self._window_alpha = True

        if self._override_redirect:
            transient_for = self.get_transient_for()
            type_hint = self.get_type_hint()
            if transient_for is not None and transient_for.window is not None and type_hint in self.OR_TYPE_HINTS:
                transient_for._override_redirect_windows.append(self)

        if not self._override_redirect:
            self.connect("notify::has-toplevel-focus", self._focus_change)
        def focus_in(*args):
            focuslog("focus-in-event for wid=%s", self._id)
        def focus_out(*args):
            focuslog("focus-out-event for wid=%s", self._id)
        self.connect("focus-in-event", focus_in)
        self.connect("focus-out-event", focus_out)
        if self._can_set_workspace:
            self.connect("property-notify-event", self.property_changed)
        self.connect("window-state-event", self.window_state_updated)

        #this will create the backing:
        ClientWindowBase.setup_window(self)

        #honour the initial position if the flag is set
        #(or just if non zero, for older servers)
        if self._pos!=(0, 0) or self._set_initial_position:
            self.move(*self._pos)
        self.set_default_size(*self._size)
Esempio n. 15
0
 def init_window(self, metadata):
     self.init_max_window_size(metadata)
     if self._is_popup(metadata):
         window_type = WINDOW_POPUP
     else:
         window_type = WINDOW_TOPLEVEL
     self.do_init_window(window_type)
     self.set_decorated(self._is_decorated(metadata))
     self.set_app_paintable(True)
     self._window_state = {}
     self._resize_counter = 0
     self._can_set_workspace = HAS_X11_BINDINGS and CAN_SET_WORKSPACE
     self._current_frame_extents = None
     #add platform hooks
     self.on_realize_cb = {}
     self.connect_after("realize", self.on_realize)
     self.connect('unrealize', self.on_unrealize)
     self.add_events(self.WINDOW_EVENT_MASK)
     ClientWindowBase.init_window(self, metadata)
Esempio n. 16
0
 def workspace_changed(self):
     #on X11 clients, this fires from the root window property watcher
     ClientWindowBase.workspace_changed(self)
     self.do_workspace_changed("desktop workspace changed")
Esempio n. 17
0
 def init_window(self, metadata):
     self._window_state = {}
     self._resize_counter = 0
     self._can_set_workspace = HAS_X11_BINDINGS and CAN_SET_WORKSPACE
     ClientWindowBase.init_window(self, metadata)
Esempio n. 18
0
 def init_window(self, metadata):
     self._fullscreen = None
     self._iconified = False
     self._can_set_workspace = HAS_X11_BINDINGS and CAN_SET_WORKSPACE
     ClientWindowBase.init_window(self, metadata)
Esempio n. 19
0
 def init_window(self, metadata):
     self._fullscreen = None
     self._iconified = False
     self._can_set_workspace = HAS_X11_BINDINGS and CAN_SET_WORKSPACE
     ClientWindowBase.init_window(self, metadata)
Esempio n. 20
0
 def init_window(self, metadata):
     QWidget.__init__(self, None)
     ClientWindowBase.init_window(self, metadata)
Esempio n. 21
0
 def init_window(self, metadata):
     QWidget.__init__(self, None)
     ClientWindowBase.init_window(self, metadata)
Esempio n. 22
0
 def destroy(self):
     ClientWindowBase.destroy(self)
     gtk.Window.destroy(self)
     self._unfocus()
Esempio n. 23
0
 def init_window(self, metadata):
     self._window_state = {}
     self._resize_counter = 0
     self._can_set_workspace = HAS_X11_BINDINGS and CAN_SET_WORKSPACE
     ClientWindowBase.init_window(self, metadata)
Esempio n. 24
0
 def workspace_changed(self):
     #on X11 clients, this fires from the root window property watcher
     ClientWindowBase.workspace_changed(self)
     self.do_workspace_changed("desktop workspace changed")
Esempio n. 25
0
 def destroy(self):
     ClientWindowBase.destroy(self)
     gtk.Window.destroy(self)
     self._unfocus()