aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2003-03-26 18:07:46 +0000
committerJan Djärv2003-03-26 18:07:46 +0000
commit5fd6f7273981c1c3c5c8bd8b21661e2f89e05ab8 (patch)
treed2878318cebc53b993090a25986c70679c7a3760 /src
parent9227d8f1c38f52b2c2f666dd5aa66364bcb2386f (diff)
downloademacs-5fd6f7273981c1c3c5c8bd8b21661e2f89e05ab8.tar.gz
emacs-5fd6f7273981c1c3c5c8bd8b21661e2f89e05ab8.zip
* gtkutil.c (xg_resize_widgets): Don't call xg_frame_cleared.
(xg_frame_set_char_size): Calculate scroll bar width before frame width. Call SET_FRAME_GARBAGED and cancel_mouse_face. (xg_separator_p): Check for all documented separator types. (xg_update_scrollbar_pos): Variable gheight not needed, use height. (update_frame_tool_bar): Don't call gdk_window_process_all_updates.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/gtkutil.c76
2 files changed, 63 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d04286bc795..b4b834eaa3c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
12003-03-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 12003-03-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 2
3 * gtkutil.c (xg_resize_widgets): Don't call xg_frame_cleared.
4 (xg_frame_set_char_size): Calculate scroll bar width before frame
5 width. Call SET_FRAME_GARBAGED and cancel_mouse_face.
6 (xg_separator_p): Check for all documented separator types.
7 (xg_update_scrollbar_pos): Variable gheight not needed, use height.
8 (update_frame_tool_bar): Don't call gdk_window_process_all_updates.
9
3 * xdisp.c (update_menu_bar): Set w->update_mode_line to Qt 10 * xdisp.c (update_menu_bar): Set w->update_mode_line to Qt
4 so tool bar gets updated. 11 so tool bar gets updated.
5 12
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 89af8fd6c65..22da5eea854 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -335,8 +335,6 @@ xg_resize_widgets (f, pixelwidth, pixelheight)
335 335
336 gtk_widget_size_allocate (x->edit_widget, &all); 336 gtk_widget_size_allocate (x->edit_widget, &all);
337 337
338 xg_frame_cleared (f);
339
340 change_frame_size (f, rows, columns, 0, 1, 0); 338 change_frame_size (f, rows, columns, 0, 1, 0);
341 SET_FRAME_GARBAGED (f); 339 SET_FRAME_GARBAGED (f);
342 cancel_mouse_face (f); 340 cancel_mouse_face (f);
@@ -353,7 +351,7 @@ xg_frame_set_char_size (f, cols, rows)
353{ 351{
354 int pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows) 352 int pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows)
355 + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); 353 + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
356 int pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); 354 int pixelwidth;
357 355
358 /* Take into account the size of the scroll bar. Always use the 356 /* Take into account the size of the scroll bar. Always use the
359 number of columns occupied by the scroll bar here otherwise we 357 number of columns occupied by the scroll bar here otherwise we
@@ -368,11 +366,18 @@ xg_frame_set_char_size (f, cols, rows)
368 366
369 compute_fringe_widths (f, 0); 367 compute_fringe_widths (f, 0);
370 368
369 /* CHAR_TO_PIXEL_WIDTH uses vertical_scroll_bar_extra, so call it
370 after calculating that value. */
371 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);
372
371 /* Must resize our top level widget. Font size may have changed, 373 /* Must resize our top level widget. Font size may have changed,
372 but not rows/cols. */ 374 but not rows/cols. */
373 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), 375 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
374 pixelwidth, pixelheight); 376 pixelwidth, pixelheight);
375 xg_resize_widgets (f, pixelwidth, pixelheight); 377 xg_resize_widgets (f, pixelwidth, pixelheight);
378
379 SET_FRAME_GARBAGED (f);
380 cancel_mouse_face (f);
376} 381}
377 382
378/* Convert an X Window WSESC to its corresponding GtkWidget. 383/* Convert an X Window WSESC to its corresponding GtkWidget.
@@ -428,7 +433,7 @@ xg_fixed_handle_expose(GtkWidget *widget,
428 gpointer user_data) 433 gpointer user_data)
429{ 434{
430 GList *iter; 435 GList *iter;
431 436
432 for (iter = GTK_FIXED (widget)->children; iter; iter = g_list_next (iter)) 437 for (iter = GTK_FIXED (widget)->children; iter; iter = g_list_next (iter))
433 { 438 {
434 GtkFixedChild *child_data = (GtkFixedChild *) iter->data; 439 GtkFixedChild *child_data = (GtkFixedChild *) iter->data;
@@ -1276,16 +1281,51 @@ make_menu_item (utf8_label, utf8_key, item, group)
1276 return w; 1281 return w;
1277} 1282}
1278 1283
1279/* Return non-zero if NAME specifies a separator (GTK only has one 1284/* Return non-zero if LABEL specifies a separator (GTK only has one
1280 separator type) */ 1285 separator type) */
1281static int 1286static int
1282xg_separator_p (char *name) 1287xg_separator_p (char *label)
1283{ 1288{
1284 if (! name) return 0; 1289 if (! label) return 0;
1290 else if (strlen (label) > 3
1291 && strncmp (label, "--", 2) == 0
1292 && label[2] != '-')
1293 {
1294 static char* separator_names[] = {
1295 "space",
1296 "no-line",
1297 "single-line",
1298 "double-line",
1299 "single-dashed-line",
1300 "double-dashed-line",
1301 "shadow-etched-in",
1302 "shadow-etched-out",
1303 "shadow-etched-in-dash",
1304 "shadow-etched-out-dash",
1305 "shadow-double-etched-in",
1306 "shadow-double-etched-out",
1307 "shadow-double-etched-in-dash",
1308 "shadow-double-etched-out-dash",
1309 0,
1310 };
1311
1312 int i;
1313
1314 label += 2;
1315 for (i = 0; separator_names[i]; ++i)
1316 if (strcmp (label, separator_names[i]) == 0)
1317 return 1;
1318 }
1319 else
1320 {
1321 /* Old-style separator, maybe. It's a separator if it contains
1322 only dashes. */
1323 while (*label == '-')
1324 ++label;
1325 if (*label == 0) return 1;
1326 }
1285 1327
1286 return strcmp (name, "--") == 0 1328 return 0;
1287 || strncmp (name, "--:", 3) == 0
1288 || strcmp (name, "---") == 0;
1289} 1329}
1290 1330
1291GtkWidget *xg_did_tearoff; 1331GtkWidget *xg_did_tearoff;
@@ -2571,9 +2611,8 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height,
2571 if (wscroll) 2611 if (wscroll)
2572 { 2612 {
2573 GtkWidget *wfixed = f->output_data.x->edit_widget; 2613 GtkWidget *wfixed = f->output_data.x->edit_widget;
2574 int gheight = max (height, 1);
2575 int winextra = canon_width > width ? (canon_width - width) / 2 : 0; 2614 int winextra = canon_width > width ? (canon_width - width) / 2 : 0;
2576 int bottom = top + gheight; 2615 int bottom = top + height;
2577 2616
2578 gint slider_width; 2617 gint slider_width;
2579 int oldtop, oldleft, oldbottom; 2618 int oldtop, oldleft, oldbottom;
@@ -2630,8 +2669,8 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height,
2630 2669
2631 if (oldleft != left) 2670 if (oldleft != left)
2632 { 2671 {
2633 gdk_window_clear_area (wfixed->window, xl, top, wbl, gheight); 2672 gdk_window_clear_area (wfixed->window, xl, top, wbl, height);
2634 gdk_window_clear_area (wfixed->window, xr, top, wbr, gheight); 2673 gdk_window_clear_area (wfixed->window, xr, top, wbr, height);
2635 } 2674 }
2636 2675
2637 if (oldtop > top) 2676 if (oldtop > top)
@@ -2663,8 +2702,8 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height,
2663 2702
2664 /* Move and resize to new values. */ 2703 /* Move and resize to new values. */
2665 gtk_fixed_move (GTK_FIXED (wfixed), wscroll, left, top); 2704 gtk_fixed_move (GTK_FIXED (wfixed), wscroll, left, top);
2666 gtk_widget_set_size_request (wscroll, width, gheight); 2705 gtk_widget_set_size_request (wscroll, width, height);
2667 2706
2668 /* Must force out update so changed scroll bars gets redrawn. */ 2707 /* Must force out update so changed scroll bars gets redrawn. */
2669 gdk_window_process_all_updates (); 2708 gdk_window_process_all_updates ();
2670 2709
@@ -3157,9 +3196,6 @@ update_frame_tool_bar (f)
3157 xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 3196 xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
3158 } 3197 }
3159 3198
3160 /* Must force out update so changed images gets redrawn. */
3161 gdk_window_process_all_updates ();
3162
3163 if (icon_list) g_list_free (icon_list); 3199 if (icon_list) g_list_free (icon_list);
3164 3200
3165 UNBLOCK_INPUT; 3201 UNBLOCK_INPUT;