X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Ftoolbar.c;h=95a455f85e74b111f638196a832b36d9c0408486;hb=e596da479a79b91a77586321b860a930158b0d27;hp=9d20a82056d0ad43d3ea491bc16e5184eace7be3;hpb=98a6e4055a1fa624c592ac06f79287d55196ca37;p=chise%2Fxemacs-chise.git.1 diff --git a/src/toolbar.c b/src/toolbar.c index 9d20a82..95a455f 100644 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -712,13 +712,26 @@ compute_frame_toolbars_data (struct frame *f) set_frame_toolbar (f, RIGHT_TOOLBAR); } +/* Update the toolbar geometry separately from actually displaying the + toolbar. This is necessary because both the gutter and the toolbar + are competing for redisplay cycles and, unfortunately, gutter + updates happen late in the game. Firstly they are done inside of + redisplay proper and secondly subcontrols may not get moved until + the next screen refresh. Only after subcontrols have been moved to + their final destinations can we be certain of updating the + toolbar. Under X this probably is exacerbated by the toolbar button + dirty flags which prevent updates happening when they possibly + should. */ void -update_frame_toolbars (struct frame *f) +update_frame_toolbars_geometry (struct frame *f) { struct device *d = XDEVICE (f->device); if (DEVICE_SUPPORTS_TOOLBARS_P (d) - && (f->toolbar_changed || f->frame_changed || f->clear)) + && (f->toolbar_changed + || f->frame_layout_changed + || f->frame_changed + || f->clear)) { int pos; @@ -738,18 +751,39 @@ update_frame_toolbars (struct frame *f) pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), &width, &height); change_frame_size (f, height, width, 0); + MARK_FRAME_LAYOUT_CHANGED (f); break; } - for (pos = 0; pos < 4; pos++) + for (pos = 0; pos < 4; pos++) { f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); + } /* Removed the check for the minibuffer here. We handle this more correctly now by consistently using FRAME_LAST_NONMINIBUF_WINDOW instead of FRAME_SELECTED_WINDOW throughout the toolbar code. */ compute_frame_toolbars_data (f); + + /* Clear the previous toolbar locations. If we do it later + (after redisplay) we end up clearing what we have just + displayed. */ + MAYBE_DEVMETH (d, clear_frame_toolbars, (f)); + } +} +/* Actually redisplay the toolbar buttons. */ +void +update_frame_toolbars (struct frame *f) +{ + struct device *d = XDEVICE (f->device); + + if (DEVICE_SUPPORTS_TOOLBARS_P (d) + && (f->toolbar_changed + || f->frame_layout_changed + || f->frame_changed + || f->clear)) + { DEVMETH (d, output_frame_toolbars, (f)); } @@ -874,7 +908,7 @@ get_toolbar_coords (struct frame *f, enum toolbar_pos pos, int *x, int *y, *vert = 1; break; default: - abort (); + ABORT (); } } @@ -1610,6 +1644,9 @@ See `default-toolbar-height' for more information. #ifdef HAVE_TTY fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); #endif +#ifdef HAVE_GTK + fb = Fcons (Fcons (list1 (Qgtk), make_int (DEFAULT_TOOLBAR_HEIGHT)), fb); +#endif #ifdef HAVE_X_WINDOWS fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_HEIGHT)), fb); #endif @@ -1624,6 +1661,9 @@ See `default-toolbar-height' for more information. #ifdef HAVE_TTY fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); #endif +#ifdef HAVE_GTK + fb = Fcons (Fcons (list1 (Qgtk), make_int (DEFAULT_TOOLBAR_WIDTH)), fb); +#endif #ifdef HAVE_X_WINDOWS fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_WIDTH)), fb); #endif @@ -1740,6 +1780,9 @@ See `default-toolbar-height' for more information. #ifdef HAVE_X_WINDOWS fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_BORDER_WIDTH)), fb); #endif +#ifdef HAVE_GTK + fb = Fcons (Fcons (list1 (Qgtk), make_int (DEFAULT_TOOLBAR_BORDER_WIDTH)), fb); +#endif #ifdef HAVE_MS_WINDOWS fb = Fcons (Fcons (list1 (Qmswindows), make_int (MSWINDOWS_DEFAULT_TOOLBAR_BORDER_WIDTH)), fb); #endif