reset drag state after shaking loose or reattaching. Fix for #132625.

2004-02-16  Rob Adams  <readams@readams.net>

	* src/window.c (update_move): reset drag state after shaking loose
	or reattaching.  Fix for #132625.
This commit is contained in:
Rob Adams 2004-02-16 19:01:25 +00:00 committed by Rob Adams
parent 88ea02a77a
commit ad65847d7d
2 changed files with 28 additions and 19 deletions

View File

@ -1,3 +1,8 @@
2004-02-16 Rob Adams <readams@readams.net>
* src/window.c (update_move): reset drag state after shaking loose
or reattaching. Fix for #132625.
2004-02-15 Anders Carlsson <andersca@gnome.org>
* src/menu.c (meta_window_menu_new): Actually translate a message,

View File

@ -5888,20 +5888,22 @@ update_move (MetaWindow *window,
/* move the unmaximized window to the cursor */
prop =
((double)(x - window->display->grab_initial_window_pos.x)) /
((double)window->display->grab_initial_window_pos.width);
((double)(x - window->display->grab_initial_window_pos.x)) /
((double)window->display->grab_initial_window_pos.width);
window->display->grab_initial_window_pos.x =
x - window->saved_rect.width * prop;
x - window->saved_rect.width * prop;
window->display->grab_initial_window_pos.y = y;
if (window->frame)
{
window->display->grab_initial_window_pos.y += window->frame->child_y / 2;
}
{
window->display->grab_initial_window_pos.y += window->frame->child_y / 2;
}
window->saved_rect.x = window->display->grab_initial_window_pos.x-dx;
window->saved_rect.y = window->display->grab_initial_window_pos.y-dy;
window->saved_rect.x = window->display->grab_initial_window_pos.x;
window->saved_rect.y = window->display->grab_initial_window_pos.y;
window->display->grab_anchor_root_x = x;
window->display->grab_anchor_root_y = y;
meta_window_unmaximize (window);
@ -5920,13 +5922,13 @@ update_move (MetaWindow *window,
for (monitor = 0; monitor < window->screen->n_xinerama_infos; monitor++)
{
meta_window_get_work_area_for_xinerama (window, monitor, &work_area);
meta_window_get_work_area_for_xinerama (window, monitor, &work_area);
/* check if cursor is near the top of a xinerama work area */
if (x >= work_area.x &&
x < (work_area.x + work_area.width) &&
y >= work_area.y &&
y < (work_area.y + shake_threshold))
y >= work_area.y &&
y < (work_area.y + shake_threshold))
{
/* move the saved rect if window will become maximized on an
* other monitor so user isn't surprised on a later unmaximize
@ -5934,7 +5936,7 @@ update_move (MetaWindow *window,
if (wxinerama->number != monitor)
{
window->saved_rect.x = work_area.x;
window->saved_rect.y = work_area.y;
window->saved_rect.y = work_area.y;
if (window->frame)
{
@ -5945,12 +5947,14 @@ update_move (MetaWindow *window,
meta_window_unmaximize (window);
}
window->display->grab_initial_window_pos = work_area;
window->shaken_loose = FALSE;
window->display->grab_initial_window_pos = work_area;
window->display->grab_anchor_root_x = x;
window->display->grab_anchor_root_y = y;
window->shaken_loose = FALSE;
meta_window_maximize (window);
meta_window_maximize (window);
return;
return;
}
}
}