# HG changeset patch # User Eli Zaretskii # Date 1151674875 0 # Node ID d1eb48dbd3e602d216816f76ac2b0ebccc46c50c # Parent 26164031aa5af2cd053304cd64a898a171f00edd (x_make_frame_visible): Use SystemParametersInfo with SPI_GETWORKAREA to find the dimensions of the screen work area, and adjust vertical position of the frame in order to avoid being covered by the task bar. diff -r 26164031aa5a -r d1eb48dbd3e6 src/w32term.c --- a/src/w32term.c Fri Jun 30 13:40:21 2006 +0000 +++ b/src/w32term.c Fri Jun 30 13:41:15 2006 +0000 @@ -5665,7 +5665,22 @@ 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;