Exemplo n.º 1
0
    def _change_window_fix_cb(self, settings, key):
        hint = self.fixed_window_hint \
            if settings.get_boolean(key) else Gdk.WindowTypeHint.NORMAL

        if hint == self.window.get_type_hint(): return

        self.window.hide()
        self.window.set_type_hint(hint)
        self.window.show()

        is_below = SETTINGS.get_boolean('window-fix') or \
            SETTINGS.get_boolean('window-keep-below')
        self.window.set_keep_below(is_below)

        if hint == Gdk.WindowTypeHint.NORMAL:
            if self.window.get_gravity() == Gdk.Gravity.CENTER:
                border = self.photoimage.window_border
                x = SETTINGS_GEOMETRY.get_int('root-x') - self.photoimage.w / 2
                y = SETTINGS_GEOMETRY.get_int('root-y') - self.photoimage.h / 2
                self.window.move(int(x - border), int(y - border))
            else:
                # a workaround for Xfwm bug (Issue #97)
                x = SETTINGS_GEOMETRY.get_int('root-x')
                y = SETTINGS_GEOMETRY.get_int('root-y')
                self.window.move(int(x), int(y))
Exemplo n.º 2
0
    def _change_window_fix_cb(self, settings, key):
        hint = self.fixed_window_hint \
            if settings.get_boolean(key) else Gdk.WindowTypeHint.NORMAL

        if hint == self.window.get_type_hint(): return

        self.window.hide()
        self.window.set_type_hint(hint)
        self.window.show()

        is_below = SETTINGS.get_boolean('window-fix') or \
            SETTINGS.get_boolean('window-keep-below')
        self.window.set_keep_below(is_below)

        if hint == Gdk.WindowTypeHint.NORMAL:
            if self.window.get_gravity() == Gdk.Gravity.CENTER:
                border = self.photoimage.window_border
                x = SETTINGS_GEOMETRY.get_int('root-x') - self.photoimage.w / 2
                y = SETTINGS_GEOMETRY.get_int('root-y') - self.photoimage.h / 2
                self.window.move(int(x - border), int(y - border))
            else:
                # a workaround for Xfwm bug (Issue #97)
                x = SETTINGS_GEOMETRY.get_int('root-x')
                y = SETTINGS_GEOMETRY.get_int('root-y')
                self.window.move(int(x), int(y))
Exemplo n.º 3
0
 def _set_window_position(self):
     self.window.move(SETTINGS_GEOMETRY.get_int('root-x'),
                      SETTINGS_GEOMETRY.get_int('root-y'))
     self.window.resize(1, 1)
     self.window.show_all()
     self.window.get_position()
Exemplo n.º 4
0
 def _set_window_position(self):
     self.window.move(SETTINGS_GEOMETRY.get_int('root-x'),
                      SETTINGS_GEOMETRY.get_int('root-y'))
     self.window.resize(1, 1)
     self.window.show_all()
     self.window.get_position()