Logo Search packages:      
Sourcecode: parti-all version File versions  Download package

def wimpiggy::window::WindowModel::give_client_focus (   self  ) 

The focus manager has decided that our client should recieve X
focus.  See world_window.py for details.

Definition at line 903 of file window.py.

00903                                :
        """The focus manager has decided that our client should recieve X
        focus.  See world_window.py for details."""
        log("Giving focus to client")
        # Have to fetch the time, not just use CurrentTime, both because ICCCM
        # says that WM_TAKE_FOCUS must use a real time and because there are
        # genuine race conditions here (e.g. suppose the client does not
        # actually get around to requesting the focus until after we have
        # already changed our mind and decided to give it to someone else).
        now = gtk.gdk.x11_get_server_time(self.corral_window)
        # ICCCM 4.1.7 *claims* to describe how we are supposed to give focus
        # to a window, but it is completely opaque.  From reading the
        # metacity, kwin, gtk+, and qt code, it appears that the actual rules
        # for giving focus are:
        #   -- the WM_HINTS input field determines whether the WM should call
        #      XSetInputFocus
        #   -- independently, the WM_TAKE_FOCUS protocol determines whether
        #      the WM should send a WM_TAKE_FOCUS ClientMessage.
        # If both are set, both methods MUST be used together. For example,
        # GTK+ apps respect WM_TAKE_FOCUS alone but I'm not sure they handle
        # XSetInputFocus well, while Qt apps ignore (!!!) WM_TAKE_FOCUS
        # (unless they have a modal window), and just expect to get focus from
        # the WM's XSetInputFocus.
        if self._input_field:
            log("... using XSetInputFocus")
            trap.swallow(wimpiggy.lowlevel.XSetInputFocus,
                         self.client_window, now)
        if "WM_TAKE_FOCUS" in self.get_property("protocols"):
            log("... using WM_TAKE_FOCUS")
            trap.swallow(wimpiggy.lowlevel.send_wm_take_focus,
                         self.client_window, now)

    ################################


Generated by  Doxygen 1.6.0   Back to index