summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorosch <oliver at luced de>2019-05-16 20:05:32 +0200
committerraveit65 <[email protected]>2019-06-03 14:14:38 +0200
commitecca5019989b0e7a78fee291c7d555968fe9ba74 (patch)
tree839f74fe31b4e0098c4111736b5af1396a4ff4ec /src/ui
parentddee987ba42fe793cc5a8573288ef5d48dfef510 (diff)
downloadmarco-ecca5019989b0e7a78fee291c7d555968fe9ba74.tar.bz2
marco-ecca5019989b0e7a78fee291c7d555968fe9ba74.tar.xz
Handle mouse clicks in Alt+Tab Popup
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/tabpopup.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c
index 9f83fb64..b896b0e3 100644
--- a/src/ui/tabpopup.c
+++ b/src/ui/tabpopup.c
@@ -640,6 +640,46 @@ meta_ui_tab_popup_select (MetaTabPopup *popup,
}
}
+Window
+meta_ui_tab_popup_get_xid (MetaTabPopup *popup)
+{
+ if (popup != NULL && popup->window != NULL)
+ return gdk_x11_window_get_xid(gtk_widget_get_window(popup->window));
+ else
+ return 0;
+}
+
+void
+meta_ui_tab_popup_mouse_press (MetaTabPopup *popup,
+ gint x,
+ gint y)
+{
+ GList *tmp = popup->entries;
+ gboolean found = FALSE;
+ while (tmp != NULL && !found)
+ {
+ TabEntry *te = tmp->data;
+ gint wx, wy;
+ if (gtk_widget_translate_coordinates(popup->window,
+ te->widget,
+ x, y,
+ &wx, &wy))
+ {
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(te->widget, &alloc);
+ found = (0 <= wx && wx < alloc.width &&
+ 0 <= wy && wy < alloc.height);
+ if (found)
+ {
+ popup->current = tmp;
+ display_entry (popup, te);
+ }
+ }
+ tmp = tmp->next;
+ }
+}
+
+
#define META_TYPE_SELECT_IMAGE (meta_select_image_get_type ())
#define META_SELECT_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SELECT_IMAGE, MetaSelectImage))