Fix positioning error for manually positioned windows

The "original coordinates" passed into meta_window_place() were the
coordinates of the client rectangle not the frame rectangle. When
meta_window_place() didn't place because the window was manually
positioned (e.g., 'xterm -geometry +x+y') that resulted in a window
being offset by the frame dimensions.

https://bugzilla.gnome.org/show_bug.cgi?id=724049
This commit is contained in:
Owen W. Taylor 2014-03-05 17:04:50 -05:00
parent 4a8f7aa884
commit 4c2e39bf2c

View File

@ -491,12 +491,17 @@ place_window_if_needed(MetaWindow *window,
!window->minimized && !window->minimized &&
!window->fullscreen) !window->fullscreen)
{ {
MetaRectangle orig_rect;
MetaRectangle placed_rect; MetaRectangle placed_rect;
MetaWorkspace *cur_workspace; MetaWorkspace *cur_workspace;
const MetaMonitorInfo *monitor_info; const MetaMonitorInfo *monitor_info;
meta_window_get_frame_rect (window, &placed_rect); meta_window_get_frame_rect (window, &placed_rect);
meta_window_place (window, info->orig.x, info->orig.y,
orig_rect = info->orig;
extend_by_frame (window, &orig_rect);
meta_window_place (window, orig_rect.x, orig_rect.y,
&placed_rect.x, &placed_rect.y); &placed_rect.x, &placed_rect.y);
did_placement = TRUE; did_placement = TRUE;