diff options
| author | Jan D | 2011-03-08 09:34:55 +0100 |
|---|---|---|
| committer | Jan D | 2011-03-08 09:34:55 +0100 |
| commit | 0afb4571a7b54dc7693e605f7ec8a0a3a9251b4d (patch) | |
| tree | 58fa84febc60c1bf678f3e5f72358968bd3eaeba /src/xmenu.c | |
| parent | 25bbfb31d5a71dee8d6049e9bbe10dd7d4b65db9 (diff) | |
| download | emacs-0afb4571a7b54dc7693e605f7ec8a0a3a9251b4d.tar.gz emacs-0afb4571a7b54dc7693e605f7ec8a0a3a9251b4d.zip | |
Updates for compiling with Gtk+ 3.0 (--with-x-toolkit=gtk3).
* configure.in: Require 3.0 for --with-gtk3. Add HAVE_GTK3.
* doc/emacs/xresources.texi (GTK resources): ~/.emacs.d/gtkrc does not work
for Gtk+ 3.
* src/gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
gdk_window_get_screen, gdk_window_get_geometry,
gdk_x11_window_lookup_for_display and GDK_KEY_g.
(xg_set_screen): Use DEFAULT_GDK_DISPLAY.
(xg_get_pixbuf_from_pixmap): New function.
(xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
to Pixmap, take frame as parameter, remove GdkColormap parameter.
Call xg_get_pixbuf_from_pixmap instead of
gdk_pixbuf_get_from_drawable.
(xg_get_image_for_pixmap): Do not make GdkPixmaps, call
xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
(xg_check_special_colors): Use GtkStyleContext and its functions
for HAVE_GTK3.
(xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
(xg_prepare_tooltip, create_dialog, menubar_map_cb)
(xg_update_frame_menubar, xg_tool_bar_detach_callback)
(xg_tool_bar_attach_callback, xg_update_tool_bar_sizes): Call
gtk_widget_get_preferred_size.
(xg_frame_resized): gdk_window_get_geometry only takes 5
parameters.
(xg_win_to_widget, xg_event_is_for_menubar): Call
gdk_x11_window_lookup_for_display.
(xg_set_widget_bg): New function.
(delete_cb): New function.
(xg_create_frame_widgets): connect delete-event to delete_cb.
Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
(xg_set_background_color): Call xg_set_widget_bg.
(xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
(xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
Only call gtk_range_set_update_policy if ! HAVE_GTK3.
(xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
if ! HAVE_GTK3.
(update_frame_tool_bar): Call gtk_widget_hide.
(xg_initialize): Use GDK_KEY_g.
* src/xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
* src/xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
if ! HAVE_GTK3
(x_session_initialize): Call gdk_x11_set_sm_client_id.
* src/xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
(x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
* src/xterm.h (DEFAULT_GDK_DISPLAY): New define.
(GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
for ! HAVE_GTK3.
(GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
Diffstat (limited to 'src/xmenu.c')
| -rw-r--r-- | src/xmenu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 934db0f0406..8967437a376 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -1390,7 +1390,7 @@ menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer | |||
| 1390 | 1390 | ||
| 1391 | /* Check if there is room for the menu. If not, adjust x/y so that | 1391 | /* Check if there is room for the menu. If not, adjust x/y so that |
| 1392 | the menu is fully visible. */ | 1392 | the menu is fully visible. */ |
| 1393 | gtk_widget_size_request (GTK_WIDGET (menu), &req); | 1393 | gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &req); |
| 1394 | if (data->x + req.width > disp_width) | 1394 | if (data->x + req.width > disp_width) |
| 1395 | *x -= data->x + req.width - disp_width; | 1395 | *x -= data->x + req.width - disp_width; |
| 1396 | if (data->y + req.height > disp_height) | 1396 | if (data->y + req.height > disp_height) |