diff options
| author | Chong Yidong | 2010-11-30 12:01:18 -0500 |
|---|---|---|
| committer | Chong Yidong | 2010-11-30 12:01:18 -0500 |
| commit | 088c8c092b817674103b1ebbba35df8d6ede4562 (patch) | |
| tree | 7be925ffd7cf68e329416a12f8586a201e2582e0 /src | |
| parent | a5f092fb934d736bccb4490915fef952dee53805 (diff) | |
| download | emacs-088c8c092b817674103b1ebbba35df8d6ede4562.tar.gz emacs-088c8c092b817674103b1ebbba35df8d6ede4562.zip | |
Fix error in last merge.
src/gtkutil.c (menubar_map_cb): Use xg_height_or_width_changed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/gtkutil.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index b091df19905..6fd4b969819 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -559,7 +559,7 @@ hierarchy_ch_cb (GtkWidget *widget, | |||
| 559 | FRAME_PTR f = (FRAME_PTR) user_data; | 559 | FRAME_PTR f = (FRAME_PTR) user_data; |
| 560 | struct x_output *x = f->output_data.x; | 560 | struct x_output *x = f->output_data.x; |
| 561 | GtkWidget *top = gtk_widget_get_toplevel (x->ttip_lbl); | 561 | GtkWidget *top = gtk_widget_get_toplevel (x->ttip_lbl); |
| 562 | 562 | ||
| 563 | if (! top || ! GTK_IS_WINDOW (top)) | 563 | if (! top || ! GTK_IS_WINDOW (top)) |
| 564 | gtk_widget_hide (previous_toplevel); | 564 | gtk_widget_hide (previous_toplevel); |
| 565 | } | 565 | } |
| @@ -580,7 +580,7 @@ qttip_cb (GtkWidget *widget, | |||
| 580 | { | 580 | { |
| 581 | FRAME_PTR f = (FRAME_PTR) user_data; | 581 | FRAME_PTR f = (FRAME_PTR) user_data; |
| 582 | struct x_output *x = f->output_data.x; | 582 | struct x_output *x = f->output_data.x; |
| 583 | if (x->ttip_widget == NULL) | 583 | if (x->ttip_widget == NULL) |
| 584 | { | 584 | { |
| 585 | g_object_set (G_OBJECT (widget), "has-tooltip", FALSE, NULL); | 585 | g_object_set (G_OBJECT (widget), "has-tooltip", FALSE, NULL); |
| 586 | x->ttip_widget = tooltip; | 586 | x->ttip_widget = tooltip; |
| @@ -633,14 +633,14 @@ xg_prepare_tooltip (FRAME_PTR f, | |||
| 633 | screen = gdk_drawable_get_screen (gwin); | 633 | screen = gdk_drawable_get_screen (gwin); |
| 634 | settings = gtk_settings_get_for_screen (screen); | 634 | settings = gtk_settings_get_for_screen (screen); |
| 635 | g_object_get (settings, "gtk-enable-tooltips", &tt_enabled, NULL); | 635 | g_object_get (settings, "gtk-enable-tooltips", &tt_enabled, NULL); |
| 636 | if (tt_enabled) | 636 | if (tt_enabled) |
| 637 | { | 637 | { |
| 638 | g_object_set (settings, "gtk-enable-tooltips", FALSE, NULL); | 638 | g_object_set (settings, "gtk-enable-tooltips", FALSE, NULL); |
| 639 | /* Record that we disabled it so it can be enabled again. */ | 639 | /* Record that we disabled it so it can be enabled again. */ |
| 640 | g_object_set_data (G_OBJECT (x->ttip_window), "restore-tt", | 640 | g_object_set_data (G_OBJECT (x->ttip_window), "restore-tt", |
| 641 | (gpointer)f); | 641 | (gpointer)f); |
| 642 | } | 642 | } |
| 643 | 643 | ||
| 644 | /* Prevent Gtk+ from hiding tooltip on mouse move and such. */ | 644 | /* Prevent Gtk+ from hiding tooltip on mouse move and such. */ |
| 645 | g_object_set_data (G_OBJECT | 645 | g_object_set_data (G_OBJECT |
| 646 | (gtk_widget_get_display (GTK_WIDGET (x->ttip_window))), | 646 | (gtk_widget_get_display (GTK_WIDGET (x->ttip_window))), |
| @@ -654,7 +654,7 @@ xg_prepare_tooltip (FRAME_PTR f, | |||
| 654 | gtk_widget_size_request (GTK_WIDGET (x->ttip_window), &req); | 654 | gtk_widget_size_request (GTK_WIDGET (x->ttip_window), &req); |
| 655 | if (width) *width = req.width; | 655 | if (width) *width = req.width; |
| 656 | if (height) *height = req.height; | 656 | if (height) *height = req.height; |
| 657 | 657 | ||
| 658 | UNBLOCK_INPUT; | 658 | UNBLOCK_INPUT; |
| 659 | 659 | ||
| 660 | return 1; | 660 | return 1; |
| @@ -801,7 +801,7 @@ xg_frame_resized (FRAME_PTR f, int pixelwidth, int pixelheight) | |||
| 801 | &pixelwidth, &pixelheight, 0); | 801 | &pixelwidth, &pixelheight, 0); |
| 802 | else return; | 802 | else return; |
| 803 | } | 803 | } |
| 804 | 804 | ||
| 805 | 805 | ||
| 806 | rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight); | 806 | rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight); |
| 807 | columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth); | 807 | columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth); |
| @@ -1075,7 +1075,7 @@ xg_create_frame_widgets (FRAME_PTR f) | |||
| 1075 | f->output_data.x->ttip_widget = 0; | 1075 | f->output_data.x->ttip_widget = 0; |
| 1076 | f->output_data.x->ttip_lbl = 0; | 1076 | f->output_data.x->ttip_lbl = 0; |
| 1077 | f->output_data.x->ttip_window = 0; | 1077 | f->output_data.x->ttip_window = 0; |
| 1078 | gtk_widget_set_tooltip_text (wtop, "Dummy text"); | 1078 | gtk_widget_set_tooltip_text (wtop, "Dummy text"); |
| 1079 | g_signal_connect (wtop, "query-tooltip", G_CALLBACK (qttip_cb), f); | 1079 | g_signal_connect (wtop, "query-tooltip", G_CALLBACK (qttip_cb), f); |
| 1080 | #endif | 1080 | #endif |
| 1081 | 1081 | ||
| @@ -1454,7 +1454,7 @@ pop_down_dialog (Lisp_Object arg) | |||
| 1454 | 1454 | ||
| 1455 | g_main_loop_quit (dd->loop); | 1455 | g_main_loop_quit (dd->loop); |
| 1456 | g_main_loop_unref (dd->loop); | 1456 | g_main_loop_unref (dd->loop); |
| 1457 | 1457 | ||
| 1458 | UNBLOCK_INPUT; | 1458 | UNBLOCK_INPUT; |
| 1459 | 1459 | ||
| 1460 | return Qnil; | 1460 | return Qnil; |
| @@ -1482,7 +1482,7 @@ xg_maybe_add_timer (gpointer data) | |||
| 1482 | return FALSE; | 1482 | return FALSE; |
| 1483 | } | 1483 | } |
| 1484 | 1484 | ||
| 1485 | 1485 | ||
| 1486 | /* Pops up a modal dialog W and waits for response. | 1486 | /* Pops up a modal dialog W and waits for response. |
| 1487 | We don't use gtk_dialog_run because we want to process emacs timers. | 1487 | We don't use gtk_dialog_run because we want to process emacs timers. |
| 1488 | The dialog W is not destroyed when this function returns. */ | 1488 | The dialog W is not destroyed when this function returns. */ |
| @@ -1516,7 +1516,7 @@ xg_dialog_run (FRAME_PTR f, GtkWidget *w) | |||
| 1516 | 1516 | ||
| 1517 | (void) xg_maybe_add_timer (&dd); | 1517 | (void) xg_maybe_add_timer (&dd); |
| 1518 | g_main_loop_run (dd.loop); | 1518 | g_main_loop_run (dd.loop); |
| 1519 | 1519 | ||
| 1520 | dd.w = 0; | 1520 | dd.w = 0; |
| 1521 | unbind_to (count, Qnil); | 1521 | unbind_to (count, Qnil); |
| 1522 | 1522 | ||
| @@ -3084,10 +3084,10 @@ menubar_map_cb (GtkWidget *w, gpointer user_data) | |||
| 3084 | GtkRequisition req; | 3084 | GtkRequisition req; |
| 3085 | FRAME_PTR f = (FRAME_PTR) user_data; | 3085 | FRAME_PTR f = (FRAME_PTR) user_data; |
| 3086 | gtk_widget_size_request (w, &req); | 3086 | gtk_widget_size_request (w, &req); |
| 3087 | if (FRAME_MENUBAR_HEIGHT (f) != req.height) | 3087 | if (FRAME_MENUBAR_HEIGHT (f) != req.height) |
| 3088 | { | 3088 | { |
| 3089 | FRAME_MENUBAR_HEIGHT (f) = req.height; | 3089 | FRAME_MENUBAR_HEIGHT (f) = req.height; |
| 3090 | xg_height_changed (f); | 3090 | xg_height_or_width_changed (f); |
| 3091 | } | 3091 | } |
| 3092 | } | 3092 | } |
| 3093 | 3093 | ||
| @@ -3368,7 +3368,7 @@ xg_create_scroll_bar (FRAME_PTR f, | |||
| 3368 | "button-release-event", | 3368 | "button-release-event", |
| 3369 | end_callback, | 3369 | end_callback, |
| 3370 | (gpointer) bar); | 3370 | (gpointer) bar); |
| 3371 | 3371 | ||
| 3372 | /* The scroll bar widget does not draw on a window of its own. Instead | 3372 | /* The scroll bar widget does not draw on a window of its own. Instead |
| 3373 | it draws on the parent window, in this case the edit widget. So | 3373 | it draws on the parent window, in this case the edit widget. So |
| 3374 | whenever the edit widget is cleared, the scroll bar needs to redraw | 3374 | whenever the edit widget is cleared, the scroll bar needs to redraw |
| @@ -3457,11 +3457,11 @@ xg_update_scrollbar_pos (FRAME_PTR f, | |||
| 3457 | FRAME_X_WINDOW (f), | 3457 | FRAME_X_WINDOW (f), |
| 3458 | oldx, oldy, oldw, oldh, 0); | 3458 | oldx, oldy, oldw, oldh, 0); |
| 3459 | } | 3459 | } |
| 3460 | 3460 | ||
| 3461 | /* GTK does not redraw until the main loop is entered again, but | 3461 | /* GTK does not redraw until the main loop is entered again, but |
| 3462 | if there are no X events pending we will not enter it. So we sync | 3462 | if there are no X events pending we will not enter it. So we sync |
| 3463 | here to get some events. */ | 3463 | here to get some events. */ |
| 3464 | 3464 | ||
| 3465 | x_sync (f); | 3465 | x_sync (f); |
| 3466 | SET_FRAME_GARBAGED (f); | 3466 | SET_FRAME_GARBAGED (f); |
| 3467 | cancel_mouse_face (f); | 3467 | cancel_mouse_face (f); |
| @@ -3576,7 +3576,7 @@ xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event) | |||
| 3576 | GtkWidget *w = gtk_grab_get_current (); | 3576 | GtkWidget *w = gtk_grab_get_current (); |
| 3577 | retval = w != 0 && GTK_IS_SCROLLBAR (w); | 3577 | retval = w != 0 && GTK_IS_SCROLLBAR (w); |
| 3578 | } | 3578 | } |
| 3579 | 3579 | ||
| 3580 | return retval; | 3580 | return retval; |
| 3581 | } | 3581 | } |
| 3582 | 3582 | ||
| @@ -3664,7 +3664,7 @@ xg_tool_bar_callback (GtkWidget *w, gpointer client_data) | |||
| 3664 | this is written. */ | 3664 | this is written. */ |
| 3665 | event.modifiers = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), mod); | 3665 | event.modifiers = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), mod); |
| 3666 | kbd_buffer_store_event (&event); | 3666 | kbd_buffer_store_event (&event); |
| 3667 | 3667 | ||
| 3668 | /* Return focus to the frame after we have clicked on a detached | 3668 | /* Return focus to the frame after we have clicked on a detached |
| 3669 | tool bar button. */ | 3669 | tool bar button. */ |
| 3670 | Fx_focus_frame (frame); | 3670 | Fx_focus_frame (frame); |
| @@ -3701,7 +3701,7 @@ xg_tool_bar_proxy_help_callback (GtkWidget *w, | |||
| 3701 | { | 3701 | { |
| 3702 | GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), | 3702 | GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), |
| 3703 | XG_TOOL_BAR_PROXY_BUTTON)); | 3703 | XG_TOOL_BAR_PROXY_BUTTON)); |
| 3704 | 3704 | ||
| 3705 | return xg_tool_bar_help_callback (wbutton, event, client_data); | 3705 | return xg_tool_bar_help_callback (wbutton, event, client_data); |
| 3706 | } | 3706 | } |
| 3707 | 3707 | ||
| @@ -3804,7 +3804,7 @@ xg_tool_bar_menu_proxy (GtkToolItem *toolitem, gpointer user_data) | |||
| 3804 | G_CALLBACK (xg_tool_bar_proxy_callback), | 3804 | G_CALLBACK (xg_tool_bar_proxy_callback), |
| 3805 | user_data); | 3805 | user_data); |
| 3806 | 3806 | ||
| 3807 | 3807 | ||
| 3808 | g_object_set_data (G_OBJECT (wmenuitem), XG_TOOL_BAR_PROXY_BUTTON, | 3808 | g_object_set_data (G_OBJECT (wmenuitem), XG_TOOL_BAR_PROXY_BUTTON, |
| 3809 | (gpointer) wbutton); | 3809 | (gpointer) wbutton); |
| 3810 | gtk_tool_item_set_proxy_menu_item (toolitem, "Emacs toolbar item", wmenuitem); | 3810 | gtk_tool_item_set_proxy_menu_item (toolitem, "Emacs toolbar item", wmenuitem); |
| @@ -4002,7 +4002,7 @@ xg_pack_tool_bar (FRAME_PTR f, Lisp_Object pos) | |||
| 4002 | x->toolbar_widget); | 4002 | x->toolbar_widget); |
| 4003 | } | 4003 | } |
| 4004 | 4004 | ||
| 4005 | if (into_hbox) | 4005 | if (into_hbox) |
| 4006 | { | 4006 | { |
| 4007 | gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget), | 4007 | gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget), |
| 4008 | GTK_POS_TOP); | 4008 | GTK_POS_TOP); |
| @@ -4093,7 +4093,7 @@ xg_make_tool_item (FRAME_PTR f, | |||
| 4093 | Lisp_Object style = Ftool_bar_get_system_style (); | 4093 | Lisp_Object style = Ftool_bar_get_system_style (); |
| 4094 | int both_horiz = EQ (style, Qboth_horiz); | 4094 | int both_horiz = EQ (style, Qboth_horiz); |
| 4095 | int text_image = EQ (style, Qtext_image_horiz); | 4095 | int text_image = EQ (style, Qtext_image_horiz); |
| 4096 | 4096 | ||
| 4097 | GtkWidget *vb = both_horiz || text_image | 4097 | GtkWidget *vb = both_horiz || text_image |
| 4098 | ? gtk_hbox_new (FALSE, 0) : gtk_vbox_new (FALSE, 0); | 4098 | ? gtk_hbox_new (FALSE, 0) : gtk_vbox_new (FALSE, 0); |
| 4099 | GtkWidget *wb = gtk_button_new (); | 4099 | GtkWidget *wb = gtk_button_new (); |
| @@ -4147,7 +4147,7 @@ xg_make_tool_item (FRAME_PTR f, | |||
| 4147 | NULL); | 4147 | NULL); |
| 4148 | 4148 | ||
| 4149 | g_object_set_data (G_OBJECT (wb), XG_FRAME_DATA, (gpointer)f); | 4149 | g_object_set_data (G_OBJECT (wb), XG_FRAME_DATA, (gpointer)f); |
| 4150 | 4150 | ||
| 4151 | /* Use enter/leave notify to show help. We use the events | 4151 | /* Use enter/leave notify to show help. We use the events |
| 4152 | rather than the GtkButton specific signals "enter" and | 4152 | rather than the GtkButton specific signals "enter" and |
| 4153 | "leave", so we can have only one callback. The event | 4153 | "leave", so we can have only one callback. The event |
| @@ -4162,7 +4162,7 @@ xg_make_tool_item (FRAME_PTR f, | |||
| 4162 | G_CALLBACK (xg_tool_bar_help_callback), | 4162 | G_CALLBACK (xg_tool_bar_help_callback), |
| 4163 | (gpointer) (EMACS_INT) i); | 4163 | (gpointer) (EMACS_INT) i); |
| 4164 | } | 4164 | } |
| 4165 | 4165 | ||
| 4166 | if (wbutton) *wbutton = wb; | 4166 | if (wbutton) *wbutton = wb; |
| 4167 | 4167 | ||
| 4168 | return ti; | 4168 | return ti; |
| @@ -4248,7 +4248,7 @@ xg_update_tool_bar_sizes (FRAME_PTR f) | |||
| 4248 | if (pos == 0 || (pos == 1 && x->menubar_widget)) nt = req.height; | 4248 | if (pos == 0 || (pos == 1 && x->menubar_widget)) nt = req.height; |
| 4249 | else nb = req.height; | 4249 | else nb = req.height; |
| 4250 | } | 4250 | } |
| 4251 | 4251 | ||
| 4252 | if (nl != FRAME_TOOLBAR_LEFT_WIDTH (f) | 4252 | if (nl != FRAME_TOOLBAR_LEFT_WIDTH (f) |
| 4253 | || nr != FRAME_TOOLBAR_RIGHT_WIDTH (f) | 4253 | || nr != FRAME_TOOLBAR_RIGHT_WIDTH (f) |
| 4254 | || nt != FRAME_TOOLBAR_TOP_HEIGHT (f) | 4254 | || nt != FRAME_TOOLBAR_TOP_HEIGHT (f) |
| @@ -4314,7 +4314,7 @@ update_frame_tool_bar (FRAME_PTR f) | |||
| 4314 | 4314 | ||
| 4315 | wtoolbar = GTK_TOOLBAR (x->toolbar_widget); | 4315 | wtoolbar = GTK_TOOLBAR (x->toolbar_widget); |
| 4316 | dir = gtk_widget_get_direction (GTK_WIDGET (wtoolbar)); | 4316 | dir = gtk_widget_get_direction (GTK_WIDGET (wtoolbar)); |
| 4317 | 4317 | ||
| 4318 | for (i = 0; i < f->n_tool_bar_items; ++i) | 4318 | for (i = 0; i < f->n_tool_bar_items; ++i) |
| 4319 | { | 4319 | { |
| 4320 | int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P)); | 4320 | int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P)); |
| @@ -4560,7 +4560,7 @@ free_frame_tool_bar (FRAME_PTR f) | |||
| 4560 | BLOCK_INPUT; | 4560 | BLOCK_INPUT; |
| 4561 | /* We may have created the toolbar_widget in xg_create_tool_bar, but | 4561 | /* We may have created the toolbar_widget in xg_create_tool_bar, but |
| 4562 | not the x->handlebox_widget which is created in xg_pack_tool_bar. */ | 4562 | not the x->handlebox_widget which is created in xg_pack_tool_bar. */ |
| 4563 | if (is_packed) | 4563 | if (is_packed) |
| 4564 | { | 4564 | { |
| 4565 | if (x->toolbar_in_hbox) | 4565 | if (x->toolbar_in_hbox) |
| 4566 | gtk_container_remove (GTK_CONTAINER (x->hbox_widget), | 4566 | gtk_container_remove (GTK_CONTAINER (x->hbox_widget), |