Mercurial > emacs
comparison src/gtkutil.c @ 109445:051595eb9b58
Merge changes from emacs-23 branch.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Fri, 16 Jul 2010 11:42:15 -0400 |
parents | 89a16701cde1 60266cf487b0 |
children | a93344738bc8 |
comparison
equal
deleted
inserted
replaced
109443:9e514d1076b4 | 109445:051595eb9b58 |
---|---|
2852 x->menubar_widget = 0; | 2852 x->menubar_widget = 0; |
2853 FRAME_MENUBAR_HEIGHT (f) = 0; | 2853 FRAME_MENUBAR_HEIGHT (f) = 0; |
2854 xg_height_changed (f); | 2854 xg_height_changed (f); |
2855 UNBLOCK_INPUT; | 2855 UNBLOCK_INPUT; |
2856 } | 2856 } |
2857 } | |
2858 | |
2859 int | |
2860 xg_event_is_for_menubar (FRAME_PTR f, XEvent *event) | |
2861 { | |
2862 struct x_output *x = f->output_data.x; | |
2863 | |
2864 if (! x->menubar_widget) return 0; | |
2865 | |
2866 if (! (event->xbutton.x >= 0 | |
2867 && event->xbutton.x < FRAME_PIXEL_WIDTH (f) | |
2868 && event->xbutton.y >= 0 | |
2869 && event->xbutton.y < f->output_data.x->menubar_height | |
2870 && event->xbutton.same_screen)) | |
2871 return 0; | |
2872 | |
2873 GList *list = gtk_container_get_children (GTK_CONTAINER (x->menubar_widget)); | |
2874 if (! list) return 0; | |
2875 GList *iter; | |
2876 GdkRectangle rec; | |
2877 rec.x = event->xbutton.x; | |
2878 rec.y = event->xbutton.y; | |
2879 rec.width = 1; | |
2880 rec.height = 1; | |
2881 for (iter = list ; iter; iter = g_list_next (iter)) | |
2882 { | |
2883 GtkWidget *w = GTK_WIDGET (iter->data); | |
2884 if (GTK_WIDGET_MAPPED (w) && gtk_widget_intersect (w, &rec, NULL)) | |
2885 break; | |
2886 } | |
2887 g_list_free (list); | |
2888 return iter == 0 ? 0 : 1; | |
2857 } | 2889 } |
2858 | 2890 |
2859 | 2891 |
2860 | 2892 |
2861 /*********************************************************************** | 2893 /*********************************************************************** |