emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -fs hides part of Emacs window behind task bar on w32


From: Juanma Barranquero
Subject: Re: -fs hides part of Emacs window behind task bar on w32
Date: Wed, 13 Dec 2006 13:35:56 +0100

On 12/12/06, Juanma Barranquero <address@hidden> wrote:

Any objection then to this patch? It fixes the bug that, on Windows,
"emacs -Q -fs" creates an initial frame partially hidden behind the
taskbar.

The patch does not take into account multiple monitors, because
neither does the original code: it sets *top_pos = 0 and *left_pos =
0, and Windows virtual coordinate (0, 0) is always contained in the
primary monitor.

             /L/e/k/t/u


Index: src/frame.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/frame.c,v
retrieving revision 1.335
diff -u -2 -r1.335 frame.c
--- src/frame.c 10 Nov 2006 07:54:22 -0000      1.335
+++ src/frame.c 12 Dec 2006 17:32:17 -0000
@@ -2614,4 +2614,9 @@
  int newwidth = FRAME_COLS (f);
  int newheight = FRAME_LINES (f);
+#ifdef HAVE_NTGUI
+  RECT work_area;
+
+  SystemParametersInfo (SPI_GETWORKAREA, 0, &work_area, 0);
+#endif

  *top_pos = f->top_pos;
@@ -2623,4 +2628,7 @@

      ph = FRAME_X_DISPLAY_INFO (f)->height;
+#ifdef HAVE_NTGUI
+      ph = min (ph, work_area.bottom - work_area.top);
+#endif
      newheight = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, ph);
      ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, newheight) - f->y_pixels_diff;
@@ -2634,4 +2642,7 @@

      pw = FRAME_X_DISPLAY_INFO (f)->width;
+#ifdef HAVE_NTGUI
+      pw = min (pw, work_area.right - work_area.left);
+#endif
      newwidth = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pw);
      pw = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, newwidth) - f->x_pixels_diff;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]