diff options
| author | Jan Djärv | 2010-01-05 15:16:30 +0100 |
|---|---|---|
| committer | Jan Djärv | 2010-01-05 15:16:30 +0100 |
| commit | 7c583cd8559846fc9537778e9c141cd85358302f (patch) | |
| tree | 593af9f94fd171fbe48d61d8da39933fb7bfbef4 /src/xterm.c | |
| parent | 798c9eb5600072c2558de7620ad69b06aee46de7 (diff) | |
| download | emacs-7c583cd8559846fc9537778e9c141cd85358302f.tar.gz emacs-7c583cd8559846fc9537778e9c141cd85358302f.zip | |
Handle change of internal-border width when maximized.
* xterm.c (x_new_font): Move code for setting rows/cols before
resizing ...
(x_set_window_size): ... to here. bug #2568.
* gtkutil.c (xg_clear_under_internal_border): New function.
(xg_frame_resized, xg_frame_set_char_size): Call
xg_clear_under_internal_border.
(xg_update_scrollbar_pos): Clear under old scroll bar position.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/src/xterm.c b/src/xterm.c index 7f9f6f3c05e..65f58e49196 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -8064,32 +8064,7 @@ x_new_font (f, font_object, fontset) | |||
| 8064 | doing it because it's done in Fx_show_tip, and it leads to | 8064 | doing it because it's done in Fx_show_tip, and it leads to |
| 8065 | problems because the tip frame has no widget. */ | 8065 | problems because the tip frame has no widget. */ |
| 8066 | if (NILP (tip_frame) || XFRAME (tip_frame) != f) | 8066 | if (NILP (tip_frame) || XFRAME (tip_frame) != f) |
| 8067 | { | 8067 | x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f)); |
| 8068 | int rows, cols; | ||
| 8069 | |||
| 8070 | /* When the frame is maximized/fullscreen or running under for | ||
| 8071 | example Xmonad, x_set_window_size will be a no-op. | ||
| 8072 | In that case, the right thing to do is extend rows/cols to | ||
| 8073 | the current frame size. We do that first if x_set_window_size | ||
| 8074 | turns out to not be a no-op (there is no way to know). | ||
| 8075 | The size will be adjusted again if the frame gets a | ||
| 8076 | ConfigureNotify event as a result of x_set_window_size. */ | ||
| 8077 | int pixelh = FRAME_PIXEL_HEIGHT (f); | ||
| 8078 | #ifdef USE_X_TOOLKIT | ||
| 8079 | /* The menu bar is not part of text lines. The tool bar | ||
| 8080 | is however. */ | ||
| 8081 | pixelh -= FRAME_MENUBAR_HEIGHT (f); | ||
| 8082 | #endif | ||
| 8083 | rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelh); | ||
| 8084 | /* Update f->scroll_bar_actual_width because it is used in | ||
| 8085 | FRAME_PIXEL_WIDTH_TO_TEXT_COLS. */ | ||
| 8086 | f->scroll_bar_actual_width | ||
| 8087 | = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f); | ||
| 8088 | cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f)); | ||
| 8089 | |||
| 8090 | change_frame_size (f, rows, cols, 0, 1, 0); | ||
| 8091 | x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f)); | ||
| 8092 | } | ||
| 8093 | } | 8068 | } |
| 8094 | 8069 | ||
| 8095 | #ifdef HAVE_X_I18N | 8070 | #ifdef HAVE_X_I18N |
| @@ -8977,6 +8952,33 @@ x_set_window_size (f, change_gravity, cols, rows) | |||
| 8977 | { | 8952 | { |
| 8978 | BLOCK_INPUT; | 8953 | BLOCK_INPUT; |
| 8979 | 8954 | ||
| 8955 | if (NILP (tip_frame) || XFRAME (tip_frame) != f) | ||
| 8956 | { | ||
| 8957 | int r, c; | ||
| 8958 | |||
| 8959 | /* When the frame is maximized/fullscreen or running under for | ||
| 8960 | example Xmonad, x_set_window_size_1 will be a no-op. | ||
| 8961 | In that case, the right thing to do is extend rows/cols to | ||
| 8962 | the current frame size. We do that first if x_set_window_size_1 | ||
| 8963 | turns out to not be a no-op (there is no way to know). | ||
| 8964 | The size will be adjusted again if the frame gets a | ||
| 8965 | ConfigureNotify event as a result of x_set_window_size. */ | ||
| 8966 | int pixelh = FRAME_PIXEL_HEIGHT (f); | ||
| 8967 | #ifdef USE_X_TOOLKIT | ||
| 8968 | /* The menu bar is not part of text lines. The tool bar | ||
| 8969 | is however. */ | ||
| 8970 | pixelh -= FRAME_MENUBAR_HEIGHT (f); | ||
| 8971 | #endif | ||
| 8972 | r = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelh); | ||
| 8973 | /* Update f->scroll_bar_actual_width because it is used in | ||
| 8974 | FRAME_PIXEL_WIDTH_TO_TEXT_COLS. */ | ||
| 8975 | f->scroll_bar_actual_width | ||
| 8976 | = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f); | ||
| 8977 | c = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f)); | ||
| 8978 | fprintf (stderr, "1: old %d/%d, new %d/%d\n", rows, cols, r, c); | ||
| 8979 | change_frame_size (f, r, c, 0, 1, 0); | ||
| 8980 | } | ||
| 8981 | |||
| 8980 | #ifdef USE_GTK | 8982 | #ifdef USE_GTK |
| 8981 | if (FRAME_GTK_WIDGET (f)) | 8983 | if (FRAME_GTK_WIDGET (f)) |
| 8982 | xg_frame_set_char_size (f, cols, rows); | 8984 | xg_frame_set_char_size (f, cols, rows); |