[balsa/gtk4: 14/294] compose window: Improve context menu placement
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk4: 14/294] compose window: Improve context menu placement
- Date: Sun, 10 Oct 2021 00:02:54 +0000 (UTC)
commit 4d11a67b2ce2565e79f961fac7290c8624b1fe27
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Thu May 7 15:51:19 2020 -0400
compose window: Improve context menu placement
src/sendmsg-window.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index cdb9f6ea4..d99c21999 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -2411,8 +2411,18 @@ attachment_button_press_cb(GtkGestureMultiPress *multi_press,
gtk_tree_model_get(model, &iter, ATTACH_INFO_COLUMN, &attach_info, -1);
if (attach_info != NULL) {
- if (attach_info->popup_menu != NULL)
+ if (attach_info->popup_menu != NULL) {
+ GdkRectangle rectangle;
+
+ /* Pop up above the pointer */
+ rectangle.x = (gint) x;
+ rectangle.width = 0;
+ rectangle.y = (gint) y;
+ rectangle.height = 0;
+ gtk_popover_set_pointing_to(GTK_POPOVER(attach_info->popup_menu),
+ &rectangle);
gtk_popover_popup(GTK_POPOVER(attach_info->popup_menu));
+ }
g_object_unref(attach_info);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]