diff --git a/porcupine/plugins/directory_tree.py b/porcupine/plugins/directory_tree.py index b501f3cc0..c09b5a94a 100644 --- a/porcupine/plugins/directory_tree.py +++ b/porcupine/plugins/directory_tree.py @@ -431,7 +431,7 @@ def _on_right_click(self, event: tkinter.Event[DirectoryTree], menu_key: bool) - self._populate_contextmenu() if self.contextmenu.index("end") is not None: # Menu is not empty - self.contextmenu.tk_popup(menu_x, menu_y) + self.contextmenu.tk_popup(menu_x + 10, menu_y + 10) return "break" diff --git a/porcupine/plugins/jump_to_definition.py b/porcupine/plugins/jump_to_definition.py index 5405d1dd3..061af1942 100644 --- a/porcupine/plugins/jump_to_definition.py +++ b/porcupine/plugins/jump_to_definition.py @@ -67,9 +67,10 @@ def find_cursor_xy(textwidget: tkinter.Text) -> tuple[int, int]: # Make coords relative to top left corner of screen, not text widget left += textwidget.winfo_rootx() + top += textwidget.winfo_rooty() - return (left, top + height) + return (left + 10, top + height + 10) def receive_jump(event: utils.EventWithData) -> None: diff --git a/porcupine/plugins/rightclick_menu.py b/porcupine/plugins/rightclick_menu.py index 18f695f64..6b11c4f87 100644 --- a/porcupine/plugins/rightclick_menu.py +++ b/porcupine/plugins/rightclick_menu.py @@ -36,7 +36,7 @@ def create_menu() -> tkinter.Menu: def show_menu(event: tkinter.Event[tkinter.Misc]) -> None: rm = create_menu() - rm.tk_popup(event.x_root, event.y_root) + rm.tk_popup(event.x_root + 10, event.y_root + 10) rm.bind("", (lambda event: rm.after_idle(rm.destroy)), add=True) diff --git a/porcupine/plugins/tab_closing.py b/porcupine/plugins/tab_closing.py index 76f8059fc..5500c5eaf 100644 --- a/porcupine/plugins/tab_closing.py +++ b/porcupine/plugins/tab_closing.py @@ -52,7 +52,7 @@ def show_menu(event: tkinter.Event[tabs.TabManager]) -> None: label="Close other tabs", command=partial(close_clicked_tab, event, what2close="others") ) - menu.tk_popup(event.x_root, event.y_root) + menu.tk_popup(event.x_root + 10, event.y_root + 10) menu.bind("", (lambda event: menu.after_idle(menu.destroy)), add=True)