aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog46
-rw-r--r--src/Makefile.in10
-rw-r--r--src/coding.c3
-rw-r--r--src/coding.h2
-rw-r--r--src/dispextern.h13
-rw-r--r--src/gtkutil.c98
-rw-r--r--src/xdisp.c7
-rw-r--r--src/xterm.h7
8 files changed, 142 insertions, 44 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e95df2b8953..483930a6489 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,49 @@
12012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2
3 * coding.c (Qmac): Now static.
4
52012-12-30 Jan Djärv <jan.h.d@swipnet.se>
6
7 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
8 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
9 handlebox_widget. Set toolbar_in_hbox to false/true, set
10 toolbar_is_packed to true.
11 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
12 (update_frame_tool_bar): Check toolbar_is_packed for packing.
13 Show all on TOOLBAR_TOP_WIDGET.
14 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
15 by TOOLBAR_TOP_WIDGET.
16 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
17 Check toolbar_is_packed.
18 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
19 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
20 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
21 false.
22 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
23 (xg_update_menubar): Update title only if
24 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
25 (xg_update_submenu): Skip tearoff only if
26 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
27 (xg_initialize): Initialize xg_detached_menus only if
28 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
29
30 * xterm.h (struct x_output): Surround handlebox_widget with
31 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
32 toolbar_in_hbox is bool.
33
342012-12-30 Andreas Schwab <schwab@linux-m68k.org>
35
36 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
37 (LIBS_GNUSTEP): Define.
38 (LIBES): Add $(LIBS_GNUSTEP).
39 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
40
412012-12-30 Eli Zaretskii <eliz@gnu.org>
42
43 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
44 continuation glyph on a TTY with an indication of an empty line.
45 (Bug#13277)
46
12012-12-29 Eli Zaretskii <eliz@gnu.org> 472012-12-29 Eli Zaretskii <eliz@gnu.org>
2 48
3 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if 49 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
diff --git a/src/Makefile.in b/src/Makefile.in
index f430c787d56..eb4e8903812 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -111,9 +111,6 @@ LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
111## Flags to pass to ld only for temacs. 111## Flags to pass to ld only for temacs.
112TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_TEMACS) 112TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_TEMACS)
113 113
114## $LDFLAGS or empty if NS_IMPL_GNUSTEP (for some reason).
115TEMACS_LDFLAGS2 = @TEMACS_LDFLAGS2@
116
117## If available, the full path to the paxctl program. 114## If available, the full path to the paxctl program.
118## On grsecurity/PaX systems, unexec will fail due to a gap between 115## On grsecurity/PaX systems, unexec will fail due to a gap between
119## the bss section and the heap. This can be prevented by disabling 116## the bss section and the heap. This can be prevented by disabling
@@ -230,6 +227,9 @@ LIBX_OTHER=@LIBX_OTHER@
230## configure, which should set it to nil in non-X builds. 227## configure, which should set it to nil in non-X builds.
231LIBX_BASE=$(LIBXMENU) $(LD_SWITCH_X_SITE) 228LIBX_BASE=$(LIBXMENU) $(LD_SWITCH_X_SITE)
232 229
230## Only used for GNUstep
231LIBS_GNUSTEP=@LIBS_GNUSTEP@
232
233LIBSOUND= @LIBSOUND@ 233LIBSOUND= @LIBSOUND@
234CFLAGS_SOUND= @CFLAGS_SOUND@ 234CFLAGS_SOUND= @CFLAGS_SOUND@
235 235
@@ -412,7 +412,7 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
412## Note that SunOS needs -lm to come before -lc; otherwise, you get 412## Note that SunOS needs -lm to come before -lc; otherwise, you get
413## duplicated symbols. If the standard libraries were compiled 413## duplicated symbols. If the standard libraries were compiled
414## with GCC, we might need LIB_GCC again after them. 414## with GCC, we might need LIB_GCC again after them.
415LIBES = $(LIBS) $(W32_LIBS) $(LIBX_BASE) $(LIBIMAGE) \ 415LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
416 $(LIBX_OTHER) $(LIBSOUND) \ 416 $(LIBX_OTHER) $(LIBSOUND) \
417 $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) \ 417 $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) \
418 $(WEBKIT_LIBS) $(CLUTTER_LIBS) $(GIR_LIBS) \ 418 $(WEBKIT_LIBS) $(CLUTTER_LIBS) $(GIR_LIBS) \
@@ -488,7 +488,7 @@ $(lib)/libgnu.a: $(config_h)
488 488
489temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) \ 489temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) \
490 $(lib)/libgnu.a $(W32_RES) 490 $(lib)/libgnu.a $(W32_RES)
491 $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(TEMACS_LDFLAGS2) \ 491 $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
492 -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES) \ 492 -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES) \
493 $(W32_RES_LINK) 493 $(W32_RES_LINK)
494 test "$(CANNOT_DUMP)" = "yes" || \ 494 test "$(CANNOT_DUMP)" = "yes" || \
diff --git a/src/coding.c b/src/coding.c
index 2c1139ec5fc..044583d26b6 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -301,7 +301,8 @@ Lisp_Object Vcoding_system_hash_table;
301 301
302static Lisp_Object Qcoding_system, Qeol_type; 302static Lisp_Object Qcoding_system, Qeol_type;
303static Lisp_Object Qcoding_aliases; 303static Lisp_Object Qcoding_aliases;
304Lisp_Object Qunix, Qdos, Qmac; 304Lisp_Object Qunix, Qdos;
305static Lisp_Object Qmac;
305Lisp_Object Qbuffer_file_coding_system; 306Lisp_Object Qbuffer_file_coding_system;
306static Lisp_Object Qpost_read_conversion, Qpre_write_conversion; 307static Lisp_Object Qpost_read_conversion, Qpre_write_conversion;
307static Lisp_Object Qdefault_char; 308static Lisp_Object Qdefault_char;
diff --git a/src/coding.h b/src/coding.h
index 192be58f083..db0033c751b 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -767,7 +767,7 @@ extern Lisp_Object Qcoding_system_p;
767extern Lisp_Object Qraw_text, Qemacs_mule, Qno_conversion, Qundecided; 767extern Lisp_Object Qraw_text, Qemacs_mule, Qno_conversion, Qundecided;
768extern Lisp_Object Qbuffer_file_coding_system; 768extern Lisp_Object Qbuffer_file_coding_system;
769 769
770extern Lisp_Object Qunix, Qdos, Qmac; 770extern Lisp_Object Qunix, Qdos;
771 771
772extern Lisp_Object Qtranslation_table; 772extern Lisp_Object Qtranslation_table;
773extern Lisp_Object Qtranslation_table_id; 773extern Lisp_Object Qtranslation_table_id;
diff --git a/src/dispextern.h b/src/dispextern.h
index 55fd852ea3b..3b24d49da75 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -321,13 +321,18 @@ struct glyph
321 Lisp string, this is a position in that string. If it is a 321 Lisp string, this is a position in that string. If it is a
322 buffer, this is a position in that buffer. A value of -1 322 buffer, this is a position in that buffer. A value of -1
323 together with a null object means glyph is a truncation glyph at 323 together with a null object means glyph is a truncation glyph at
324 the start of a row. */ 324 the start of a row. Right truncation and continuation glyphs at
325 the right edge of a row have their position set to the next
326 buffer position that is not shown on this row. Glyphs inserted
327 by redisplay, such as the empty space after the end of a line on
328 TTYs, or the overlay-arrow on a TTY, have this set to -1. */
325 ptrdiff_t charpos; 329 ptrdiff_t charpos;
326 330
327 /* Lisp object source of this glyph. Currently either a buffer or 331 /* Lisp object source of this glyph. Currently either a buffer or a
328 a string, if the glyph was produced from characters which came from 332 string, if the glyph was produced from characters which came from
329 a buffer or a string; or 0 if the glyph was inserted by redisplay 333 a buffer or a string; or 0 if the glyph was inserted by redisplay
330 for its own purposes such as padding. */ 334 for its own purposes, such as padding or truncation/continuation
335 glyphs, or the overlay-arrow glyphs on TTYs. */
331 Lisp_Object object; 336 Lisp_Object object;
332 337
333 /* Width in pixels. */ 338 /* Width in pixels. */
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 7f50b67d1e5..7b05cff71c0 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -2416,6 +2416,8 @@ make_menu_item (const char *utf8_label,
2416 return w; 2416 return w;
2417} 2417}
2418 2418
2419#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
2420
2419static int xg_detached_menus; 2421static int xg_detached_menus;
2420 2422
2421/* Return true if there are detached menus. */ 2423/* Return true if there are detached menus. */
@@ -2454,7 +2456,13 @@ tearoff_activate (GtkWidget *widget, gpointer client_data)
2454 G_CALLBACK (tearoff_remove), 0); 2456 G_CALLBACK (tearoff_remove), 0);
2455 } 2457 }
2456} 2458}
2457 2459#else /* ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW */
2460bool
2461xg_have_tear_offs (void)
2462{
2463 return false;
2464}
2465#endif /* ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW */
2458 2466
2459/* Create a menu item widget, and connect the callbacks. 2467/* Create a menu item widget, and connect the callbacks.
2460 ITEM describes the menu item. 2468 ITEM describes the menu item.
@@ -2526,7 +2534,8 @@ xg_create_one_menuitem (widget_value *item,
2526 HIGHLIGHT_CB is the callback to call when entering/leaving menu items. 2534 HIGHLIGHT_CB is the callback to call when entering/leaving menu items.
2527 If POP_UP_P, create a popup menu. 2535 If POP_UP_P, create a popup menu.
2528 If MENU_BAR_P, create a menu bar. 2536 If MENU_BAR_P, create a menu bar.
2529 If ADD_TEAROFF_P, add a tearoff menu item. Ignored if MENU_BAR_P. 2537 If ADD_TEAROFF_P, add a tearoff menu item. Ignored if MENU_BAR_P or
2538 the Gtk+ version used does not have tearoffs.
2530 TOPMENU is the topmost GtkWidget that others shall be placed under. 2539 TOPMENU is the topmost GtkWidget that others shall be placed under.
2531 It may be NULL, in that case we create the appropriate widget 2540 It may be NULL, in that case we create the appropriate widget
2532 (menu bar or menu item depending on POP_UP_P and MENU_BAR_P) 2541 (menu bar or menu item depending on POP_UP_P and MENU_BAR_P)
@@ -2599,6 +2608,7 @@ create_menus (widget_value *data,
2599 "selection-done", deactivate_cb, 0); 2608 "selection-done", deactivate_cb, 0);
2600 } 2609 }
2601 2610
2611#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
2602 if (! menu_bar_p && add_tearoff_p) 2612 if (! menu_bar_p && add_tearoff_p)
2603 { 2613 {
2604 GtkWidget *tearoff = gtk_tearoff_menu_item_new (); 2614 GtkWidget *tearoff = gtk_tearoff_menu_item_new ();
@@ -2607,6 +2617,7 @@ create_menus (widget_value *data,
2607 g_signal_connect (G_OBJECT (tearoff), "activate", 2617 g_signal_connect (G_OBJECT (tearoff), "activate",
2608 G_CALLBACK (tearoff_activate), 0); 2618 G_CALLBACK (tearoff_activate), 0);
2609 } 2619 }
2620#endif
2610 2621
2611 for (item = data; item; item = item->next) 2622 for (item = data; item; item = item->next)
2612 { 2623 {
@@ -2897,11 +2908,13 @@ xg_update_menubar (GtkWidget *menubar,
2897 2908
2898 gtk_label_set_text (wlabel, utf8_label); 2909 gtk_label_set_text (wlabel, utf8_label);
2899 2910
2911#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
2900 /* If this item has a submenu that has been detached, change 2912 /* If this item has a submenu that has been detached, change
2901 the title in the WM decorations also. */ 2913 the title in the WM decorations also. */
2902 if (submenu && gtk_menu_get_tearoff_state (GTK_MENU (submenu))) 2914 if (submenu && gtk_menu_get_tearoff_state (GTK_MENU (submenu)))
2903 /* Set the title of the detached window. */ 2915 /* Set the title of the detached window. */
2904 gtk_menu_set_title (GTK_MENU (submenu), utf8_label); 2916 gtk_menu_set_title (GTK_MENU (submenu), utf8_label);
2917#endif
2905 2918
2906 if (utf8_label) g_free (utf8_label); 2919 if (utf8_label) g_free (utf8_label);
2907 iter = g_list_next (iter); 2920 iter = g_list_next (iter);
@@ -3129,7 +3142,8 @@ xg_update_submenu (GtkWidget *submenu,
3129 { 3142 {
3130 GtkWidget *w = GTK_WIDGET (iter->data); 3143 GtkWidget *w = GTK_WIDGET (iter->data);
3131 3144
3132 /* Skip tearoff items, they have no counterpart in val. */ 3145#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
3146 /* Skip tearoff items, they have no counterpart in val. */
3133 if (GTK_IS_TEAROFF_MENU_ITEM (w)) 3147 if (GTK_IS_TEAROFF_MENU_ITEM (w))
3134 { 3148 {
3135 has_tearoff_p = 1; 3149 has_tearoff_p = 1;
@@ -3137,6 +3151,7 @@ xg_update_submenu (GtkWidget *submenu,
3137 if (iter) w = GTK_WIDGET (iter->data); 3151 if (iter) w = GTK_WIDGET (iter->data);
3138 else break; 3152 else break;
3139 } 3153 }
3154#endif
3140 3155
3141 /* Remember first radio button in a group. If we get a mismatch in 3156 /* Remember first radio button in a group. If we get a mismatch in
3142 a radio group we must rebuild the whole group so that the connections 3157 a radio group we must rebuild the whole group so that the connections
@@ -4269,6 +4284,12 @@ xg_tool_bar_item_expose_callback (GtkWidget *w,
4269 gtk_toolbar_set_orientation (GTK_TOOLBAR (w), o) 4284 gtk_toolbar_set_orientation (GTK_TOOLBAR (w), o)
4270#endif 4285#endif
4271 4286
4287#ifdef HAVE_GTK_HANDLE_BOX_NEW
4288#define TOOLBAR_TOP_WIDGET(x) ((x)->handlebox_widget)
4289#else
4290#define TOOLBAR_TOP_WIDGET(x) ((x)->toolbar_widget)
4291#endif
4292
4272/* Attach a tool bar to frame F. */ 4293/* Attach a tool bar to frame F. */
4273 4294
4274static void 4295static void
@@ -4276,14 +4297,16 @@ xg_pack_tool_bar (FRAME_PTR f, Lisp_Object pos)
4276{ 4297{
4277 struct x_output *x = f->output_data.x; 4298 struct x_output *x = f->output_data.x;
4278 bool into_hbox = EQ (pos, Qleft) || EQ (pos, Qright); 4299 bool into_hbox = EQ (pos, Qleft) || EQ (pos, Qright);
4300 GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x);
4279 4301
4280 toolbar_set_orientation (x->toolbar_widget, 4302 toolbar_set_orientation (x->toolbar_widget,
4281 into_hbox 4303 into_hbox
4282 ? GTK_ORIENTATION_VERTICAL 4304 ? GTK_ORIENTATION_VERTICAL
4283 : GTK_ORIENTATION_HORIZONTAL); 4305 : GTK_ORIENTATION_HORIZONTAL);
4306#ifdef HAVE_GTK_HANDLE_BOX_NEW
4284 if (!x->handlebox_widget) 4307 if (!x->handlebox_widget)
4285 { 4308 {
4286 x->handlebox_widget = gtk_handle_box_new (); 4309 top_widget = x->handlebox_widget = gtk_handle_box_new ();
4287 g_signal_connect (G_OBJECT (x->handlebox_widget), "child-detached", 4310 g_signal_connect (G_OBJECT (x->handlebox_widget), "child-detached",
4288 G_CALLBACK (xg_tool_bar_detach_callback), f); 4311 G_CALLBACK (xg_tool_bar_detach_callback), f);
4289 g_signal_connect (G_OBJECT (x->handlebox_widget), "child-attached", 4312 g_signal_connect (G_OBJECT (x->handlebox_widget), "child-attached",
@@ -4291,34 +4314,40 @@ xg_pack_tool_bar (FRAME_PTR f, Lisp_Object pos)
4291 gtk_container_add (GTK_CONTAINER (x->handlebox_widget), 4314 gtk_container_add (GTK_CONTAINER (x->handlebox_widget),
4292 x->toolbar_widget); 4315 x->toolbar_widget);
4293 } 4316 }
4317#endif
4294 4318
4295 if (into_hbox) 4319 if (into_hbox)
4296 { 4320 {
4321#ifdef HAVE_GTK_HANDLE_BOX_NEW
4297 gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget), 4322 gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget),
4298 GTK_POS_TOP); 4323 GTK_POS_TOP);
4299 gtk_box_pack_start (GTK_BOX (x->hbox_widget), x->handlebox_widget, 4324#endif
4325 gtk_box_pack_start (GTK_BOX (x->hbox_widget), top_widget,
4300 FALSE, FALSE, 0); 4326 FALSE, FALSE, 0);
4301 4327
4302 if (EQ (pos, Qleft)) 4328 if (EQ (pos, Qleft))
4303 gtk_box_reorder_child (GTK_BOX (x->hbox_widget), 4329 gtk_box_reorder_child (GTK_BOX (x->hbox_widget),
4304 x->handlebox_widget, 4330 top_widget,
4305 0); 4331 0);
4306 x->toolbar_in_hbox = 1; 4332 x->toolbar_in_hbox = true;
4307 } 4333 }
4308 else 4334 else
4309 { 4335 {
4310 bool vbox_pos = x->menubar_widget != 0; 4336 bool vbox_pos = x->menubar_widget != 0;
4337#ifdef HAVE_GTK_HANDLE_BOX_NEW
4311 gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget), 4338 gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget),
4312 GTK_POS_LEFT); 4339 GTK_POS_LEFT);
4313 gtk_box_pack_start (GTK_BOX (x->vbox_widget), x->handlebox_widget, 4340#endif
4341 gtk_box_pack_start (GTK_BOX (x->vbox_widget), top_widget,
4314 FALSE, FALSE, 0); 4342 FALSE, FALSE, 0);
4315 4343
4316 if (EQ (pos, Qtop)) 4344 if (EQ (pos, Qtop))
4317 gtk_box_reorder_child (GTK_BOX (x->vbox_widget), 4345 gtk_box_reorder_child (GTK_BOX (x->vbox_widget),
4318 x->handlebox_widget, 4346 top_widget,
4319 vbox_pos); 4347 vbox_pos);
4320 x->toolbar_in_hbox = 0; 4348 x->toolbar_in_hbox = false;
4321 } 4349 }
4350 x->toolbar_is_packed = true;
4322} 4351}
4323 4352
4324/* Create a tool bar for frame F. */ 4353/* Create a tool bar for frame F. */
@@ -4561,13 +4590,14 @@ xg_update_tool_bar_sizes (FRAME_PTR f)
4561 struct x_output *x = f->output_data.x; 4590 struct x_output *x = f->output_data.x;
4562 GtkRequisition req; 4591 GtkRequisition req;
4563 int nl = 0, nr = 0, nt = 0, nb = 0; 4592 int nl = 0, nr = 0, nt = 0, nb = 0;
4593 GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x);
4564 4594
4565 gtk_widget_get_preferred_size (GTK_WIDGET (x->handlebox_widget), NULL, &req); 4595 gtk_widget_get_preferred_size (GTK_WIDGET (top_widget), NULL, &req);
4566 if (x->toolbar_in_hbox) 4596 if (x->toolbar_in_hbox)
4567 { 4597 {
4568 int pos; 4598 int pos;
4569 gtk_container_child_get (GTK_CONTAINER (x->hbox_widget), 4599 gtk_container_child_get (GTK_CONTAINER (x->hbox_widget),
4570 x->handlebox_widget, 4600 top_widget,
4571 "position", &pos, NULL); 4601 "position", &pos, NULL);
4572 if (pos == 0) nl = req.width; 4602 if (pos == 0) nl = req.width;
4573 else nr = req.width; 4603 else nr = req.width;
@@ -4576,7 +4606,7 @@ xg_update_tool_bar_sizes (FRAME_PTR f)
4576 { 4606 {
4577 int pos; 4607 int pos;
4578 gtk_container_child_get (GTK_CONTAINER (x->vbox_widget), 4608 gtk_container_child_get (GTK_CONTAINER (x->vbox_widget),
4579 x->handlebox_widget, 4609 top_widget,
4580 "position", &pos, NULL); 4610 "position", &pos, NULL);
4581 if (pos == 0 || (pos == 1 && x->menubar_widget)) nt = req.height; 4611 if (pos == 0 || (pos == 1 && x->menubar_widget)) nt = req.height;
4582 else nb = req.height; 4612 else nb = req.height;
@@ -4611,7 +4641,6 @@ update_frame_tool_bar (FRAME_PTR f)
4611 GtkToolbar *wtoolbar; 4641 GtkToolbar *wtoolbar;
4612 GtkToolItem *ti; 4642 GtkToolItem *ti;
4613 GtkTextDirection dir; 4643 GtkTextDirection dir;
4614 bool pack_tool_bar = x->handlebox_widget == NULL;
4615 Lisp_Object style; 4644 Lisp_Object style;
4616 bool text_image, horiz; 4645 bool text_image, horiz;
4617 struct xg_frame_tb_info *tbinfo; 4646 struct xg_frame_tb_info *tbinfo;
@@ -4865,9 +4894,9 @@ update_frame_tool_bar (FRAME_PTR f)
4865 4894
4866 if (f->n_tool_bar_items != 0) 4895 if (f->n_tool_bar_items != 0)
4867 { 4896 {
4868 if (pack_tool_bar) 4897 if (! x->toolbar_is_packed)
4869 xg_pack_tool_bar (f, f->tool_bar_position); 4898 xg_pack_tool_bar (f, f->tool_bar_position);
4870 gtk_widget_show_all (GTK_WIDGET (x->handlebox_widget)); 4899 gtk_widget_show_all (TOOLBAR_TOP_WIDGET (x));
4871 if (xg_update_tool_bar_sizes (f)) 4900 if (xg_update_tool_bar_sizes (f))
4872 xg_height_or_width_changed (f); 4901 xg_height_or_width_changed (f);
4873 } 4902 }
@@ -4886,24 +4915,26 @@ free_frame_tool_bar (FRAME_PTR f)
4886 if (x->toolbar_widget) 4915 if (x->toolbar_widget)
4887 { 4916 {
4888 struct xg_frame_tb_info *tbinfo; 4917 struct xg_frame_tb_info *tbinfo;
4889 bool is_packed = x->handlebox_widget != 0; 4918 GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x);
4919
4890 block_input (); 4920 block_input ();
4891 /* We may have created the toolbar_widget in xg_create_tool_bar, but 4921 /* We may have created the toolbar_widget in xg_create_tool_bar, but
4892 not the x->handlebox_widget which is created in xg_pack_tool_bar. */ 4922 not the x->handlebox_widget which is created in xg_pack_tool_bar. */
4893 if (is_packed) 4923 if (x->toolbar_is_packed)
4894 { 4924 {
4895 if (x->toolbar_in_hbox) 4925 if (x->toolbar_in_hbox)
4896 gtk_container_remove (GTK_CONTAINER (x->hbox_widget), 4926 gtk_container_remove (GTK_CONTAINER (x->hbox_widget),
4897 x->handlebox_widget); 4927 top_widget);
4898 else 4928 else
4899 gtk_container_remove (GTK_CONTAINER (x->vbox_widget), 4929 gtk_container_remove (GTK_CONTAINER (x->vbox_widget),
4900 x->handlebox_widget); 4930 top_widget);
4901 } 4931 }
4902 else 4932 else
4903 gtk_widget_destroy (x->toolbar_widget); 4933 gtk_widget_destroy (x->toolbar_widget);
4904 4934
4905 x->toolbar_widget = 0; 4935 x->toolbar_widget = 0;
4906 x->handlebox_widget = 0; 4936 TOOLBAR_TOP_WIDGET (x) = 0;
4937 x->toolbar_is_packed = false;
4907 FRAME_TOOLBAR_TOP_HEIGHT (f) = FRAME_TOOLBAR_BOTTOM_HEIGHT (f) = 0; 4938 FRAME_TOOLBAR_TOP_HEIGHT (f) = FRAME_TOOLBAR_BOTTOM_HEIGHT (f) = 0;
4908 FRAME_TOOLBAR_LEFT_WIDTH (f) = FRAME_TOOLBAR_RIGHT_WIDTH (f) = 0; 4939 FRAME_TOOLBAR_LEFT_WIDTH (f) = FRAME_TOOLBAR_RIGHT_WIDTH (f) = 0;
4909 4940
@@ -4927,20 +4958,25 @@ void
4927xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos) 4958xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos)
4928{ 4959{
4929 struct x_output *x = f->output_data.x; 4960 struct x_output *x = f->output_data.x;
4961 GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x);
4930 4962
4931 if (! x->toolbar_widget || ! x->handlebox_widget) 4963 if (! x->toolbar_widget || ! top_widget)
4932 return; 4964 return;
4933 4965
4934 block_input (); 4966 block_input ();
4935 g_object_ref (x->handlebox_widget); 4967 g_object_ref (top_widget);
4936 if (x->toolbar_in_hbox) 4968 if (x->toolbar_is_packed)
4937 gtk_container_remove (GTK_CONTAINER (x->hbox_widget), 4969 {
4938 x->handlebox_widget); 4970 if (x->toolbar_in_hbox)
4939 else 4971 gtk_container_remove (GTK_CONTAINER (x->hbox_widget),
4940 gtk_container_remove (GTK_CONTAINER (x->vbox_widget), 4972 top_widget);
4941 x->handlebox_widget); 4973 else
4974 gtk_container_remove (GTK_CONTAINER (x->vbox_widget),
4975 top_widget);
4976 }
4977
4942 xg_pack_tool_bar (f, pos); 4978 xg_pack_tool_bar (f, pos);
4943 g_object_unref (x->handlebox_widget); 4979 g_object_unref (top_widget);
4944 if (xg_update_tool_bar_sizes (f)) 4980 if (xg_update_tool_bar_sizes (f))
4945 xg_height_or_width_changed (f); 4981 xg_height_or_width_changed (f);
4946 4982
@@ -4966,7 +5002,9 @@ xg_initialize (void)
4966 5002
4967 gdpy_def = NULL; 5003 gdpy_def = NULL;
4968 xg_ignore_gtk_scrollbar = 0; 5004 xg_ignore_gtk_scrollbar = 0;
5005#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
4969 xg_detached_menus = 0; 5006 xg_detached_menus = 0;
5007#endif
4970 xg_menu_cb_list.prev = xg_menu_cb_list.next = 5008 xg_menu_cb_list.prev = xg_menu_cb_list.next =
4971 xg_menu_item_cb_list.prev = xg_menu_item_cb_list.next = 0; 5009 xg_menu_item_cb_list.prev = xg_menu_item_cb_list.next = 0;
4972 5010
diff --git a/src/xdisp.c b/src/xdisp.c
index 26d41a42cc8..2464fc06fa4 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14250,7 +14250,12 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
14250 CHARPOS is zero or negative. */ 14250 CHARPOS is zero or negative. */
14251 int empty_line_p = 14251 int empty_line_p =
14252 (row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end) 14252 (row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)
14253 && INTEGERP (glyph->object) && glyph->charpos > 0; 14253 && INTEGERP (glyph->object) && glyph->charpos > 0
14254 /* On a TTY, continued and truncated rows also have a glyph at
14255 their end whose OBJECT is zero and whose CHARPOS is
14256 positive (the continuation and truncation glyphs), but such
14257 rows are obviously not "empty". */
14258 && !(row->continued_p || row->truncated_on_right_p);
14254 14259
14255 if (row->ends_in_ellipsis_p && pos_after == last_pos) 14260 if (row->ends_in_ellipsis_p && pos_after == last_pos)
14256 { 14261 {
diff --git a/src/xterm.h b/src/xterm.h
index e680cbe7dd2..2d99d2f25db 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -473,10 +473,13 @@ struct x_output
473 GtkWidget *menubar_widget; 473 GtkWidget *menubar_widget;
474 /* The tool bar in this frame */ 474 /* The tool bar in this frame */
475 GtkWidget *toolbar_widget; 475 GtkWidget *toolbar_widget;
476 /* The handle box that makes the tool bar detachable. */ 476#ifdef HAVE_GTK_HANDLE_BOX_NEW
477/* The handle box that makes the tool bar detachable. */
477 GtkWidget *handlebox_widget; 478 GtkWidget *handlebox_widget;
479#endif
478 /* Non-zero if tool bar is packed into the hbox widget (i.e. vertical). */ 480 /* Non-zero if tool bar is packed into the hbox widget (i.e. vertical). */
479 int toolbar_in_hbox; 481 bool toolbar_in_hbox;
482 bool toolbar_is_packed;
480 483
481 /* The last size hints set. */ 484 /* The last size hints set. */
482 GdkGeometry size_hints; 485 GdkGeometry size_hints;