Пример #1
0
    def _on_motion_notify_event(self, widget, event):
        """
        Move the window if the pointer has moved more than the DND threshold.
        """
        sequence = InputSequence()
        sequence.init_from_motion_event(event)
        self.handle_motion(sequence, fallback=True)
        self.set_drag_cursor_at((event.x, event.y))

        # start dwelling if nothing else is going on
        point = (event.x, event.y)
        hit = self.hit_test_move_resize(point)
        if hit is None:
            if (
                not self.is_drag_initiated()
                and not self._is_dwelling()
                and not self._no_more_dwelling
                and not config.is_hover_click_active()
                and not config.lockdown.disable_dwell_activation
            ):
                self._start_dwelling()
        else:
            self._stop_dwelling()  # allow resizing in peace

        return False
Пример #2
0
 def _on_button_press_event(self, widget, event):
     """
     Save the pointer position.
     """
     if event.button == 1 and event.window == self.get_window():
         self.enable_drag_protection(True)
         sequence = InputSequence()
         sequence.init_from_button_event(event)
         self.handle_press(sequence, move_on_background=True)
         if self.is_moving():
             self.reset_drag_protection()  # force threshold
     return False
 def _on_button_press_event(self, widget, event):
     """
     Save the pointer position.
     """
     if event.button == 1 and event.window == self.get_window():
         self.enable_drag_protection(True)
         sequence = InputSequence()
         sequence.init_from_button_event(event)
         self.handle_press(sequence, move_on_background=True)
         if self.is_moving():
             self.reset_drag_protection()  # force threshold
     return False
Пример #4
0
    def _on_button_press_event(self, widget, event):
        if event.window == self.get_window():
            if Gdk.Event.triggers_context_menu(event):
                self._menu.popup(event.button, event.get_time())

            elif event.button == Gdk.BUTTON_PRIMARY:
                self.enable_drag_protection(True)
                sequence = InputSequence()
                sequence.init_from_button_event(event)
                self.handle_press(sequence, move_on_background=True)
                if self.is_moving():
                    self.reset_drag_protection()  # force threshold

        return True
Пример #5
0
    def _on_button_press_event(self, widget, event):
        if event.window == self.get_window():
            if Gdk.Event.triggers_context_menu(event):
                self._menu.popup(event.button, event.get_time())

            elif event.button == Gdk.BUTTON_PRIMARY:
                self.enable_drag_protection(True)
                sequence = InputSequence()
                sequence.init_from_button_event(event)
                self.handle_press(sequence, move_on_background=True)
                if self.is_moving():
                    self.reset_drag_protection()  # force threshold

        return True
Пример #6
0
    def _on_motion_notify_event(self, widget, event):
        """
        Move the window if the pointer has moved more than the DND threshold.
        """
        sequence = InputSequence()
        sequence.init_from_motion_event(event)
        self.handle_motion(sequence, fallback=True)
        self.set_drag_cursor_at((event.x, event.y))

        # start dwelling if nothing else is going on
        point = (event.x, event.y)
        hit = self.hit_test_move_resize(point)
        if hit is None:
            if not self.is_drag_initiated() and \
               not self._is_dwelling() and \
               not self._no_more_dwelling and \
               not config.is_hover_click_active() and \
               not config.lockdown.disable_dwell_activation:
                self._start_dwelling()
        else:
            self._stop_dwelling()  # allow resizing in peace

        return True