[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/src ChangeLog gtkutil.c xterm.c
From: |
Jan Djärv |
Subject: |
[Emacs-diffs] emacs/src ChangeLog gtkutil.c xterm.c |
Date: |
Thu, 02 Jul 2009 12:27:26 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Jan Djärv <jhd> 09/07/02 12:27:26
Modified files:
src : ChangeLog gtkutil.c xterm.c
Log message:
* gtkutil.c (xg_frame_set_char_size): Do set width/height if the
frame isn't visible.
(xg_frame_resized): If width/height is -1, get size of window
from X server.
* xterm.c (handle_one_xevent): Call xg_frame_resized for USE_GTK
for MapNotify.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7624&r2=1.7625
http://cvs.savannah.gnu.org/viewcvs/emacs/src/gtkutil.c?cvsroot=emacs&r1=1.156&r2=1.157
http://cvs.savannah.gnu.org/viewcvs/emacs/src/xterm.c?cvsroot=emacs&r1=1.1034&r2=1.1035
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7624
retrieving revision 1.7625
diff -u -b -r1.7624 -r1.7625
--- ChangeLog 2 Jul 2009 08:20:56 -0000 1.7624
+++ ChangeLog 2 Jul 2009 12:27:23 -0000 1.7625
@@ -1,5 +1,13 @@
2009-07-02 Jan Djärv <address@hidden>
+ * gtkutil.c (xg_frame_set_char_size): Do set width/height if the
+ frame isn't visible.
+ (xg_frame_resized): If width/height is -1, get size of window
+ from X server.
+
+ * xterm.c (handle_one_xevent): Call xg_frame_resized for USE_GTK
+ for MapNotify.
+
* gtkutil.c (xg_frame_set_char_size): Do not set pixel width/height
here or call change_frame_size. Just call flush_and_sync.
(flush_and_sync): Reintroduced.
Index: gtkutil.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/gtkutil.c,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -b -r1.156 -r1.157
--- gtkutil.c 2 Jul 2009 10:29:54 -0000 1.156
+++ gtkutil.c 2 Jul 2009 12:27:25 -0000 1.157
@@ -636,14 +636,24 @@
FRAME_PTR f;
int pixelwidth, pixelheight;
{
- int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight);
- int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
+ int rows, columns;
- if (FRAME_GTK_WIDGET (f)
- && (columns != FRAME_COLS (f)
+ if (pixelwidth == -1 && pixelheight == -1)
+ {
+ if (FRAME_GTK_WIDGET (f) && GTK_WIDGET_MAPPED (FRAME_GTK_WIDGET (f)))
+ gdk_window_get_geometry(FRAME_GTK_WIDGET (f)->window, 0, 0,
+ &pixelwidth, &pixelheight, 0);
+ else return;
+ }
+
+
+ rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight);
+ columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
+
+ if (columns != FRAME_COLS (f)
|| rows != FRAME_LINES (f)
|| pixelwidth != FRAME_PIXEL_WIDTH (f)
- || pixelheight != FRAME_PIXEL_HEIGHT (f)))
+ || pixelheight != FRAME_PIXEL_HEIGHT (f))
{
FRAME_PIXEL_WIDTH (f) = pixelwidth;
FRAME_PIXEL_HEIGHT (f) = pixelheight;
@@ -704,14 +714,23 @@
pixelwidth, pixelheight);
x_wm_set_size_hint (f, 0, 0);
- SET_FRAME_GARBAGED (f);
-
- /* We can not call change_frame_size here, we can not set pixel
- width/height either. The window manager may override our resize
- request, XMonad does this all the time. The best we can do
- is try to sync, so lisp code sees the updated size as fast as
- possible. */
+ /* We can not call change_frame_size for a mapped frame,
+ we can not set pixel width/height either. The window manager may
+ override our resize request, XMonad does this all the time.
+ The best we can do is try to sync, so lisp code sees the updated
+ size as fast as possible.
+ For unmapped windows, we can set rows/cols. When
+ the frame is mapped again we will (hopefully) get the correct size. */
+ if (f->async_visible)
flush_and_sync (f);
+ else
+ {
+ FRAME_PIXEL_WIDTH (f) = pixelwidth;
+ FRAME_PIXEL_HEIGHT (f) = pixelheight;
+ change_frame_size (f, rows, cols, 0, 1, 0);
+ SET_FRAME_GARBAGED (f);
+ cancel_mouse_face (f);
+ }
}
/* Handle height changes (i.e. add/remove menu/toolbar).
Index: xterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xterm.c,v
retrieving revision 1.1034
retrieving revision 1.1035
diff -u -b -r1.1034 -r1.1035
--- xterm.c 1 Jul 2009 16:58:07 -0000 1.1034
+++ xterm.c 2 Jul 2009 12:27:25 -0000 1.1035
@@ -6206,6 +6206,9 @@
/* Check if fullscreen was specified before we where mapped. */
x_check_fullscreen (f);
+#ifdef USE_GTK
+ xg_frame_resized (f, -1, -1);
+#endif
}
goto OTHER;
- [Emacs-diffs] emacs/src ChangeLog gtkutil.c xterm.c,
Jan Djärv <=