]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_make_frame_visible): Use SystemParametersInfo with SPI_GETWORKAREA to find
authorEli Zaretskii <eliz@gnu.org>
Fri, 30 Jun 2006 13:41:15 +0000 (13:41 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 30 Jun 2006 13:41:15 +0000 (13:41 +0000)
the dimensions of the screen work area, and adjust vertical position of the
frame in order to avoid being covered by the task bar.

src/w32term.c

index f691b4cb9a80cf1632190aac907d6823f65358d6..29fe961946d1b5e9c6aeba01827fc085b9cf07cd 100644 (file)
@@ -5665,7 +5665,22 @@ x_make_frame_visible (f)
         before the window gets really visible.  */
       if (! FRAME_ICONIFIED_P (f)
          && ! f->output_data.w32->asked_for_visible)
-       x_set_offset (f, f->left_pos, f->top_pos, 0);
+       {
+         RECT workarea_rect;
+         RECT window_rect;
+
+         /* Adjust vertical window position in order to avoid being
+            covered by a task bar placed at the bottom of the desktop. */
+         SystemParametersInfo(SPI_GETWORKAREA, 0, &workarea_rect, 0);
+         GetWindowRect(FRAME_W32_WINDOW(f), &window_rect);
+         if (window_rect.bottom > workarea_rect.bottom
+             && window_rect.top > workarea_rect.top)
+           f->top_pos = max (window_rect.top
+                             - window_rect.bottom + workarea_rect.bottom,
+                             workarea_rect.top);
+
+         x_set_offset (f, f->left_pos, f->top_pos, 0);
+       }
 
       f->output_data.w32->asked_for_visible = 1;