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

def wimpiggy::window::WindowModel::__init__ (   self,
  parking_window,
  client_window 
)

Register a new client window with the WM.

Raises an Unmanageable exception if this window should not be
managed, for whatever reason.  ATM, this mostly means that the window
died somehow before we could do anything with it.

Definition at line 401 of file window.py.

00401                                                      :
        """Register a new client window with the WM.

        Raises an Unmanageable exception if this window should not be
        managed, for whatever reason.  ATM, this mostly means that the window
        died somehow before we could do anything with it."""

        BaseWindowModel.__init__(self, client_window)
        self.parking_window = parking_window

        self.connect("notify::iconic", self._handle_iconic_update)

        # We enable PROPERTY_CHANGE_MASK so that we can call
        # x11_get_server_time on this window.
        self.corral_window = gtk.gdk.Window(self.parking_window,
                                            width=100,
                                            height=100,
                                            window_type=gtk.gdk.WINDOW_CHILD,
                                            wclass=gtk.gdk.INPUT_OUTPUT,
                                            event_mask=gtk.gdk.PROPERTY_CHANGE_MASK)
        wimpiggy.lowlevel.substructureRedirect(self.corral_window)
        wimpiggy.lowlevel.add_event_receiver(self.corral_window, self)
        log("created corral window 0x%x", self.corral_window.xid)

        # The WM_HINTS input field
        self._input_field = True

        def setup_client():
            # Start listening for important events.
            self.client_window.set_events(self.client_window.get_events()
                                          | gtk.gdk.STRUCTURE_MASK
                                          | gtk.gdk.PROPERTY_CHANGE_MASK)

            # The child might already be mapped, in case we inherited it from
            # a previous window manager.  If so, we unmap it now, and save the
            # serial number of the request -- this way, when we get an
            # UnmapNotify later, we'll know that it's just from us unmapping
            # the window, not from the client withdrawing the window.
            self.startup_unmap_serial = None
            if wimpiggy.lowlevel.is_mapped(self.client_window):
                log("hiding inherited window")
                self.startup_unmap_serial \
                    = wimpiggy.lowlevel.unmap_with_serial(self.client_window)
            
            # Process properties
            self._read_initial_properties()
            self._write_initial_properties_and_setup()

            # For now, we never use the Iconic state at all.
            self._internal_set_property("iconic", False)

            wimpiggy.lowlevel.XAddToSaveSet(self.client_window)
            self.client_window.reparent(self.corral_window, 0, 0)
            client_size = self.client_window.get_geometry()[2:4]
            self.corral_window.resize(*client_size)
            # We CANNOT use .show_unraised here, because of GTK+ bug #526635:
            wimpiggy.lowlevel.show_unraised_without_extra_stupid_stuff(self.client_window)
        try:
            trap.call(setup_client)
        except XError, e:
            raise Unmanageable, e

    def do_child_map_request_event(self, event):


Generated by  Doxygen 1.6.0   Back to index