2006-10-01 18:30:10 -04:00
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
/* Mutter X managed windows */
2001-05-30 11:36:31 -04:00
2008-12-18 07:41:56 -05:00
/*
2001-08-05 12:04:52 -04:00
* Copyright ( C ) 2001 Havoc Pennington , Anders Carlsson
2003-02-23 12:09:46 -05:00
* Copyright ( C ) 2002 , 2003 Red Hat , Inc .
* Copyright ( C ) 2003 Rob Adams
2006-01-10 14:43:21 -05:00
* Copyright ( C ) 2004 - 2006 Elijah Newren
2008-12-18 07:41:56 -05:00
*
2001-05-30 11:36:31 -04:00
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation ; either version 2 of the
* License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful , but
* WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
* General Public License for more details .
2008-12-18 07:41:56 -05:00
*
2001-05-30 11:36:31 -04:00
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA
* 02111 - 1307 , USA .
*/
2001-12-09 17:41:12 -05:00
# include <config.h>
2008-05-18 20:00:09 -04:00
# include "window-private.h"
2010-10-18 14:34:14 -04:00
# include "boxes-private.h"
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
# include "edge-resistance.h"
2011-03-05 19:29:12 -05:00
# include <meta/util.h>
# include "frame.h"
# include <meta/errors.h>
2008-09-18 11:09:11 -04:00
# include "workspace-private.h"
2001-06-10 14:46:46 -04:00
# include "stack.h"
2009-01-29 09:16:01 -05:00
# include "keybindings-private.h"
2001-06-23 01:49:35 -04:00
# include "ui.h"
2001-06-24 02:47:54 -04:00
# include "place.h"
2001-07-27 00:36:44 -04:00
# include "session.h"
2011-03-05 19:29:12 -05:00
# include <meta/prefs.h>
2002-03-17 12:22:23 -05:00
# include "resizepopup.h"
2002-01-03 19:58:39 -05:00
# include "xprops.h"
2011-03-05 19:29:12 -05:00
# include <meta/group.h>
2002-11-03 18:42:21 -05:00
# include "window-props.h"
2003-03-08 18:43:17 -05:00
# include "constraints.h"
2009-08-04 03:06:30 -04:00
# include "mutter-enum-types.h"
2001-06-06 00:47:37 -04:00
2001-06-02 00:14:18 -04:00
# include <X11/Xatom.h>
2009-10-19 19:41:54 -04:00
# include <X11/Xlibint.h> /* For display->resource_mask */
2002-10-26 12:40:50 -04:00
# include <string.h>
2012-03-12 12:09:17 -04:00
# include <math.h>
2001-06-02 00:14:18 -04:00
2003-01-05 02:51:02 -05:00
# ifdef HAVE_SHAPE
# include <X11/extensions/shape.h>
# endif
2008-11-23 14:28:40 -05:00
# include <X11/extensions/Xcomposite.h>
2012-03-12 12:09:17 -04:00
/* Windows that unmaximize to a size bigger than that fraction of the workarea
2012-03-15 15:42:11 -04:00
* will be scaled down to that size ( while maintaining aspect ratio ) .
* Windows that cover an area greater then this size are automaximized on map .
*/
2012-03-12 12:09:17 -04:00
# define MAX_UNMAXIMIZED_WINDOW_AREA .8
2002-01-18 22:50:03 -05:00
static int destroying_windows_disallowed = 0 ;
2001-06-09 17:58:30 -04:00
static void update_sm_hints ( MetaWindow * window ) ;
2004-01-10 12:16:07 -05:00
static void update_net_frame_extents ( MetaWindow * window ) ;
2001-06-09 23:17:15 -04:00
static void recalc_window_type ( MetaWindow * window ) ;
2001-06-23 14:30:27 -04:00
static void recalc_window_features ( MetaWindow * window ) ;
2003-02-27 20:24:44 -05:00
static void invalidate_work_areas ( MetaWindow * window ) ;
deleted and moved into window-props.c (meta_window_new_with_attrs): added
2006-03-25 Thomas Thurman <thomas@thurman.org.uk>
* src/window.c, src/window.h (update_net_wm_state,
update_mwm_hints, update_wm_class, update_transient_for):
deleted and moved into window-props.c
(meta_window_new_with_attrs): added constructing field
and four new initial properties (as above)
(meta_window_recalc_features,
meta_window_recalc_window_type): new functions
* src/window-props.c (init_net_wm_state, reload_net_wm_state
init_mwm_hints, reload_mwm_hints, init_wm_class,
reload_mwm_class, init_transient_for, reload_transient_for):
new functions, moved in from window.c
(meta_display_init_window_prop_hooks): initialise new properties
2006-03-25 17:57:22 -05:00
static void recalc_window_type ( MetaWindow * window ) ;
2011-03-08 17:15:56 -05:00
static void set_wm_state_on_xwindow ( MetaDisplay * display ,
Window xwindow ,
int state ) ;
2002-10-21 17:44:35 -04:00
static void set_wm_state ( MetaWindow * window ,
2001-06-06 00:47:37 -04:00
int state ) ;
2002-10-21 17:44:35 -04:00
static void set_net_wm_state ( MetaWindow * window ) ;
2011-07-02 07:08:17 -04:00
static void meta_window_set_above ( MetaWindow * window ,
gboolean new_value ) ;
2004-01-10 12:16:07 -05:00
2001-06-06 00:47:37 -04:00
static void send_configure_notify ( MetaWindow * window ) ;
static gboolean process_property_notify ( MetaWindow * window ,
XPropertyEvent * event ) ;
2011-02-02 19:14:27 -05:00
static void meta_window_force_placement ( MetaWindow * window ) ;
2001-06-06 00:47:37 -04:00
static void meta_window_show ( MetaWindow * window ) ;
static void meta_window_hide ( MetaWindow * window ) ;
2009-10-19 19:41:54 -04:00
static gboolean meta_window_same_client ( MetaWindow * window ,
MetaWindow * other_window ) ;
2002-09-24 17:33:34 -04:00
static void meta_window_save_rect ( MetaWindow * window ) ;
2008-08-15 23:09:40 -04:00
static void save_user_window_placement ( MetaWindow * window ) ;
static void force_save_user_window_placement ( MetaWindow * window ) ;
2002-09-24 17:33:34 -04:00
2001-08-28 23:37:03 -04:00
static void meta_window_move_resize_internal ( MetaWindow * window ,
MetaMoveResizeFlags flags ,
int resize_gravity ,
int root_x_nw ,
int root_y_nw ,
int w ,
int h ) ;
2001-07-28 02:35:19 -04:00
2004-08-05 13:48:39 -04:00
static void ensure_mru_position_after ( MetaWindow * window ,
MetaWindow * after_this_one ) ;
2001-06-02 00:14:18 -04:00
2006-01-20 17:03:56 -05:00
static void meta_window_move_resize_now ( MetaWindow * window ) ;
2001-06-23 14:30:27 -04:00
2007-06-16 22:15:07 -04:00
static void meta_window_unqueue ( MetaWindow * window , guint queuebits ) ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
static void update_move ( MetaWindow * window ,
gboolean snap ,
int x ,
int y ) ;
static gboolean update_move_timeout ( gpointer data ) ;
static void update_resize ( MetaWindow * window ,
gboolean snap ,
int x ,
int y ,
gboolean force ) ;
static gboolean update_resize_timeout ( gpointer data ) ;
2011-02-28 05:41:23 -05:00
static gboolean should_be_on_all_workspaces ( MetaWindow * window ) ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
2006-01-20 17:03:56 -05:00
static void meta_window_flush_calc_showing ( MetaWindow * window ) ;
2001-06-21 23:20:21 -04:00
2005-05-26 13:15:56 -04:00
static gboolean queue_calc_showing_func ( MetaWindow * window ,
void * data ) ;
2001-07-27 00:36:44 -04:00
static void meta_window_apply_session_info ( MetaWindow * window ,
const MetaWindowSessionInfo * info ) ;
2011-05-20 04:56:12 -04:00
static void meta_window_move_between_rects ( MetaWindow * window ,
const MetaRectangle * old_area ,
const MetaRectangle * new_area ) ;
2001-07-27 00:36:44 -04:00
2006-04-16 23:54:49 -04:00
static void unmaximize_window_before_freeing ( MetaWindow * window ) ;
static void unminimize_window_and_all_transient_parents ( MetaWindow * window ) ;
2009-09-25 15:47:22 -04:00
/* Idle handlers for the three queues (run with meta_later_add()). The
* " data " parameter in each case will be a GINT_TO_POINTER of the
* index into the queue arrays to use .
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
*
* TODO : Possibly there is still some code duplication among these , which we
* need to sort out at some point .
*/
static gboolean idle_calc_showing ( gpointer data ) ;
static gboolean idle_move_resize ( gpointer data ) ;
static gboolean idle_update_icon ( gpointer data ) ;
2006-01-20 18:36:23 -05:00
2008-11-07 04:57:00 -05:00
G_DEFINE_TYPE ( MetaWindow , meta_window , G_TYPE_OBJECT ) ;
2008-12-05 20:03:27 -05:00
enum {
PROP_0 ,
PROP_TITLE ,
PROP_ICON ,
2008-12-18 07:41:56 -05:00
PROP_MINI_ICON ,
2009-02-11 07:16:41 -05:00
PROP_DECORATED ,
2009-03-17 08:27:13 -04:00
PROP_FULLSCREEN ,
2010-02-12 15:26:52 -05:00
PROP_MAXIMIZED_HORIZONTALLY ,
PROP_MAXIMIZED_VERTICALLY ,
2011-05-31 13:52:04 -04:00
PROP_MINIMIZED ,
2009-08-31 12:06:53 -04:00
PROP_WINDOW_TYPE ,
2009-11-17 05:02:06 -05:00
PROP_USER_TIME ,
2009-11-20 03:51:19 -05:00
PROP_DEMANDS_ATTENTION ,
2010-01-18 05:12:17 -05:00
PROP_URGENT ,
2011-03-24 21:36:47 -04:00
PROP_MUTTER_HINTS ,
2011-03-03 04:01:04 -05:00
PROP_APPEARS_FOCUSED ,
2011-07-02 07:08:17 -04:00
PROP_RESIZEABLE ,
PROP_ABOVE ,
2011-11-25 18:42:41 -05:00
PROP_WM_CLASS ,
2012-01-17 13:27:10 -05:00
PROP_GTK_APPLICATION_ID ,
PROP_GTK_UNIQUE_BUS_NAME ,
PROP_GTK_APPLICATION_OBJECT_PATH ,
PROP_GTK_WINDOW_OBJECT_PATH ,
PROP_GTK_APP_MENU_OBJECT_PATH ,
PROP_GTK_MENUBAR_OBJECT_PATH
2008-12-05 20:03:27 -05:00
} ;
2009-01-20 07:52:06 -05:00
enum
{
WORKSPACE_CHANGED ,
2009-02-02 06:00:13 -05:00
FOCUS ,
2009-02-02 09:08:46 -05:00
RAISED ,
2009-10-13 10:34:34 -04:00
UNMANAGED ,
2009-01-20 07:52:06 -05:00
LAST_SIGNAL
} ;
static guint window_signals [ LAST_SIGNAL ] = { 0 } ;
2011-11-25 19:52:24 -05:00
static void
prefs_changed_callback ( MetaPreference pref ,
gpointer data )
{
MetaWindow * window = data ;
2012-07-13 18:22:51 -04:00
if ( pref = = META_PREF_WORKSPACES_ONLY_ON_PRIMARY )
{
meta_window_update_on_all_workspaces ( window ) ;
meta_window_queue ( window , META_QUEUE_CALC_SHOWING ) ;
}
else if ( pref = = META_PREF_ATTACH_MODAL_DIALOGS & &
window - > type = = META_WINDOW_MODAL_DIALOG )
{
window - > attached = meta_window_should_attach_to_parent ( window ) ;
recalc_window_features ( window ) ;
meta_window_queue ( window , META_QUEUE_MOVE_RESIZE ) ;
}
2011-11-25 19:52:24 -05:00
}
2008-11-07 04:57:00 -05:00
static void
meta_window_finalize ( GObject * object )
{
MetaWindow * window = META_WINDOW ( object ) ;
2008-12-18 07:41:56 -05:00
2008-11-07 04:57:00 -05:00
if ( window - > icon )
g_object_unref ( G_OBJECT ( window - > icon ) ) ;
if ( window - > mini_icon )
g_object_unref ( G_OBJECT ( window - > mini_icon ) ) ;
2011-03-22 15:36:12 -04:00
if ( window - > frame_bounds )
cairo_region_destroy ( window - > frame_bounds ) ;
2008-11-07 04:57:00 -05:00
meta_icon_cache_free ( & window - > icon_cache ) ;
2008-12-18 07:41:56 -05:00
2008-11-07 04:57:00 -05:00
g_free ( window - > sm_client_id ) ;
g_free ( window - > wm_client_machine ) ;
g_free ( window - > startup_id ) ;
g_free ( window - > role ) ;
g_free ( window - > res_class ) ;
g_free ( window - > res_name ) ;
g_free ( window - > title ) ;
g_free ( window - > icon_name ) ;
g_free ( window - > desc ) ;
2011-03-19 05:31:25 -04:00
g_free ( window - > gtk_theme_variant ) ;
2012-01-17 13:27:10 -05:00
g_free ( window - > gtk_application_id ) ;
g_free ( window - > gtk_unique_bus_name ) ;
g_free ( window - > gtk_application_object_path ) ;
g_free ( window - > gtk_window_object_path ) ;
g_free ( window - > gtk_app_menu_object_path ) ;
g_free ( window - > gtk_menubar_object_path ) ;
2008-11-07 04:57:00 -05:00
}
2008-12-05 20:03:27 -05:00
static void
meta_window_get_property ( GObject * object ,
guint prop_id ,
GValue * value ,
GParamSpec * pspec )
{
MetaWindow * win = META_WINDOW ( object ) ;
switch ( prop_id )
{
case PROP_TITLE :
g_value_set_string ( value , win - > title ) ;
break ;
case PROP_ICON :
g_value_set_object ( value , win - > icon ) ;
break ;
case PROP_MINI_ICON :
g_value_set_object ( value , win - > mini_icon ) ;
2008-12-18 07:41:56 -05:00
break ;
2009-02-11 07:16:41 -05:00
case PROP_DECORATED :
g_value_set_boolean ( value , win - > decorated ) ;
break ;
2009-03-17 08:27:13 -04:00
case PROP_FULLSCREEN :
g_value_set_boolean ( value , win - > fullscreen ) ;
break ;
2010-02-12 15:26:52 -05:00
case PROP_MAXIMIZED_HORIZONTALLY :
g_value_set_boolean ( value , win - > maximized_horizontally ) ;
break ;
case PROP_MAXIMIZED_VERTICALLY :
g_value_set_boolean ( value , win - > maximized_vertically ) ;
break ;
2011-05-31 13:52:04 -04:00
case PROP_MINIMIZED :
g_value_set_boolean ( value , win - > minimized ) ;
break ;
2009-08-04 03:06:30 -04:00
case PROP_WINDOW_TYPE :
g_value_set_enum ( value , win - > type ) ;
break ;
2009-08-31 12:06:53 -04:00
case PROP_USER_TIME :
g_value_set_uint ( value , win - > net_wm_user_time ) ;
break ;
2009-11-17 05:02:06 -05:00
case PROP_DEMANDS_ATTENTION :
g_value_set_boolean ( value , win - > wm_state_demands_attention ) ;
break ;
2009-11-20 03:51:19 -05:00
case PROP_URGENT :
g_value_set_boolean ( value , win - > wm_hints_urgent ) ;
break ;
2010-01-18 05:12:17 -05:00
case PROP_MUTTER_HINTS :
g_value_set_string ( value , win - > mutter_hints ) ;
break ;
2011-03-24 21:36:47 -04:00
case PROP_APPEARS_FOCUSED :
g_value_set_boolean ( value , meta_window_appears_focused ( win ) ) ;
break ;
2011-03-03 04:01:04 -05:00
case PROP_WM_CLASS :
g_value_set_string ( value , win - > res_class ) ;
break ;
2011-07-02 07:08:17 -04:00
case PROP_RESIZEABLE :
g_value_set_boolean ( value , win - > has_resize_func ) ;
break ;
case PROP_ABOVE :
g_value_set_boolean ( value , win - > wm_state_above ) ;
break ;
2012-01-17 13:27:10 -05:00
case PROP_GTK_APPLICATION_ID :
g_value_set_string ( value , win - > gtk_application_id ) ;
2011-11-25 18:42:41 -05:00
break ;
2012-01-17 13:27:10 -05:00
case PROP_GTK_UNIQUE_BUS_NAME :
g_value_set_string ( value , win - > gtk_unique_bus_name ) ;
2011-12-05 12:52:35 -05:00
break ;
2012-01-17 13:27:10 -05:00
case PROP_GTK_APPLICATION_OBJECT_PATH :
g_value_set_string ( value , win - > gtk_application_object_path ) ;
break ;
case PROP_GTK_WINDOW_OBJECT_PATH :
g_value_set_string ( value , win - > gtk_window_object_path ) ;
break ;
case PROP_GTK_APP_MENU_OBJECT_PATH :
g_value_set_string ( value , win - > gtk_app_menu_object_path ) ;
break ;
case PROP_GTK_MENUBAR_OBJECT_PATH :
g_value_set_string ( value , win - > gtk_menubar_object_path ) ;
2011-12-05 12:52:35 -05:00
break ;
2008-12-05 20:03:27 -05:00
default :
G_OBJECT_WARN_INVALID_PROPERTY_ID ( object , prop_id , pspec ) ;
2008-12-18 07:41:56 -05:00
break ;
2008-12-05 20:03:27 -05:00
}
}
static void
meta_window_set_property ( GObject * object ,
guint prop_id ,
const GValue * value ,
GParamSpec * pspec )
{
switch ( prop_id )
{
default :
G_OBJECT_WARN_INVALID_PROPERTY_ID ( object , prop_id , pspec ) ;
2008-12-18 07:41:56 -05:00
break ;
2008-12-05 20:03:27 -05:00
}
}
2008-11-07 04:57:00 -05:00
static void
meta_window_class_init ( MetaWindowClass * klass )
{
GObjectClass * object_class = G_OBJECT_CLASS ( klass ) ;
object_class - > finalize = meta_window_finalize ;
2008-12-18 07:41:56 -05:00
2008-12-05 20:03:27 -05:00
object_class - > get_property = meta_window_get_property ;
object_class - > set_property = meta_window_set_property ;
2008-12-18 07:41:56 -05:00
2008-12-05 20:03:27 -05:00
g_object_class_install_property ( object_class ,
PROP_TITLE ,
g_param_spec_string ( " title " ,
" Title " ,
" The title of the window " ,
NULL ,
2008-12-18 07:41:56 -05:00
G_PARAM_READABLE ) ) ;
2008-12-05 20:03:27 -05:00
g_object_class_install_property ( object_class ,
PROP_ICON ,
g_param_spec_object ( " icon " ,
" Icon " ,
2012-12-03 14:58:13 -05:00
" 96 pixel sized icon " ,
2008-12-05 20:03:27 -05:00
GDK_TYPE_PIXBUF ,
G_PARAM_READABLE ) ) ;
g_object_class_install_property ( object_class ,
PROP_MINI_ICON ,
g_param_spec_object ( " mini-icon " ,
" Mini Icon " ,
" 16 pixel sized icon " ,
GDK_TYPE_PIXBUF ,
2008-12-18 07:41:56 -05:00
G_PARAM_READABLE ) ) ;
2009-01-20 07:52:06 -05:00
2009-02-11 07:16:41 -05:00
g_object_class_install_property ( object_class ,
PROP_DECORATED ,
g_param_spec_boolean ( " decorated " ,
" Decorated " ,
2010-02-12 15:26:52 -05:00
" Whether window is decorated " ,
2009-02-11 07:16:41 -05:00
TRUE ,
G_PARAM_READABLE ) ) ;
2009-03-17 08:27:13 -04:00
g_object_class_install_property ( object_class ,
PROP_FULLSCREEN ,
g_param_spec_boolean ( " fullscreen " ,
" Fullscreen " ,
2010-02-12 15:26:52 -05:00
" Whether window is fullscreened " ,
FALSE ,
G_PARAM_READABLE ) ) ;
g_object_class_install_property ( object_class ,
PROP_MAXIMIZED_HORIZONTALLY ,
g_param_spec_boolean ( " maximized-horizontally " ,
" Maximized horizontally " ,
" Whether window is maximized horizontally " ,
FALSE ,
G_PARAM_READABLE ) ) ;
g_object_class_install_property ( object_class ,
PROP_MAXIMIZED_VERTICALLY ,
g_param_spec_boolean ( " maximized-vertically " ,
" Maximizing vertically " ,
" Whether window is maximized vertically " ,
2009-03-17 08:27:13 -04:00
FALSE ,
G_PARAM_READABLE ) ) ;
2011-05-31 13:52:04 -04:00
g_object_class_install_property ( object_class ,
PROP_MINIMIZED ,
g_param_spec_boolean ( " minimized " ,
" Minimizing " ,
" Whether window is minimized " ,
FALSE ,
G_PARAM_READABLE ) ) ;
2009-03-17 08:27:13 -04:00
2009-08-04 03:06:30 -04:00
g_object_class_install_property ( object_class ,
PROP_WINDOW_TYPE ,
g_param_spec_enum ( " window-type " ,
" Window Type " ,
" The type of the window " ,
2012-02-23 14:39:58 -05:00
META_TYPE_WINDOW_TYPE ,
2009-08-04 03:06:30 -04:00
META_WINDOW_NORMAL ,
G_PARAM_READABLE ) ) ;
2009-08-31 12:06:53 -04:00
g_object_class_install_property ( object_class ,
PROP_USER_TIME ,
g_param_spec_uint ( " user-time " ,
" User time " ,
" Timestamp of last user interaction " ,
0 ,
G_MAXUINT ,
0 ,
G_PARAM_READABLE ) ) ;
2009-11-17 05:02:06 -05:00
g_object_class_install_property ( object_class ,
PROP_DEMANDS_ATTENTION ,
g_param_spec_boolean ( " demands-attention " ,
" Demands Attention " ,
" Whether the window has _NET_WM_STATE_DEMANDS_ATTENTION set " ,
FALSE ,
G_PARAM_READABLE ) ) ;
2009-11-20 03:51:19 -05:00
g_object_class_install_property ( object_class ,
PROP_URGENT ,
g_param_spec_boolean ( " urgent " ,
" Urgent " ,
" Whether the urgent flag of WM_HINTS is set " ,
FALSE ,
G_PARAM_READABLE ) ) ;
2010-01-18 05:12:17 -05:00
g_object_class_install_property ( object_class ,
PROP_MUTTER_HINTS ,
g_param_spec_string ( " mutter-hints " ,
" _MUTTER_HINTS " ,
" Contents of the _MUTTER_HINTS property of this window " ,
NULL ,
G_PARAM_READABLE ) ) ;
2011-03-24 21:36:47 -04:00
g_object_class_install_property ( object_class ,
PROP_APPEARS_FOCUSED ,
g_param_spec_boolean ( " appears-focused " ,
" Appears focused " ,
" Whether the window is drawn as being focused " ,
FALSE ,
G_PARAM_READABLE ) ) ;
2011-07-02 07:08:17 -04:00
g_object_class_install_property ( object_class ,
PROP_RESIZEABLE ,
g_param_spec_boolean ( " resizeable " ,
" Resizeable " ,
" Whether the window can be resized " ,
FALSE ,
G_PARAM_READABLE ) ) ;
g_object_class_install_property ( object_class ,
PROP_ABOVE ,
g_param_spec_boolean ( " above " ,
" Above " ,
" Whether the window is shown as always-on-top " ,
FALSE ,
G_PARAM_READABLE ) ) ;
2011-03-03 04:01:04 -05:00
g_object_class_install_property ( object_class ,
PROP_WM_CLASS ,
g_param_spec_string ( " wm-class " ,
" WM_CLASS " ,
" Contents of the WM_CLASS property of this window " ,
NULL ,
G_PARAM_READABLE ) ) ;
2011-11-25 18:42:41 -05:00
g_object_class_install_property ( object_class ,
2012-01-17 13:27:10 -05:00
PROP_GTK_APPLICATION_ID ,
g_param_spec_string ( " gtk-application-id " ,
" _GTK_APPLICATION_ID " ,
" Contents of the _GTK_APPLICATION_ID property of this window " ,
NULL ,
G_PARAM_READABLE ) ) ;
g_object_class_install_property ( object_class ,
PROP_GTK_UNIQUE_BUS_NAME ,
g_param_spec_string ( " gtk-unique-bus-name " ,
" _GTK_UNIQUE_BUS_NAME " ,
" Contents of the _GTK_UNIQUE_BUS_NAME property of this window " ,
NULL ,
G_PARAM_READABLE ) ) ;
g_object_class_install_property ( object_class ,
PROP_GTK_APPLICATION_OBJECT_PATH ,
g_param_spec_string ( " gtk-application-object-path " ,
" _GTK_APPLICATION_OBJECT_PATH " ,
" Contents of the _GTK_APPLICATION_OBJECT_PATH property of this window " ,
2011-11-25 18:42:41 -05:00
NULL ,
G_PARAM_READABLE ) ) ;
2011-12-05 12:52:35 -05:00
g_object_class_install_property ( object_class ,
2012-01-17 13:27:10 -05:00
PROP_GTK_WINDOW_OBJECT_PATH ,
g_param_spec_string ( " gtk-window-object-path " ,
" _GTK_WINDOW_OBJECT_PATH " ,
" Contents of the _GTK_WINDOW_OBJECT_PATH property of this window " ,
2011-12-05 12:52:35 -05:00
NULL ,
G_PARAM_READABLE ) ) ;
g_object_class_install_property ( object_class ,
2012-01-17 13:27:10 -05:00
PROP_GTK_APP_MENU_OBJECT_PATH ,
g_param_spec_string ( " gtk-app-menu-object-path " ,
" _GTK_APP_MENU_OBJECT_PATH " ,
" Contents of the _GTK_APP_MENU_OBJECT_PATH property of this window " ,
NULL ,
G_PARAM_READABLE ) ) ;
g_object_class_install_property ( object_class ,
PROP_GTK_MENUBAR_OBJECT_PATH ,
g_param_spec_string ( " gtk-menubar-object-path " ,
" _GTK_MENUBAR_OBJECT_PATH " ,
" Contents of the _GTK_MENUBAR_OBJECT_PATH property of this window " ,
2011-12-05 12:52:35 -05:00
NULL ,
G_PARAM_READABLE ) ) ;
2009-01-20 07:52:06 -05:00
window_signals [ WORKSPACE_CHANGED ] =
g_signal_new ( " workspace-changed " ,
G_TYPE_FROM_CLASS ( object_class ) ,
G_SIGNAL_RUN_LAST ,
G_STRUCT_OFFSET ( MetaWindowClass , workspace_changed ) ,
2011-10-18 18:06:14 -04:00
NULL , NULL , NULL ,
2009-01-20 07:52:06 -05:00
G_TYPE_NONE , 1 ,
G_TYPE_INT ) ;
2009-02-02 06:00:13 -05:00
window_signals [ FOCUS ] =
g_signal_new ( " focus " ,
G_TYPE_FROM_CLASS ( object_class ) ,
G_SIGNAL_RUN_LAST ,
G_STRUCT_OFFSET ( MetaWindowClass , focus ) ,
2011-10-18 18:06:14 -04:00
NULL , NULL , NULL ,
2009-02-02 06:00:13 -05:00
G_TYPE_NONE , 0 ) ;
2009-02-02 09:08:46 -05:00
window_signals [ RAISED ] =
g_signal_new ( " raised " ,
G_TYPE_FROM_CLASS ( object_class ) ,
G_SIGNAL_RUN_LAST ,
G_STRUCT_OFFSET ( MetaWindowClass , raised ) ,
2011-10-18 18:06:14 -04:00
NULL , NULL , NULL ,
2009-02-02 09:08:46 -05:00
G_TYPE_NONE , 0 ) ;
2009-10-13 10:34:34 -04:00
window_signals [ UNMANAGED ] =
g_signal_new ( " unmanaged " ,
G_TYPE_FROM_CLASS ( object_class ) ,
G_SIGNAL_RUN_LAST ,
G_STRUCT_OFFSET ( MetaWindowClass , unmanaged ) ,
2011-10-18 18:06:14 -04:00
NULL , NULL , NULL ,
2009-10-13 10:34:34 -04:00
G_TYPE_NONE , 0 ) ;
2008-11-07 04:57:00 -05:00
}
static void
meta_window_init ( MetaWindow * self )
{
2011-11-25 19:52:24 -05:00
meta_prefs_add_listener ( prefs_changed_callback , self ) ;
2008-11-07 04:57:00 -05:00
}
2002-12-08 14:17:17 -05:00
# ifdef WITH_VERBOSE_MODE
2002-03-10 10:48:38 -05:00
static const char *
wm_state_to_string ( int state )
{
switch ( state )
{
case NormalState :
2008-12-18 07:41:56 -05:00
return " NormalState " ;
2002-03-10 10:48:38 -05:00
case IconicState :
return " IconicState " ;
case WithdrawnState :
return " WithdrawnState " ;
}
return " Unknown " ;
}
2002-12-08 14:17:17 -05:00
# endif
2002-03-10 10:48:38 -05:00
2003-05-16 17:59:08 -04:00
static gboolean
is_desktop_or_dock_foreach ( MetaWindow * window ,
void * data )
{
gboolean * result = data ;
* result =
window - > type = = META_WINDOW_DESKTOP | |
window - > type = = META_WINDOW_DOCK ;
if ( * result )
return FALSE ; /* stop as soon as we find one */
else
return TRUE ;
}
/* window is the window that's newly mapped provoking
* the possible change
*/
static void
maybe_leave_show_desktop_mode ( MetaWindow * window )
{
gboolean is_desktop_or_dock ;
Make the "showing desktop" mode be per-workspace instead of per-screen.
2004-10-16 Elijah Newren <newren@math.utah.edu>
Make the "showing desktop" mode be per-workspace instead of
per-screen. (fixes #142198)
* src/keybindings.c (handle_toggle_desktop): access
showing_desktop through the active workspace
* src/screen.c (meta_screen_new): remove initialization of
screen->showing_desktop,
(meta_screen_update_showing_desktop_hint): rename and make not
static and access showing_desktop through the active workspace,
(queue_windows_showing): replace meta_display_list_windows() with
screen->active_workspace->windows,
(meta_screen_minimize_all_on_active_workspace_except): renamed
from meta_screen_minimize_all_except since it now only works on
the active workspace, (meta_screen_show_desktop,
meta_screen_unshow_desktop): access showing_desktop through the
active workspace
* src/screen.h (struct _MetaScreen): remove showing_desktop field,
(meta_screen_minimize_all_on_active_workspace_except): rename from
meta_screen_minimize_all_except,
(meta_screen_update)_showing_desktop_hint): export this function too
* src/window.c (maybe_leave_show_desktop_mode): access
showing_desktop through the active workspace and use new name for
meta_screen_minimize_all_on_active_workspace_except,
(window_should_be_showing): access showing_desktop through the
active workspace
* src/workspace.c (meta_workspace_new): initialize
workspace->showing_desktop, (meta_workspace_activate_with_focus):
add note that old can be NULL, update showing_desktop_hint if
different on this workspace than the previous one
* src/workspace.h (struct _MetaWorkspace): add showing_desktop
field
2004-10-17 00:28:29 -04:00
if ( ! window - > screen - > active_workspace - > showing_desktop )
2003-05-16 17:59:08 -04:00
return ;
/* If the window is a transient for the dock or desktop, don't
* leave show desktop mode when the window opens . That ' s
* so you can e . g . hide all windows , manipulate a file on
* the desktop via a dialog , then unshow windows again .
*/
is_desktop_or_dock = FALSE ;
2003-05-18 13:16:03 -04:00
is_desktop_or_dock_foreach ( window ,
& is_desktop_or_dock ) ;
2003-05-16 17:59:08 -04:00
meta_window_foreach_ancestor ( window , is_desktop_or_dock_foreach ,
& is_desktop_or_dock ) ;
if ( ! is_desktop_or_dock )
{
Make the "showing desktop" mode be per-workspace instead of per-screen.
2004-10-16 Elijah Newren <newren@math.utah.edu>
Make the "showing desktop" mode be per-workspace instead of
per-screen. (fixes #142198)
* src/keybindings.c (handle_toggle_desktop): access
showing_desktop through the active workspace
* src/screen.c (meta_screen_new): remove initialization of
screen->showing_desktop,
(meta_screen_update_showing_desktop_hint): rename and make not
static and access showing_desktop through the active workspace,
(queue_windows_showing): replace meta_display_list_windows() with
screen->active_workspace->windows,
(meta_screen_minimize_all_on_active_workspace_except): renamed
from meta_screen_minimize_all_except since it now only works on
the active workspace, (meta_screen_show_desktop,
meta_screen_unshow_desktop): access showing_desktop through the
active workspace
* src/screen.h (struct _MetaScreen): remove showing_desktop field,
(meta_screen_minimize_all_on_active_workspace_except): rename from
meta_screen_minimize_all_except,
(meta_screen_update)_showing_desktop_hint): export this function too
* src/window.c (maybe_leave_show_desktop_mode): access
showing_desktop through the active workspace and use new name for
meta_screen_minimize_all_on_active_workspace_except,
(window_should_be_showing): access showing_desktop through the
active workspace
* src/workspace.c (meta_workspace_new): initialize
workspace->showing_desktop, (meta_workspace_activate_with_focus):
add note that old can be NULL, update showing_desktop_hint if
different on this workspace than the previous one
* src/workspace.h (struct _MetaWorkspace): add showing_desktop
field
2004-10-17 00:28:29 -04:00
meta_screen_minimize_all_on_active_workspace_except ( window - > screen ,
window ) ;
2008-12-18 07:41:56 -05:00
meta_screen_unshow_desktop ( window - > screen ) ;
2003-05-16 17:59:08 -04:00
}
}
2001-05-30 11:36:31 -04:00
MetaWindow *
2002-10-26 03:37:11 -04:00
meta_window_new ( MetaDisplay * display ,
Window xwindow ,
gboolean must_be_viewable )
2001-05-30 11:36:31 -04:00
{
XWindowAttributes attrs ;
2003-11-20 21:32:05 -05:00
MetaWindow * window ;
2008-12-18 07:41:56 -05:00
2003-11-20 21:32:05 -05:00
meta_display_grab ( display ) ;
meta_error_trap_push ( display ) ; /* Push a trap over all of window
* creation , to reduce XSync ( ) calls
*/
2008-12-18 07:41:56 -05:00
2003-11-20 21:32:05 -05:00
meta_error_trap_push_with_return ( display ) ;
2008-12-18 07:41:56 -05:00
if ( XGetWindowAttributes ( display - > xdisplay , xwindow , & attrs ) )
2008-04-29 09:33:39 -04:00
{
2010-10-25 14:44:30 -04:00
if ( meta_error_trap_pop_with_return ( display ) ! = Success )
2008-04-29 09:33:39 -04:00
{
meta_verbose ( " Failed to get attributes for window 0x%lx \n " ,
xwindow ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( display ) ;
2008-04-29 09:33:39 -04:00
meta_display_ungrab ( display ) ;
return NULL ;
}
window = meta_window_new_with_attrs ( display , xwindow ,
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
must_be_viewable ,
META_COMP_EFFECT_CREATE ,
& attrs ) ;
2008-04-29 09:33:39 -04:00
}
else
{
2010-10-25 14:44:30 -04:00
meta_error_trap_pop_with_return ( display ) ;
2008-04-29 09:33:39 -04:00
meta_verbose ( " Failed to get attributes for window 0x%lx \n " ,
xwindow ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( display ) ;
2008-04-29 09:33:39 -04:00
meta_display_ungrab ( display ) ;
return NULL ;
}
2008-12-18 07:41:56 -05:00
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( display ) ;
2003-11-20 21:32:05 -05:00
meta_display_ungrab ( display ) ;
return window ;
}
2011-03-08 17:15:56 -05:00
/* The MUTTER_WM_CLASS_FILTER environment variable is designed for
* performance and regression testing environments where we want to do
* tests with only a limited set of windows and ignore all other windows
*
* When it is set to a comma separated list of WM_CLASS class names , all
* windows not matching the list will be ignored .
*
* Returns TRUE if window has been filtered out and should be ignored .
*/
static gboolean
maybe_filter_window ( MetaDisplay * display ,
Window xwindow ,
gboolean must_be_viewable ,
XWindowAttributes * attrs )
{
static char * * filter_wm_classes = NULL ;
static gboolean initialized = FALSE ;
XClassHint class_hint ;
gboolean filtered ;
Status success ;
int i ;
if ( ! initialized )
{
const char * filter_string = g_getenv ( " MUTTER_WM_CLASS_FILTER " ) ;
if ( filter_string )
filter_wm_classes = g_strsplit ( filter_string , " , " , - 1 ) ;
initialized = TRUE ;
}
if ( ! filter_wm_classes | | ! filter_wm_classes [ 0 ] )
return FALSE ;
filtered = TRUE ;
meta_error_trap_push ( display ) ;
success = XGetClassHint ( display - > xdisplay , xwindow , & class_hint ) ;
if ( success )
{
for ( i = 0 ; filter_wm_classes [ i ] ; i + + )
{
if ( strcmp ( class_hint . res_class , filter_wm_classes [ i ] ) = = 0 )
{
filtered = FALSE ;
break ;
}
}
XFree ( class_hint . res_name ) ;
XFree ( class_hint . res_class ) ;
}
if ( filtered )
{
/* We want to try and get the window managed by the next WM that come along,
* so we need to make sure that windows that are requested to be mapped while
* Mutter is running ( ! must_be_viewable ) , or windows already viewable at startup
* get a non - withdrawn WM_STATE property . Previously unmapped windows are left
* with whatever WM_STATE property they had .
*/
if ( ! must_be_viewable | | attrs - > map_state = = IsViewable )
{
gulong old_state ;
if ( ! meta_prop_get_cardinal_with_atom_type ( display , xwindow ,
display - > atom_WM_STATE ,
display - > atom_WM_STATE ,
& old_state ) )
old_state = WithdrawnState ;
if ( old_state = = WithdrawnState )
set_wm_state_on_xwindow ( display , xwindow , NormalState ) ;
}
/* Make sure filtered windows are hidden from view */
XUnmapWindow ( display - > xdisplay , xwindow ) ;
}
meta_error_trap_pop ( display ) ;
return filtered ;
}
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
gboolean
meta_window_should_attach_to_parent ( MetaWindow * window )
{
MetaWindow * parent ;
if ( ! meta_prefs_get_attach_modal_dialogs ( ) | |
window - > type ! = META_WINDOW_MODAL_DIALOG )
return FALSE ;
parent = meta_window_get_transient_for ( window ) ;
if ( ! parent )
return FALSE ;
2011-07-22 12:34:10 -04:00
switch ( parent - > type )
{
case META_WINDOW_NORMAL :
case META_WINDOW_DIALOG :
case META_WINDOW_MODAL_DIALOG :
return TRUE ;
default :
return FALSE ;
}
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
}
2003-11-20 21:32:05 -05:00
MetaWindow *
meta_window_new_with_attrs ( MetaDisplay * display ,
Window xwindow ,
gboolean must_be_viewable ,
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
MetaCompEffect effect ,
2003-11-20 21:32:05 -05:00
XWindowAttributes * attrs )
{
MetaWindow * window ;
2001-05-30 11:36:31 -04:00
GSList * tmp ;
2001-06-12 20:56:08 -04:00
MetaWorkspace * space ;
2001-06-24 02:47:54 -04:00
gulong existing_wm_state ;
2003-01-05 02:51:02 -05:00
gulong event_mask ;
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
2006-01-02 Elijah Newren <newren@gmail.com>
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
* src/boxes.c (meta_rectangle_region_to_string,
meta_rectangle_edge_list_to_string, fix_up_edges):
* src/constraints.c (meta_window_constrain, setup_constraint_info,
place_window_if_needed, constrain_maximization,
constrain_fullscreen, constrain_size_increments,
constrain_size_limits, constrain_aspect_ratio,
do_screen_and_xinerama_relative_constrai,
constrain_to_single_xinerama, constrain_fully_onscreen,
constrain_partially_onscreen):
* src/edge-resistance.c (find_nearest_position,
apply_edge_resistance, apply_edge_resistance_to_each_side):
* src/testboxes.c (test_clamping_to_region,
test_clipping_to_region, test_shoving_into_region):
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_resize,
meta_window_resize_with_gravity, meta_window_configure_request):
Remove C99 style variable initiailization
2006-01-02 13:37:46 -05:00
MetaMoveResizeFlags flags ;
2003-01-05 02:51:02 -05:00
gboolean has_shape ;
2008-11-23 14:28:40 -05:00
MetaScreen * screen ;
2003-11-20 21:32:05 -05:00
g_assert ( attrs ! = NULL ) ;
2008-12-18 07:41:56 -05:00
2001-05-31 02:42:58 -04:00
meta_verbose ( " Attempting to manage 0x%lx \n " , xwindow ) ;
2001-06-10 23:24:20 -04:00
2005-12-28 01:24:30 -05:00
if ( meta_display_xwindow_is_a_no_focus_window ( display , xwindow ) )
2002-01-05 22:15:49 -05:00
{
meta_verbose ( " Not managing no_focus_window 0x%lx \n " ,
xwindow ) ;
return NULL ;
}
2003-11-20 21:32:05 -05:00
2008-11-23 14:28:40 -05:00
screen = NULL ;
for ( tmp = display - > screens ; tmp ! = NULL ; tmp = tmp - > next )
2003-11-20 21:32:05 -05:00
{
2008-11-23 14:28:40 -05:00
MetaScreen * scr = tmp - > data ;
if ( scr - > xroot = = attrs - > root )
{
screen = tmp - > data ;
break ;
}
2003-11-20 21:32:05 -05:00
}
2008-12-18 07:41:56 -05:00
2008-11-23 14:28:40 -05:00
g_assert ( screen ) ;
2008-12-18 07:41:56 -05:00
2008-11-23 14:28:40 -05:00
/* A black list of override redirect windows that we don't need to manage: */
if ( attrs - > override_redirect & &
( xwindow = = screen - > no_focus_window | |
xwindow = = screen - > flash_window | |
xwindow = = screen - > wm_sn_selection_window | |
attrs - > class = = InputOnly | |
/* any windows created via meta_create_offscreen_window: */
( attrs - > x = = - 100 & & attrs - > y = = - 100
& & attrs - > width = = 1 & & attrs - > height = = 1 ) | |
xwindow = = screen - > wm_cm_selection_window | |
xwindow = = screen - > guard_window | |
( display - > compositor & &
xwindow = = XCompositeGetOverlayWindow ( display - > xdisplay ,
screen - > xroot )
)
)
) {
meta_verbose ( " Not managing our own windows \n " ) ;
return NULL ;
}
2011-03-08 17:15:56 -05:00
if ( maybe_filter_window ( display , xwindow , must_be_viewable , attrs ) )
{
meta_verbose ( " Not managing filtered window \n " ) ;
return NULL ;
}
2001-06-10 23:24:20 -04:00
/* Grab server */
meta_display_grab ( display ) ;
2002-10-21 17:44:35 -04:00
meta_error_trap_push ( display ) ; /* Push a trap over all of window
* creation , to reduce XSync ( ) calls
*/
2001-06-10 23:24:20 -04:00
2003-11-20 21:32:05 -05:00
meta_verbose ( " must_be_viewable = %d attrs->map_state = %d (%s) \n " ,
2002-03-10 10:48:38 -05:00
must_be_viewable ,
2003-11-20 21:32:05 -05:00
attrs - > map_state ,
( attrs - > map_state = = IsUnmapped ) ?
2001-08-19 02:23:59 -04:00
" IsUnmapped " :
2003-11-20 21:32:05 -05:00
( attrs - > map_state = = IsViewable ) ?
2001-08-19 02:23:59 -04:00
" IsViewable " :
2003-11-20 21:32:05 -05:00
( attrs - > map_state = = IsUnviewable ) ?
2001-08-19 02:23:59 -04:00
" IsUnviewable " :
" (unknown) " ) ;
2008-12-18 07:41:56 -05:00
2001-06-24 02:47:54 -04:00
existing_wm_state = WithdrawnState ;
2003-11-20 21:32:05 -05:00
if ( must_be_viewable & & attrs - > map_state ! = IsViewable )
2001-06-11 01:47:51 -04:00
{
2001-06-23 14:30:27 -04:00
/* Only manage if WM_STATE is IconicState or NormalState */
gulong state ;
2002-01-03 22:25:53 -05:00
/* WM_STATE isn't a cardinal, it's type WM_STATE, but is an int */
if ( ! ( meta_prop_get_cardinal_with_atom_type ( display , xwindow ,
2008-05-02 14:49:01 -04:00
display - > atom_WM_STATE ,
display - > atom_WM_STATE ,
2002-01-03 22:25:53 -05:00
& state ) & &
2001-06-23 14:30:27 -04:00
( state = = IconicState | | state = = NormalState ) ) )
{
meta_verbose ( " Deciding not to manage unmapped or unviewable window 0x%lx \n " , xwindow ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( display ) ;
2001-06-23 14:30:27 -04:00
meta_display_ungrab ( display ) ;
return NULL ;
}
2001-06-24 02:47:54 -04:00
existing_wm_state = state ;
2002-03-10 10:48:38 -05:00
meta_verbose ( " WM_STATE of %lx = %s \n " , xwindow ,
wm_state_to_string ( existing_wm_state ) ) ;
2001-06-11 01:47:51 -04:00
}
2008-12-18 07:41:56 -05:00
2002-10-21 17:44:35 -04:00
meta_error_trap_push_with_return ( display ) ;
2008-12-18 07:41:56 -05:00
2008-12-02 07:11:06 -05:00
/*
* XAddToSaveSet can only be called on windows created by a different client .
* with Mutter we want to be able to create manageable windows from within
* the process ( such as a dummy desktop window ) , so we do not want this
* call failing to prevent the window from being managed - - wrap it in its
* own error trap ( we use the _with_return ( ) version here to ensure that
* XSync ( ) is done on the pop , otherwise the error will not get caught ) .
*/
meta_error_trap_push_with_return ( display ) ;
2001-05-31 02:42:58 -04:00
XAddToSaveSet ( display - > xdisplay , xwindow ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop_with_return ( display ) ;
2001-05-31 02:42:58 -04:00
2003-01-05 02:51:02 -05:00
event_mask =
PropertyChangeMask | EnterWindowMask | LeaveWindowMask |
FocusChangeMask | ColormapChangeMask ;
2008-11-23 14:28:40 -05:00
if ( attrs - > override_redirect )
event_mask | = StructureNotifyMask ;
2003-01-05 02:51:02 -05:00
2010-07-14 16:08:16 -04:00
/* If the window is from this client (a menu, say) we need to augment
* the event mask , not replace it . For windows from other clients ,
* attrs - > your_event_mask will be empty at this point .
*/
XSelectInput ( display - > xdisplay , xwindow , attrs - > your_event_mask | event_mask ) ;
2003-01-05 02:51:02 -05:00
has_shape = FALSE ;
# ifdef HAVE_SHAPE
if ( META_DISPLAY_HAS_SHAPE ( display ) )
{
int x_bounding , y_bounding , x_clip , y_clip ;
unsigned w_bounding , h_bounding , w_clip , h_clip ;
int bounding_shaped , clip_shaped ;
XShapeSelectInput ( display - > xdisplay , xwindow , ShapeNotifyMask ) ;
XShapeQueryExtents ( display - > xdisplay , xwindow ,
& bounding_shaped , & x_bounding , & y_bounding ,
& w_bounding , & h_bounding ,
& clip_shaped , & x_clip , & y_clip ,
& w_clip , & h_clip ) ;
has_shape = bounding_shaped ! = FALSE ;
meta_topic ( META_DEBUG_SHAPES ,
2006-01-20 17:03:56 -05:00
" Window has_shape = %d extents %d,%d %u x %u \n " ,
2003-01-05 02:51:02 -05:00
has_shape , x_bounding , y_bounding ,
w_bounding , h_bounding ) ;
}
# endif
2001-06-04 00:58:22 -04:00
/* Get rid of any borders */
2003-11-20 21:32:05 -05:00
if ( attrs - > border_width ! = 0 )
2001-06-04 00:58:22 -04:00
XSetWindowBorderWidth ( display - > xdisplay , xwindow , 0 ) ;
2001-06-30 19:17:52 -04:00
/* Get rid of weird gravities */
2003-11-20 21:32:05 -05:00
if ( attrs - > win_gravity ! = NorthWestGravity )
2001-06-30 19:17:52 -04:00
{
XSetWindowAttributes set_attrs ;
2008-12-18 07:41:56 -05:00
2001-06-30 19:17:52 -04:00
set_attrs . win_gravity = NorthWestGravity ;
2008-12-18 07:41:56 -05:00
2001-06-30 19:17:52 -04:00
XChangeWindowAttributes ( display - > xdisplay ,
xwindow ,
CWWinGravity ,
& set_attrs ) ;
}
2008-12-18 07:41:56 -05:00
2010-10-25 14:44:30 -04:00
if ( meta_error_trap_pop_with_return ( display ) ! = Success )
2001-05-30 11:36:31 -04:00
{
meta_verbose ( " Window 0x%lx disappeared just as we tried to manage it \n " ,
xwindow ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( display ) ;
2001-06-10 23:24:20 -04:00
meta_display_ungrab ( display ) ;
2001-05-30 11:36:31 -04:00
return NULL ;
}
2001-06-10 23:24:20 -04:00
2008-12-18 07:41:56 -05:00
2008-11-07 04:57:00 -05:00
window = g_object_new ( META_TYPE_WINDOW , NULL ) ;
2001-05-30 11:36:31 -04:00
deleted and moved into window-props.c (meta_window_new_with_attrs): added
2006-03-25 Thomas Thurman <thomas@thurman.org.uk>
* src/window.c, src/window.h (update_net_wm_state,
update_mwm_hints, update_wm_class, update_transient_for):
deleted and moved into window-props.c
(meta_window_new_with_attrs): added constructing field
and four new initial properties (as above)
(meta_window_recalc_features,
meta_window_recalc_window_type): new functions
* src/window-props.c (init_net_wm_state, reload_net_wm_state
init_mwm_hints, reload_mwm_hints, init_wm_class,
reload_mwm_class, init_transient_for, reload_transient_for):
new functions, moved in from window.c
(meta_display_init_window_prop_hooks): initialise new properties
2006-03-25 17:57:22 -05:00
window - > constructing = TRUE ;
2008-12-18 07:41:56 -05:00
2002-04-13 00:58:45 -04:00
window - > dialog_pid = - 1 ;
2008-12-18 07:41:56 -05:00
2001-05-30 11:36:31 -04:00
window - > xwindow = xwindow ;
2008-12-18 07:41:56 -05:00
2001-05-31 02:42:58 -04:00
/* this is in window->screen->display, but that's too annoying to
* type
*/
window - > display = display ;
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
window - > workspace = NULL ;
2002-12-09 22:23:04 -05:00
# ifdef HAVE_XSYNC
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
window - > sync_request_counter = None ;
window - > sync_request_serial = 0 ;
window - > sync_request_time . tv_sec = 0 ;
window - > sync_request_time . tv_usec = 0 ;
2002-12-09 22:23:04 -05:00
# endif
2002-05-27 15:26:56 -04:00
2008-11-23 14:28:40 -05:00
window - > screen = screen ;
2001-06-04 00:58:22 -04:00
2003-05-16 17:59:08 -04:00
window - > desc = g_strdup_printf ( " 0x%lx " , window - > xwindow ) ;
2003-06-07 13:15:33 -04:00
2008-11-23 14:28:40 -05:00
window - > override_redirect = attrs - > override_redirect ;
2001-06-10 23:24:20 -04:00
/* avoid tons of stack updates */
meta_stack_freeze ( window - > screen - > stack ) ;
2003-01-05 02:51:02 -05:00
window - > has_shape = has_shape ;
2008-12-18 07:41:56 -05:00
2003-11-20 21:32:05 -05:00
window - > rect . x = attrs - > x ;
window - > rect . y = attrs - > y ;
window - > rect . width = attrs - > width ;
window - > rect . height = attrs - > height ;
2001-06-02 21:33:27 -04:00
2001-06-04 00:58:22 -04:00
/* And border width, size_hints are the "request" */
2003-11-20 21:32:05 -05:00
window - > border_width = attrs - > border_width ;
window - > size_hints . x = attrs - > x ;
window - > size_hints . y = attrs - > y ;
window - > size_hints . width = attrs - > width ;
window - > size_hints . height = attrs - > height ;
2003-04-26 13:40:32 -04:00
/* initialize the remaining size_hints as if size_hints.flags were zero */
meta_set_normal_hints ( window , NULL ) ;
2001-06-07 01:18:10 -04:00
/* And this is our unmaximized size */
window - > saved_rect = window - > rect ;
2001-08-28 23:37:03 -04:00
window - > user_rect = window - > rect ;
2008-12-18 07:41:56 -05:00
2003-11-20 21:32:05 -05:00
window - > depth = attrs - > depth ;
window - > xvisual = attrs - > visual ;
window - > colormap = attrs - > colormap ;
2008-12-18 07:41:56 -05:00
2001-06-02 00:14:18 -04:00
window - > title = NULL ;
2001-06-23 22:22:10 -04:00
window - > icon_name = NULL ;
window - > icon = NULL ;
2001-09-15 20:30:45 -04:00
window - > mini_icon = NULL ;
2002-02-09 18:03:52 -05:00
meta_icon_cache_init ( & window - > icon_cache ) ;
window - > wm_hints_pixmap = None ;
window - > wm_hints_mask = None ;
2009-11-20 03:51:19 -05:00
window - > wm_hints_urgent = FALSE ;
2001-06-02 21:33:27 -04:00
window - > frame = NULL ;
2001-06-04 00:58:22 -04:00
window - > has_focus = FALSE ;
2011-03-24 21:36:47 -04:00
window - > attached_focus_window = NULL ;
2001-06-04 02:17:52 -04:00
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
window - > maximized_horizontally = FALSE ;
window - > maximized_vertically = FALSE ;
window - > maximize_horizontally_after_placement = FALSE ;
window - > maximize_vertically_after_placement = FALSE ;
2006-10-01 17:59:09 -04:00
window - > minimize_after_placement = FALSE ;
2002-02-23 17:58:02 -05:00
window - > fullscreen = FALSE ;
2010-01-20 10:59:07 -05:00
window - > fullscreen_after_placement = FALSE ;
2008-11-16 21:57:20 -05:00
window - > fullscreen_monitors [ 0 ] = - 1 ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
window - > require_fully_onscreen = TRUE ;
2009-08-31 09:52:16 -04:00
window - > require_on_single_monitor = TRUE ;
2006-08-07 19:34:55 -04:00
window - > require_titlebar_visible = TRUE ;
2001-06-09 23:17:15 -04:00
window - > on_all_workspaces = FALSE ;
2011-02-28 05:41:23 -05:00
window - > on_all_workspaces_requested = FALSE ;
2010-06-24 14:41:28 -04:00
window - > tile_mode = META_TILE_NONE ;
2011-10-08 11:00:16 -04:00
window - > tile_monitor_number = - 1 ;
2001-06-07 22:17:48 -04:00
window - > shaded = FALSE ;
2001-06-04 02:17:52 -04:00
window - > initially_iconic = FALSE ;
window - > minimized = FALSE ;
2005-10-03 16:02:31 -04:00
window - > tab_unminimized = FALSE ;
2001-06-04 02:17:52 -04:00
window - > iconic = FALSE ;
2003-11-20 21:32:05 -05:00
window - > mapped = attrs - > map_state ! = IsUnmapped ;
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
window - > hidden = FALSE ;
window - > visible_to_compositor = FALSE ;
window - > pending_compositor_effect = effect ;
2004-12-28 01:01:42 -05:00
/* if already mapped, no need to worry about focus-on-first-time-showing */
window - > showing_for_first_time = ! window - > mapped ;
2009-06-15 18:25:07 -04:00
/* if already mapped we don't want to do the placement thing;
* override - redirect windows are placed by the app */
window - > placed = ( ( window - > mapped & & ! window - > hidden ) | | window - > override_redirect ) ;
2001-06-24 04:09:10 -04:00
if ( window - > placed )
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_PLACEMENT ,
" Not placing window 0x%lx since it's already mapped \n " ,
xwindow ) ;
2010-01-20 10:59:07 -05:00
window - > force_save_user_rect = TRUE ;
2005-02-11 14:20:44 -05:00
window - > denied_focus_and_not_transient = FALSE ;
2001-06-21 23:20:21 -04:00
window - > unmanaging = FALSE ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
window - > is_in_queues = 0 ;
2001-06-23 01:49:35 -04:00
window - > keys_grabbed = FALSE ;
window - > grab_on_frame = FALSE ;
2001-07-11 02:22:00 -04:00
window - > all_keys_grabbed = FALSE ;
2001-06-23 14:30:27 -04:00
window - > withdrawn = FALSE ;
2001-06-24 02:47:54 -04:00
window - > initial_workspace_set = FALSE ;
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
window - > initial_timestamp_set = FALSE ;
window - > net_wm_user_time_set = FALSE ;
2007-03-31 01:19:41 -04:00
window - > user_time_window = None ;
2009-11-09 13:47:16 -05:00
window - > take_focus = FALSE ;
window - > delete_window = FALSE ;
window - > net_wm_ping = FALSE ;
window - > input = TRUE ;
2001-06-24 04:09:10 -04:00
window - > calc_placement = FALSE ;
2003-06-12 01:55:06 -04:00
window - > shaken_loose = FALSE ;
2003-10-13 16:15:40 -04:00
window - > have_focus_click_grab = FALSE ;
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
window - > disable_sync = FALSE ;
2008-12-18 07:41:56 -05:00
2001-06-10 23:24:20 -04:00
window - > unmaps_pending = 0 ;
2008-12-18 07:41:56 -05:00
2001-06-23 14:30:27 -04:00
window - > mwm_decorated = TRUE ;
2002-06-21 23:23:02 -04:00
window - > mwm_border_only = FALSE ;
2001-06-23 14:30:27 -04:00
window - > mwm_has_close_func = TRUE ;
window - > mwm_has_minimize_func = TRUE ;
window - > mwm_has_maximize_func = TRUE ;
window - > mwm_has_move_func = TRUE ;
window - > mwm_has_resize_func = TRUE ;
2008-12-18 07:41:56 -05:00
2001-06-08 02:39:38 -04:00
window - > decorated = TRUE ;
window - > has_close_func = TRUE ;
window - > has_minimize_func = TRUE ;
window - > has_maximize_func = TRUE ;
2001-06-23 14:30:27 -04:00
window - > has_move_func = TRUE ;
window - > has_resize_func = TRUE ;
2001-06-23 02:54:28 -04:00
window - > has_shade_func = TRUE ;
2002-02-23 17:58:02 -05:00
window - > has_fullscreen_func = TRUE ;
2003-05-16 17:59:08 -04:00
window - > always_sticky = FALSE ;
2008-12-18 07:41:56 -05:00
2001-06-09 23:17:15 -04:00
window - > wm_state_modal = FALSE ;
2002-07-06 15:05:37 -04:00
window - > skip_taskbar = FALSE ;
window - > skip_pager = FALSE ;
2001-06-11 01:47:51 -04:00
window - > wm_state_skip_taskbar = FALSE ;
window - > wm_state_skip_pager = FALSE ;
2002-10-01 20:47:29 -04:00
window - > wm_state_above = FALSE ;
window - > wm_state_below = FALSE ;
Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 15:56:10 -04:00
window - > wm_state_demands_attention = FALSE ;
2008-12-18 07:41:56 -05:00
2001-06-09 17:58:30 -04:00
window - > res_class = NULL ;
window - > res_name = NULL ;
window - > role = NULL ;
window - > sm_client_id = NULL ;
2002-04-13 00:58:45 -04:00
window - > wm_client_machine = NULL ;
2002-11-30 22:58:04 -05:00
window - > startup_id = NULL ;
2008-12-18 07:41:56 -05:00
2002-04-13 00:58:45 -04:00
window - > net_wm_pid = - 1 ;
2008-12-18 07:41:56 -05:00
2001-06-09 17:58:30 -04:00
window - > xtransient_for = None ;
window - > xclient_leader = None ;
2002-09-27 15:42:59 -04:00
window - > transient_parent_is_root_window = FALSE ;
2008-12-18 07:41:56 -05:00
2001-06-09 23:17:15 -04:00
window - > type = META_WINDOW_NORMAL ;
window - > type_atom = None ;
2001-06-10 03:27:11 -04:00
2003-06-25 23:09:38 -04:00
window - > struts = NULL ;
2002-08-12 17:32:13 -04:00
2006-05-04 21:10:20 -04:00
window - > using_net_wm_name = FALSE ;
window - > using_net_wm_visible_name = FALSE ;
window - > using_net_wm_icon_name = FALSE ;
window - > using_net_wm_visible_icon_name = FALSE ;
2003-02-27 20:24:44 -05:00
window - > need_reread_icon = TRUE ;
2008-12-18 07:41:56 -05:00
2002-09-28 12:33:39 -04:00
window - > layer = META_LAYER_LAST ; /* invalid value */
window - > stack_position = - 1 ;
2001-06-24 02:47:54 -04:00
window - > initial_workspace = 0 ; /* not used */
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
window - > initial_timestamp = 0 ; /* not used */
2008-10-31 08:57:47 -04:00
window - > compositor_private = NULL ;
2008-12-18 07:41:56 -05:00
2011-02-25 10:37:05 -05:00
window - > monitor = meta_screen_get_monitor_for_window ( window - > screen , window ) ;
2012-02-24 11:08:55 -05:00
window - > tile_match = NULL ;
2009-08-01 04:04:17 -04:00
if ( window - > override_redirect )
{
window - > decorated = FALSE ;
window - > always_sticky = TRUE ;
window - > has_close_func = FALSE ;
window - > has_shade_func = FALSE ;
window - > has_move_func = FALSE ;
window - > has_resize_func = FALSE ;
}
2001-05-31 02:42:58 -04:00
meta_display_register_x_window ( display , & window - > xwindow , window ) ;
2003-11-24 14:09:25 -05:00
2009-09-18 20:50:11 -04:00
/* Assign this #MetaWindow a sequence number which can be used
* for sorting .
*/
window - > stable_sequence = + + display - > window_sequence_counter ;
2003-11-24 14:09:25 -05:00
/* assign the window to its group, or create a new group if needed
*/
window - > group = NULL ;
window - > xgroup_leader = None ;
meta_window_compute_group ( window ) ;
2008-12-18 07:41:56 -05:00
2009-06-14 08:37:57 -04:00
meta_window_load_initial_properties ( window ) ;
2008-12-18 07:41:56 -05:00
2008-11-23 14:28:40 -05:00
if ( ! window - > override_redirect )
2009-06-14 08:37:57 -04:00
{
update_sm_hints ( window ) ; /* must come after transient_for */
meta_window_update_role ( window ) ;
}
2009-02-12 12:14:12 -05:00
2009-01-27 00:03:06 -05:00
meta_window_update_net_wm_type ( window ) ;
2009-02-12 12:14:12 -05:00
2008-11-23 14:28:40 -05:00
if ( ! window - > override_redirect )
meta_window_update_icon_now ( window ) ;
2003-06-04 15:15:46 -04:00
2001-06-04 02:17:52 -04:00
if ( window - > initially_iconic )
{
2001-06-06 00:47:37 -04:00
/* WM_HINTS said minimized */
window - > minimized = TRUE ;
meta_verbose ( " Window %s asked to start out minimized \n " , window - > desc ) ;
2001-06-04 02:17:52 -04:00
}
2001-06-24 02:47:54 -04:00
if ( existing_wm_state = = IconicState )
{
/* WM_STATE said minimized */
window - > minimized = TRUE ;
meta_verbose ( " Window %s had preexisting WM_STATE = IconicState, minimizing \n " ,
window - > desc ) ;
/* Assume window was previously placed, though perhaps it's
* been iconic its whole life , we have no way of knowing .
*/
window - > placed = TRUE ;
}
2002-11-30 22:58:04 -05:00
/* Apply any window attributes such as initial workspace
* based on startup notification
*/
meta_screen_apply_startup_properties ( window - > screen , window ) ;
2007-11-09 15:41:45 -05:00
/* Try to get a "launch timestamp" for the window. If the window is
* a transient , we ' d like to be able to get a last - usage timestamp
* from the parent window . If the window has no parent , there isn ' t
* much we can do . . . except record the current time so that any children
* can use this time as a fallback .
*/
2009-06-14 08:37:57 -04:00
if ( ! window - > override_redirect & & ! window - > net_wm_user_time_set ) {
2007-11-09 15:41:45 -05:00
MetaWindow * parent = NULL ;
if ( window - > xtransient_for )
parent = meta_display_lookup_x_window ( window - > display ,
window - > xtransient_for ) ;
2008-02-26 23:39:10 -05:00
/* First, maybe the app was launched with startup notification using an
* obsolete version of the spec ; use that timestamp if it exists .
*/
2007-11-09 15:41:45 -05:00
if ( window - > initial_timestamp_set )
2008-02-26 23:39:10 -05:00
/* NOTE: Do NOT toggle net_wm_user_time_set to true; this is just
* being recorded as a fallback for potential transients
*/
2007-11-09 15:41:45 -05:00
window - > net_wm_user_time = window - > initial_timestamp ;
else if ( parent ! = NULL )
meta_window_set_user_time ( window , parent - > net_wm_user_time ) ;
else
2008-02-26 23:39:10 -05:00
/* NOTE: Do NOT toggle net_wm_user_time_set to true; this is just
* being recorded as a fallback for potential transients
*/
2007-11-09 15:41:45 -05:00
window - > net_wm_user_time =
meta_display_get_current_time_roundtrip ( window - > display ) ;
}
2008-12-18 07:41:56 -05:00
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
window - > attached = meta_window_should_attach_to_parent ( window ) ;
if ( window - > attached )
recalc_window_features ( window ) ;
2001-06-08 02:39:38 -04:00
if ( window - > decorated )
meta_window_ensure_frame ( window ) ;
2001-06-04 02:17:52 -04:00
2001-06-23 01:49:35 -04:00
meta_window_grab_keys ( window ) ;
2008-11-23 14:28:40 -05:00
if ( window - > type ! = META_WINDOW_DOCK & & ! window - > override_redirect )
2008-10-05 21:34:17 -04:00
{
meta_display_grab_window_buttons ( window - > display , window - > xwindow ) ;
meta_display_grab_focus_window_button ( window - > display , window ) ;
}
2003-12-14 14:19:40 -05:00
if ( window - > type = = META_WINDOW_DESKTOP | |
2011-02-28 05:41:23 -05:00
window - > type = = META_WINDOW_DOCK )
2003-12-14 14:19:40 -05:00
{
/* Change the default, but don't enforce this if the user
* focuses the dock / desktop and unsticks it using key shortcuts .
* Need to set this before adding to the workspaces so the MRU
* lists will be updated .
*/
2011-02-28 05:41:23 -05:00
window - > on_all_workspaces_requested = TRUE ;
2003-12-14 14:19:40 -05:00
}
2008-12-18 07:41:56 -05:00
2011-02-28 05:41:23 -05:00
window - > on_all_workspaces = should_be_on_all_workspaces ( window ) ;
2001-06-24 02:47:54 -04:00
/* For the workspace, first honor hints,
* if that fails put transients with parents ,
* otherwise put window on active space
*/
2008-12-18 07:41:56 -05:00
2001-06-24 02:47:54 -04:00
if ( window - > initial_workspace_set )
{
2002-02-06 22:07:56 -05:00
if ( window - > initial_workspace = = ( int ) 0xFFFFFFFF )
2001-10-24 21:39:36 -04:00
{
2002-03-03 23:54:46 -05:00
meta_topic ( META_DEBUG_PLACEMENT ,
" Window %s is initially on all spaces \n " ,
window - > desc ) ;
2008-12-18 07:41:56 -05:00
2003-12-14 14:19:40 -05:00
/* need to set on_all_workspaces first so that it will be
* added to all the MRU lists
*/
2011-02-28 05:41:23 -05:00
window - > on_all_workspaces_requested = TRUE ;
2003-12-13 18:00:06 -05:00
window - > on_all_workspaces = TRUE ;
2003-12-14 14:19:40 -05:00
meta_workspace_add_window ( window - > screen - > active_workspace , window ) ;
2001-10-24 21:39:36 -04:00
}
else
{
2002-03-03 23:54:46 -05:00
meta_topic ( META_DEBUG_PLACEMENT ,
" Window %s is initially on space %d \n " ,
window - > desc , window - > initial_workspace ) ;
2001-10-24 21:39:36 -04:00
space =
2002-10-16 16:12:24 -04:00
meta_screen_get_workspace_by_index ( window - > screen ,
window - > initial_workspace ) ;
2008-12-18 07:41:56 -05:00
2001-10-24 21:39:36 -04:00
if ( space )
meta_workspace_add_window ( space , window ) ;
}
2001-06-24 02:47:54 -04:00
}
2008-12-18 07:41:56 -05:00
2009-06-15 18:02:32 -04:00
/* override-redirect windows are subtly different from other windows
* with window - > on_all_workspaces = = TRUE . Other windows are part of
* some workspace ( so they can return to that if the flag is turned off ) ,
* but appear on other workspaces . override - redirect windows are part
* of no workspace .
*/
if ( ! window - > override_redirect )
2001-06-24 02:47:54 -04:00
{
2009-06-15 18:02:32 -04:00
if ( window - > workspace = = NULL & &
window - > xtransient_for ! = None )
{
/* Try putting dialog on parent's workspace */
MetaWindow * parent ;
2001-06-24 02:47:54 -04:00
2009-06-15 18:02:32 -04:00
parent = meta_display_lookup_x_window ( window - > display ,
window - > xtransient_for ) ;
2001-06-24 02:47:54 -04:00
2009-06-15 18:02:32 -04:00
if ( parent & & parent - > workspace )
{
meta_topic ( META_DEBUG_PLACEMENT ,
" Putting window %s on same workspace as parent %s \n " ,
window - > desc , parent - > desc ) ;
2008-12-18 07:41:56 -05:00
2011-02-28 05:41:23 -05:00
if ( parent - > on_all_workspaces_requested )
{
window - > on_all_workspaces_requested = TRUE ;
window - > on_all_workspaces = TRUE ;
}
2008-12-18 07:41:56 -05:00
2009-06-15 18:02:32 -04:00
/* this will implicitly add to the appropriate MRU lists
*/
meta_workspace_add_window ( parent - > workspace , window ) ;
}
2001-06-24 02:47:54 -04:00
}
2008-12-18 07:41:56 -05:00
2009-06-15 18:02:32 -04:00
if ( window - > workspace = = NULL )
{
meta_topic ( META_DEBUG_PLACEMENT ,
" Putting window %s on active workspace \n " ,
window - > desc ) ;
2008-12-18 07:41:56 -05:00
2009-06-15 18:02:32 -04:00
space = window - > screen - > active_workspace ;
2001-06-24 02:47:54 -04:00
2009-06-15 18:02:32 -04:00
meta_workspace_add_window ( space , window ) ;
}
2008-12-18 07:41:56 -05:00
2009-06-15 18:02:32 -04:00
/* for the various on_all_workspaces = TRUE possible above */
2009-06-14 08:37:57 -04:00
meta_window_set_current_workspace_hint ( window ) ;
2008-12-18 07:41:56 -05:00
2009-06-14 08:37:57 -04:00
meta_window_update_struts ( window ) ;
}
2002-08-01 19:52:47 -04:00
2011-02-28 15:26:11 -05:00
g_signal_emit_by_name ( window - > screen , " window-entered-monitor " , window - > monitor - > number , window ) ;
Fix several bugs with handling of fullscreen windows, causing them to not
2006-08-21 Elijah Newren <newren gmail com>
Fix several bugs with handling of fullscreen windows, causing them
to not actually be fullscreen. #343115 (and also #346927,
#350547, #351643, the recent additional WINE-related issue
mentioned on the mailing list, and probably others...)
* src/constraints.c (setup_constraint_info): if a window tries to
resize to fullscreen-size and it has a fullscreen function but
isn't actually marked as fullscreen then assist it by marking it
as such, (constrain_fully_onscreen, constrain_titlebar_visible):
ignore this constraint for fullscreen windows since such windows
have a separate specialized constraint
* src/stack.c (window_is_fullscreen_size, get_standalone_layer):
remove the old window_is_fullscreen_size() hack for detecting
windows to treat as fullscreen since it doesn't work well with the
new constraints framework (i.e. we needed a slightly different
hack)
* src/window.[ch] (meta_window_new_with_addrs): shuffle the order
of adding the window to the stack and moveresizing the window
since moveresizing can cause stack changes if the window's initial
size is fullscreen size, (meta_window_make_fullscreen,
meta_window_make_fullscreen_internal): split
meta_window_make_fullscreen() similar to meta_window_maximize() so
that constraints can make use of it
2006-08-21 14:08:05 -04:00
/* Must add window to stack before doing move/resize, since the
* window might have fullscreen size ( i . e . should have been
* fullscreen ' d ; acrobat is one such braindead case ; it withdraws
* and remaps its window whenever trying to become fullscreen . . . )
* and thus constraints may try to auto - fullscreen it which also
* means restacking it .
*/
2009-06-15 14:31:04 -04:00
if ( ! window - > override_redirect )
meta_stack_add ( window - > screen - > stack ,
window ) ;
else
window - > layer = META_LAYER_OVERRIDE_REDIRECT ; /* otherwise set by MetaStack */
Fix several bugs with handling of fullscreen windows, causing them to not
2006-08-21 Elijah Newren <newren gmail com>
Fix several bugs with handling of fullscreen windows, causing them
to not actually be fullscreen. #343115 (and also #346927,
#350547, #351643, the recent additional WINE-related issue
mentioned on the mailing list, and probably others...)
* src/constraints.c (setup_constraint_info): if a window tries to
resize to fullscreen-size and it has a fullscreen function but
isn't actually marked as fullscreen then assist it by marking it
as such, (constrain_fully_onscreen, constrain_titlebar_visible):
ignore this constraint for fullscreen windows since such windows
have a separate specialized constraint
* src/stack.c (window_is_fullscreen_size, get_standalone_layer):
remove the old window_is_fullscreen_size() hack for detecting
windows to treat as fullscreen since it doesn't work well with the
new constraints framework (i.e. we needed a slightly different
hack)
* src/window.[ch] (meta_window_new_with_addrs): shuffle the order
of adding the window to the stack and moveresizing the window
since moveresizing can cause stack changes if the window's initial
size is fullscreen size, (meta_window_make_fullscreen,
meta_window_make_fullscreen_internal): split
meta_window_make_fullscreen() similar to meta_window_maximize() so
that constraints can make use of it
2006-08-21 14:08:05 -04:00
2001-06-09 17:58:30 -04:00
/* Put our state back where it should be,
* passing TRUE for is_configure_request , ICCCM says
* initial map is handled same as configure request
*/
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
2006-01-02 Elijah Newren <newren@gmail.com>
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
* src/boxes.c (meta_rectangle_region_to_string,
meta_rectangle_edge_list_to_string, fix_up_edges):
* src/constraints.c (meta_window_constrain, setup_constraint_info,
place_window_if_needed, constrain_maximization,
constrain_fullscreen, constrain_size_increments,
constrain_size_limits, constrain_aspect_ratio,
do_screen_and_xinerama_relative_constrai,
constrain_to_single_xinerama, constrain_fully_onscreen,
constrain_partially_onscreen):
* src/edge-resistance.c (find_nearest_position,
apply_edge_resistance, apply_edge_resistance_to_each_side):
* src/testboxes.c (test_clamping_to_region,
test_clipping_to_region, test_shoving_into_region):
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_resize,
meta_window_resize_with_gravity, meta_window_configure_request):
Remove C99 style variable initiailization
2006-01-02 13:37:46 -05:00
flags =
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
META_IS_CONFIGURE_REQUEST | META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION ;
2009-06-15 18:25:07 -04:00
if ( ! window - > override_redirect )
meta_window_move_resize_internal ( window ,
flags ,
window - > size_hints . win_gravity ,
window - > size_hints . x ,
window - > size_hints . y ,
window - > size_hints . width ,
window - > size_hints . height ) ;
2001-06-09 17:58:30 -04:00
2001-07-27 00:36:44 -04:00
/* Now try applying saved stuff from the session */
{
const MetaWindowSessionInfo * info ;
info = meta_window_lookup_saved_state ( window ) ;
if ( info )
{
meta_window_apply_session_info ( window , info ) ;
meta_window_release_saved_state ( info ) ;
}
}
2008-12-18 07:41:56 -05:00
2008-11-23 14:28:40 -05:00
if ( ! window - > override_redirect )
{
/* FIXME we have a tendency to set this then immediately
* change it again .
*/
set_wm_state ( window , window - > iconic ? IconicState : NormalState ) ;
set_net_wm_state ( window ) ;
}
2005-01-25 21:47:49 -05:00
2009-03-18 15:09:15 -04:00
if ( screen - > display - > compositor )
meta_compositor_add_window ( screen - > display - > compositor , window ) ;
2001-06-10 23:24:20 -04:00
/* Sync stack changes */
meta_stack_thaw ( window - > screen - > stack ) ;
2002-05-11 01:47:04 -04:00
2009-06-14 08:04:28 -04:00
/* Usually the we'll have queued a stack sync anyways, because we've
* added a new frame window or restacked . But if an undecorated
* window is mapped , already stacked in the right place , then we
* might need to do this explicitly .
*/
meta_stack_tracker_queue_sync_stack ( window - > screen - > stack_tracker ) ;
2002-05-11 01:47:04 -04:00
/* disable show desktop mode unless we're a desktop component */
2003-05-16 17:59:08 -04:00
maybe_leave_show_desktop_mode ( window ) ;
2008-12-18 07:41:56 -05:00
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_queue ( window , META_QUEUE_CALC_SHOWING ) ;
2005-05-26 13:15:56 -04:00
/* See bug 303284; a transient of the given window can already exist, in which
* case we think it should probably be shown .
*/
meta_window_foreach_transient ( window ,
queue_calc_showing_func ,
NULL ) ;
2006-10-01 17:59:09 -04:00
/* See bug 334899; the window may have minimized ancestors
* which need to be shown .
*
* However , we shouldn ' t unminimize windows here when opening
* a new display because that breaks passing _NET_WM_STATE_HIDDEN
* between window managers when replacing them ; see bug 358042.
2008-03-28 14:44:59 -04:00
*
* And we shouldn ' t unminimize windows if they were initially
* iconic .
2006-04-16 23:54:49 -04:00
*/
2009-06-14 08:11:29 -04:00
if ( ! window - > override_redirect & &
! display - > display_opening & &
! window - > initially_iconic )
2006-10-01 17:59:09 -04:00
unminimize_window_and_all_transient_parents ( window ) ;
2002-10-21 17:44:35 -04:00
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( display ) ; /* pop the XSync()-reducing trap */
2001-06-10 23:24:20 -04:00
meta_display_ungrab ( display ) ;
2008-12-18 07:41:56 -05:00
deleted and moved into window-props.c (meta_window_new_with_attrs): added
2006-03-25 Thomas Thurman <thomas@thurman.org.uk>
* src/window.c, src/window.h (update_net_wm_state,
update_mwm_hints, update_wm_class, update_transient_for):
deleted and moved into window-props.c
(meta_window_new_with_attrs): added constructing field
and four new initial properties (as above)
(meta_window_recalc_features,
meta_window_recalc_window_type): new functions
* src/window-props.c (init_net_wm_state, reload_net_wm_state
init_mwm_hints, reload_mwm_hints, init_wm_class,
reload_mwm_class, init_transient_for, reload_transient_for):
new functions, moved in from window.c
(meta_display_init_window_prop_hooks): initialise new properties
2006-03-25 17:57:22 -05:00
window - > constructing = FALSE ;
2009-10-13 10:34:34 -04:00
meta_display_notify_window_created ( display , window ) ;
2009-10-28 13:19:24 -04:00
if ( window - > wm_state_demands_attention )
g_signal_emit_by_name ( window - > display , " window-demands-attention " , window ) ;
2009-11-17 05:24:18 -05:00
if ( window - > wm_hints_urgent )
g_signal_emit_by_name ( window - > display , " window-marked-urgent " , window ) ;
2001-05-30 11:36:31 -04:00
return window ;
}
2003-11-20 21:32:05 -05:00
/* This function should only be called from the end of meta_window_new_with_attrs () */
2001-07-27 00:36:44 -04:00
static void
meta_window_apply_session_info ( MetaWindow * window ,
const MetaWindowSessionInfo * info )
{
2002-06-22 20:21:20 -04:00
if ( info - > stack_position_set )
{
meta_topic ( META_DEBUG_SM ,
" Restoring stack position %d for window %s \n " ,
info - > stack_position , window - > desc ) ;
/* FIXME well, I'm not sure how to do this. */
}
if ( info - > minimized_set )
{
meta_topic ( META_DEBUG_SM ,
" Restoring minimized state %d for window %s \n " ,
info - > minimized , window - > desc ) ;
if ( window - > has_minimize_func & & info - > minimized )
meta_window_minimize ( window ) ;
}
if ( info - > maximized_set )
{
meta_topic ( META_DEBUG_SM ,
" Restoring maximized state %d for window %s \n " ,
info - > maximized , window - > desc ) ;
2008-12-18 07:41:56 -05:00
2002-06-22 20:21:20 -04:00
if ( window - > has_maximize_func & & info - > maximized )
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
{
2008-12-18 07:41:56 -05:00
meta_window_maximize ( window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
META_MAXIMIZE_HORIZONTAL |
META_MAXIMIZE_VERTICAL ) ;
2002-09-03 22:44:52 -04:00
if ( info - > saved_rect_set )
{
meta_topic ( META_DEBUG_SM ,
" Restoring saved rect %d,%d %dx%d for window %s \n " ,
info - > saved_rect . x ,
info - > saved_rect . y ,
info - > saved_rect . width ,
info - > saved_rect . height ,
window - > desc ) ;
2008-12-18 07:41:56 -05:00
2002-09-03 22:44:52 -04:00
window - > saved_rect . x = info - > saved_rect . x ;
window - > saved_rect . y = info - > saved_rect . y ;
window - > saved_rect . width = info - > saved_rect . width ;
window - > saved_rect . height = info - > saved_rect . height ;
}
}
2002-06-22 20:21:20 -04:00
}
2008-12-18 07:41:56 -05:00
2001-07-27 00:36:44 -04:00
if ( info - > on_all_workspaces_set )
{
2011-02-28 05:41:23 -05:00
window - > on_all_workspaces_requested = info - > on_all_workspaces ;
meta_window_update_on_all_workspaces ( window ) ;
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_SM ,
" Restoring sticky state %d for window %s \n " ,
2011-02-28 05:41:23 -05:00
window - > on_all_workspaces_requested , window - > desc ) ;
2001-07-27 00:36:44 -04:00
}
2008-12-18 07:41:56 -05:00
2001-07-27 00:36:44 -04:00
if ( info - > workspace_indices )
{
GSList * tmp ;
2008-12-18 07:41:56 -05:00
GSList * spaces ;
2001-07-27 00:36:44 -04:00
spaces = NULL ;
2008-12-18 07:41:56 -05:00
2001-07-27 00:36:44 -04:00
tmp = info - > workspace_indices ;
while ( tmp ! = NULL )
{
2008-12-18 07:41:56 -05:00
MetaWorkspace * space ;
2001-07-27 00:36:44 -04:00
space =
2002-10-16 16:12:24 -04:00
meta_screen_get_workspace_by_index ( window - > screen ,
GPOINTER_TO_INT ( tmp - > data ) ) ;
2008-12-18 07:41:56 -05:00
2001-07-27 00:36:44 -04:00
if ( space )
spaces = g_slist_prepend ( spaces , space ) ;
2008-12-18 07:41:56 -05:00
2001-07-27 00:36:44 -04:00
tmp = tmp - > next ;
}
if ( spaces )
{
/* This briefly breaks the invariant that we are supposed
* to always be on some workspace . But we paranoically
* ensured that one of the workspaces from the session was
* indeed valid , so we know we ' ll go right back to one .
*/
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
if ( window - > workspace )
meta_workspace_remove_window ( window - > workspace , window ) ;
2001-07-27 00:36:44 -04:00
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
/* Only restore to the first workspace if the window
* happened to be on more than one , since we have replaces
* window - > workspaces with window - > workspace
*/
2008-12-18 07:41:56 -05:00
meta_workspace_add_window ( spaces - > data , window ) ;
2001-07-27 00:36:44 -04:00
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
meta_topic ( META_DEBUG_SM ,
" Restoring saved window %s to workspace %d \n " ,
window - > desc ,
meta_workspace_index ( spaces - > data ) ) ;
2008-12-18 07:41:56 -05:00
2001-07-27 00:36:44 -04:00
g_slist_free ( spaces ) ;
}
}
2001-07-28 02:35:19 -04:00
if ( info - > geometry_set )
{
int x , y , w , h ;
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
2006-01-02 Elijah Newren <newren@gmail.com>
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
* src/boxes.c (meta_rectangle_region_to_string,
meta_rectangle_edge_list_to_string, fix_up_edges):
* src/constraints.c (meta_window_constrain, setup_constraint_info,
place_window_if_needed, constrain_maximization,
constrain_fullscreen, constrain_size_increments,
constrain_size_limits, constrain_aspect_ratio,
do_screen_and_xinerama_relative_constrai,
constrain_to_single_xinerama, constrain_fully_onscreen,
constrain_partially_onscreen):
* src/edge-resistance.c (find_nearest_position,
apply_edge_resistance, apply_edge_resistance_to_each_side):
* src/testboxes.c (test_clamping_to_region,
test_clipping_to_region, test_shoving_into_region):
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_resize,
meta_window_resize_with_gravity, meta_window_configure_request):
Remove C99 style variable initiailization
2006-01-02 13:37:46 -05:00
MetaMoveResizeFlags flags ;
2008-12-18 07:41:56 -05:00
2001-07-28 02:35:19 -04:00
window - > placed = TRUE ; /* don't do placement algorithms later */
x = info - > rect . x ;
y = info - > rect . y ;
w = window - > size_hints . base_width +
info - > rect . width * window - > size_hints . width_inc ;
h = window - > size_hints . base_height +
info - > rect . height * window - > size_hints . height_inc ;
/* Force old gravity, ignoring anything now set */
window - > size_hints . win_gravity = info - > gravity ;
2008-12-18 07:41:56 -05:00
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_SM ,
" Restoring pos %d,%d size %d x %d for %s \n " ,
x , y , w , h , window - > desc ) ;
2008-12-18 07:41:56 -05:00
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
2006-01-02 Elijah Newren <newren@gmail.com>
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
* src/boxes.c (meta_rectangle_region_to_string,
meta_rectangle_edge_list_to_string, fix_up_edges):
* src/constraints.c (meta_window_constrain, setup_constraint_info,
place_window_if_needed, constrain_maximization,
constrain_fullscreen, constrain_size_increments,
constrain_size_limits, constrain_aspect_ratio,
do_screen_and_xinerama_relative_constrai,
constrain_to_single_xinerama, constrain_fully_onscreen,
constrain_partially_onscreen):
* src/edge-resistance.c (find_nearest_position,
apply_edge_resistance, apply_edge_resistance_to_each_side):
* src/testboxes.c (test_clamping_to_region,
test_clipping_to_region, test_shoving_into_region):
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_resize,
meta_window_resize_with_gravity, meta_window_configure_request):
Remove C99 style variable initiailization
2006-01-02 13:37:46 -05:00
flags = META_DO_GRAVITY_ADJUST | META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION ;
2001-07-28 02:35:19 -04:00
meta_window_move_resize_internal ( window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
flags ,
window - > size_hints . win_gravity ,
2001-07-28 02:35:19 -04:00
x , y , w , h ) ;
}
2001-07-27 00:36:44 -04:00
}
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
static gboolean
detach_foreach_func ( MetaWindow * window ,
void * data )
{
GList * * children = data ;
MetaWindow * parent ;
if ( window - > attached )
{
/* Only return the immediate children of the window being unmanaged */
parent = meta_window_get_transient_for ( window ) ;
if ( parent - > unmanaging )
* children = g_list_prepend ( * children , window ) ;
}
return TRUE ;
}
2001-05-30 11:36:31 -04:00
void
2008-11-07 04:57:00 -05:00
meta_window_unmanage ( MetaWindow * window ,
guint32 timestamp )
2001-05-30 11:36:31 -04:00
{
2001-06-06 00:47:37 -04:00
GList * tmp ;
2008-12-18 07:41:56 -05:00
2001-05-31 02:42:58 -04:00
meta_verbose ( " Unmanaging 0x%lx \n " , window - > xwindow ) ;
2001-06-06 00:47:37 -04:00
2006-03-14 12:00:56 -05:00
if ( window - > display - > compositor )
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
{
if ( window - > visible_to_compositor )
meta_compositor_hide_window ( window - > display - > compositor , window ,
META_COMP_EFFECT_DESTROY ) ;
meta_compositor_remove_window ( window - > display - > compositor , window ) ;
}
2008-12-18 07:41:56 -05:00
2002-10-28 00:35:30 -05:00
if ( window - > display - > window_with_menu = = window )
{
meta_ui_window_menu_free ( window - > display - > window_menu ) ;
window - > display - > window_menu = NULL ;
window - > display - > window_with_menu = NULL ;
}
2008-12-18 07:41:56 -05:00
2002-01-18 22:50:03 -05:00
if ( destroying_windows_disallowed > 0 )
meta_bug ( " Tried to destroy window %s while destruction was not allowed \n " ,
window - > desc ) ;
2008-12-18 07:41:56 -05:00
2001-06-21 23:20:21 -04:00
window - > unmanaging = TRUE ;
2002-08-25 16:59:09 -04:00
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
if ( meta_prefs_get_attach_modal_dialogs ( ) )
{
GList * attached_children = NULL , * iter ;
/* Detach any attached dialogs by unmapping and letting them
* be remapped after @ window is destroyed .
*/
meta_window_foreach_transient ( window ,
detach_foreach_func ,
& attached_children ) ;
for ( iter = attached_children ; iter ; iter = iter - > next )
meta_window_unmanage ( iter - > data , timestamp ) ;
g_list_free ( attached_children ) ;
}
2002-08-25 16:59:09 -04:00
if ( window - > fullscreen )
{
MetaGroup * group ;
/* If the window is fullscreen, it may be forcing
* other windows in its group to a higher layer
*/
meta_stack_freeze ( window - > screen - > stack ) ;
group = meta_window_get_group ( window ) ;
if ( group )
meta_group_update_layers ( group ) ;
meta_stack_thaw ( window - > screen - > stack ) ;
}
2002-10-27 09:45:29 -05:00
meta_window_shutdown_group ( window ) ; /* safe to do this early as
* group . c won ' t re - add to the
* group if window - > unmanaging
*/
2008-12-18 07:41:56 -05:00
2002-01-03 18:28:19 -05:00
/* If we have the focus, focus some other window.
* This is done first , so that if the unmap causes
* an EnterNotify the EnterNotify will have final say
* on what gets focused , maintaining sloppy focus
* invariants .
*/
2011-04-13 17:08:12 -04:00
if ( meta_window_appears_focused ( window ) )
meta_window_propagate_focus_appearance ( window , FALSE ) ;
2002-01-03 18:28:19 -05:00
if ( window - > has_focus )
{
meta_topic ( META_DEBUG_FOCUS ,
2004-06-24 16:02:46 -04:00
" Focusing default window since we're unmanaging %s \n " ,
2002-01-03 18:28:19 -05:00
window - > desc ) ;
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_workspace_focus_default_window ( window - > screen - > active_workspace ,
window ,
timestamp ) ;
2002-01-03 18:28:19 -05:00
}
2002-08-08 00:45:13 -04:00
else if ( window - > display - > expected_focus_window = = window )
{
meta_topic ( META_DEBUG_FOCUS ,
2004-06-24 16:02:46 -04:00
" Focusing default window since expected focus window freed %s \n " ,
2002-08-08 00:45:13 -04:00
window - > desc ) ;
window - > display - > expected_focus_window = NULL ;
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_workspace_focus_default_window ( window - > screen - > active_workspace ,
window ,
timestamp ) ;
2002-08-08 00:45:13 -04:00
}
2002-01-03 18:28:19 -05:00
else
{
meta_topic ( META_DEBUG_FOCUS ,
" Unmanaging window %s which doesn't currently have focus \n " ,
window - > desc ) ;
}
2002-01-10 22:31:14 -05:00
2003-06-25 23:09:38 -04:00
if ( window - > struts )
2002-02-07 22:34:26 -05:00
{
2007-04-07 17:42:05 -04:00
meta_free_gslist_and_elements ( window - > struts ) ;
2003-06-25 23:09:38 -04:00
window - > struts = NULL ;
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_WORKAREA ,
" Unmanaging window %s which has struts, so invalidating work areas \n " ,
window - > desc ) ;
invalidate_work_areas ( window ) ;
}
2008-12-18 07:41:56 -05:00
2001-07-11 02:22:00 -04:00
if ( window - > display - > grab_window = = window )
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_display_end_grab_op ( window - > display , timestamp ) ;
2002-03-06 17:27:24 -05:00
g_assert ( window - > display - > grab_window ! = window ) ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
if ( window - > display - > focus_window = = window )
2009-07-30 17:33:11 -04:00
{
window - > display - > focus_window = NULL ;
2009-08-01 06:11:11 -04:00
g_object_notify ( G_OBJECT ( window - > display ) , " focus-window " ) ;
2009-07-30 17:33:11 -04:00
}
2001-06-23 23:18:10 -04:00
2006-03-06 11:33:33 -05:00
if ( window - > maximized_horizontally | | window - > maximized_vertically )
unmaximize_window_before_freeing ( window ) ;
2007-04-12 00:02:57 -04:00
/* The XReparentWindow call in meta_window_destroy_frame() moves the
* window so we need to send a configure notify ; see bug 399552. ( We
* also do this just in case a window got unmaximized . )
*/
send_configure_notify ( window ) ;
2008-12-18 07:41:56 -05:00
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_unqueue ( window , META_QUEUE_CALC_SHOWING |
META_QUEUE_MOVE_RESIZE |
META_QUEUE_UPDATE_ICON ) ;
2002-04-13 00:58:45 -04:00
meta_window_free_delete_dialog ( window ) ;
2008-12-18 07:41:56 -05:00
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
if ( window - > workspace )
meta_workspace_remove_window ( window - > workspace , window ) ;
2001-06-06 00:47:37 -04:00
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
g_assert ( window - > workspace = = NULL ) ;
2001-06-07 01:18:10 -04:00
2003-12-12 22:58:55 -05:00
# ifndef G_DISABLE_CHECKS
tmp = window - > screen - > workspaces ;
while ( tmp ! = NULL )
{
MetaWorkspace * workspace = tmp - > data ;
g_assert ( g_list_find ( workspace - > windows , window ) = = NULL ) ;
g_assert ( g_list_find ( workspace - > mru_list , window ) = = NULL ) ;
tmp = tmp - > next ;
}
# endif
2008-12-18 07:41:56 -05:00
2011-02-28 15:26:11 -05:00
if ( window - > monitor )
{
g_signal_emit_by_name ( window - > screen , " window-left-monitor " ,
window - > monitor - > number , window ) ;
window - > monitor = NULL ;
}
2009-06-15 14:31:04 -04:00
if ( ! window - > override_redirect )
meta_stack_remove ( window - > screen - > stack , window ) ;
2008-12-18 07:41:56 -05:00
2002-08-10 13:32:29 -04:00
if ( window - > frame )
meta_window_destroy_frame ( window ) ;
2008-12-18 07:41:56 -05:00
2009-06-14 08:04:28 -04:00
/* If an undecorated window is being withdrawn, that will change the
* stack as presented to the compositing manager , without actually
* changing the stacking order of X windows .
*/
meta_stack_tracker_queue_sync_stack ( window - > screen - > stack_tracker ) ;
2001-06-23 14:30:27 -04:00
if ( window - > withdrawn )
2002-03-10 10:48:38 -05:00
{
/* We need to clean off the window's state so it
* won ' t be restored if the app maps it again .
*/
meta_error_trap_push ( window - > display ) ;
meta_verbose ( " Cleaning state from window %s \n " , window - > desc ) ;
XDeleteProperty ( window - > display - > xdisplay ,
window - > xwindow ,
2008-05-02 14:49:01 -04:00
window - > display - > atom__NET_WM_DESKTOP ) ;
2002-03-10 10:48:38 -05:00
XDeleteProperty ( window - > display - > xdisplay ,
window - > xwindow ,
2008-05-02 14:49:01 -04:00
window - > display - > atom__NET_WM_STATE ) ;
2008-11-16 21:57:20 -05:00
XDeleteProperty ( window - > display - > xdisplay ,
window - > xwindow ,
window - > display - > atom__NET_WM_FULLSCREEN_MONITORS ) ;
2002-03-10 10:48:38 -05:00
set_wm_state ( window , WithdrawnState ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2002-03-10 10:48:38 -05:00
}
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
else
{
/* We need to put WM_STATE so that others will understand it on
* restart .
*/
if ( ! window - > minimized )
{
meta_error_trap_push ( window - > display ) ;
set_wm_state ( window , NormalState ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
}
2002-08-10 13:32:29 -04:00
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
/* If we're unmanaging a window that is not withdrawn, then
* either ( a ) mutter is exiting , in which case we need to map
* the window so the next WM will know that it ' s not Withdrawn ,
* or ( b ) we want to create a new MetaWindow to replace the
* current one , which will happen automatically if we re - map
* the X Window .
2002-08-10 13:32:29 -04:00
*/
meta_error_trap_push ( window - > display ) ;
XMapWindow ( window - > display - > xdisplay ,
window - > xwindow ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
}
2001-05-31 23:00:01 -04:00
2001-06-23 01:49:35 -04:00
meta_window_ungrab_keys ( window ) ;
2001-07-25 22:55:35 -04:00
meta_display_ungrab_window_buttons ( window - > display , window - > xwindow ) ;
2003-10-13 16:15:40 -04:00
meta_display_ungrab_focus_window_button ( window - > display , window ) ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
meta_display_unregister_x_window ( window - > display , window - > xwindow ) ;
2008-12-18 07:41:56 -05:00
2002-03-27 22:49:18 -05:00
2001-06-04 02:17:52 -04:00
meta_error_trap_push ( window - > display ) ;
2002-03-27 22:49:18 -05:00
/* Put back anything we messed up */
2001-06-04 02:17:52 -04:00
if ( window - > border_width ! = 0 )
XSetWindowBorderWidth ( window - > display - > xdisplay ,
window - > xwindow ,
window - > border_width ) ;
2002-03-27 22:49:18 -05:00
/* No save set */
XRemoveFromSaveSet ( window - > display - > xdisplay ,
window - > xwindow ) ;
2010-07-14 16:08:16 -04:00
/* Even though the window is now unmanaged, we can't unselect events. This
* window might be a window from this process , like a GdkMenu , in
* which case it will have pointer events and so forth selected
* for it by GDK . There ' s no way to disentangle those events from the events
* we ' ve selected . Even for a window from a different X client ,
* GDK could also have selected events for it for IPC purposes , so we
* can ' t unselect in that case either .
*
* Similarly , we can ' t unselected for events on window - > user_time_window .
* It might be our own GDK focus window , or it might be a window that a
* different client is using for multiple different things :
* _NET_WM_USER_TIME_WINDOW and IPC , perhaps .
*/
2003-01-05 02:51:02 -05:00
2007-03-31 01:19:41 -04:00
if ( window - > user_time_window ! = None )
{
meta_display_unregister_x_window ( window - > display ,
window - > user_time_window ) ;
window - > user_time_window = None ;
}
2003-01-05 02:51:02 -05:00
# ifdef HAVE_SHAPE
if ( META_DISPLAY_HAS_SHAPE ( window - > display ) )
XShapeSelectInput ( window - > display - > xdisplay , window - > xwindow , NoEventMask ) ;
# endif
2001-09-15 20:30:45 -04:00
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2002-02-09 18:03:52 -05:00
2012-02-29 16:31:30 -05:00
meta_prefs_remove_listener ( prefs_changed_callback , window ) ;
2009-10-13 10:34:34 -04:00
g_signal_emit ( window , window_signals [ UNMANAGED ] , 0 ) ;
2008-11-07 04:57:00 -05:00
g_object_unref ( window ) ;
2001-05-30 11:36:31 -04:00
}
2011-02-28 05:41:23 -05:00
static gboolean
should_be_on_all_workspaces ( MetaWindow * window )
{
return
window - > on_all_workspaces_requested | |
2011-02-28 07:48:28 -05:00
window - > override_redirect | |
( meta_prefs_get_workspaces_only_on_primary ( ) & &
! meta_window_is_on_primary_monitor ( window ) ) ;
2011-02-28 05:41:23 -05:00
}
void
meta_window_update_on_all_workspaces ( MetaWindow * window )
{
gboolean old_value ;
old_value = window - > on_all_workspaces ;
window - > on_all_workspaces = should_be_on_all_workspaces ( window ) ;
if ( window - > on_all_workspaces ! = old_value & &
! window - > override_redirect )
{
if ( window - > on_all_workspaces )
{
GList * tmp = window - > screen - > workspaces ;
/* Add to all MRU lists */
while ( tmp )
{
MetaWorkspace * work = ( MetaWorkspace * ) tmp - > data ;
if ( ! g_list_find ( work - > mru_list , window ) )
work - > mru_list = g_list_prepend ( work - > mru_list , window ) ;
tmp = tmp - > next ;
}
}
else
{
GList * tmp = window - > screen - > workspaces ;
/* Remove from MRU lists except the window's workspace */
while ( tmp )
{
MetaWorkspace * work = ( MetaWorkspace * ) tmp - > data ;
if ( work ! = window - > workspace )
work - > mru_list = g_list_remove ( work - > mru_list , window ) ;
tmp = tmp - > next ;
}
}
meta_window_set_current_workspace_hint ( window ) ;
}
}
2002-10-21 17:44:35 -04:00
static void
2011-03-08 17:15:56 -05:00
set_wm_state_on_xwindow ( MetaDisplay * display ,
Window xwindow ,
int state )
2001-06-06 00:47:37 -04:00
{
2001-06-10 23:24:20 -04:00
unsigned long data [ 2 ] ;
2008-12-18 07:41:56 -05:00
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
/* Mutter doesn't use icon windows, so data[1] should be None
2003-02-22 23:56:11 -05:00
* according to the ICCCM 2.0 Section 4.1 .3 .1 .
2001-06-06 00:47:37 -04:00
*/
data [ 0 ] = state ;
2001-06-10 23:24:20 -04:00
data [ 1 ] = None ;
2001-06-06 00:47:37 -04:00
2011-03-08 17:15:56 -05:00
meta_error_trap_push ( display ) ;
XChangeProperty ( display - > xdisplay , xwindow ,
display - > atom_WM_STATE ,
display - > atom_WM_STATE ,
2001-06-10 23:24:20 -04:00
32 , PropModeReplace , ( guchar * ) data , 2 ) ;
2011-03-08 17:15:56 -05:00
meta_error_trap_pop ( display ) ;
}
static void
set_wm_state ( MetaWindow * window ,
int state )
{
meta_verbose ( " Setting wm state %s on %s \n " ,
wm_state_to_string ( state ) , window - > desc ) ;
set_wm_state_on_xwindow ( window - > display , window - > xwindow , state ) ;
2001-06-10 23:24:20 -04:00
}
2002-10-21 17:44:35 -04:00
static void
2001-06-10 23:24:20 -04:00
set_net_wm_state ( MetaWindow * window )
{
int i ;
2011-10-26 14:00:18 -04:00
unsigned long data [ 13 ] ;
2008-12-18 07:41:56 -05:00
2001-06-10 23:24:20 -04:00
i = 0 ;
if ( window - > shaded )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_STATE_SHADED ;
2001-06-10 23:24:20 -04:00
+ + i ;
}
if ( window - > wm_state_modal )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_STATE_MODAL ;
2001-06-10 23:24:20 -04:00
+ + i ;
}
2002-11-19 23:37:55 -05:00
if ( window - > skip_pager )
2001-06-11 01:47:51 -04:00
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_STATE_SKIP_PAGER ;
2001-06-11 01:47:51 -04:00
+ + i ;
}
2002-11-19 23:37:55 -05:00
if ( window - > skip_taskbar )
2001-06-11 01:47:51 -04:00
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_STATE_SKIP_TASKBAR ;
2001-06-11 01:47:51 -04:00
+ + i ;
}
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
if ( window - > maximized_horizontally )
2001-06-10 23:24:20 -04:00
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_STATE_MAXIMIZED_HORZ ;
2001-06-10 23:24:20 -04:00
+ + i ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
}
if ( window - > maximized_vertically )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_STATE_MAXIMIZED_VERT ;
2001-06-10 23:24:20 -04:00
+ + i ;
}
2002-02-23 17:58:02 -05:00
if ( window - > fullscreen )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_STATE_FULLSCREEN ;
2002-02-23 17:58:02 -05:00
+ + i ;
}
2005-01-28 09:48:47 -05:00
if ( ! meta_window_showing_on_its_workspace ( window ) | | window - > shaded )
2002-02-08 23:50:58 -05:00
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_STATE_HIDDEN ;
2002-02-08 23:50:58 -05:00
+ + i ;
}
2002-10-01 20:47:29 -04:00
if ( window - > wm_state_above )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_STATE_ABOVE ;
2002-10-01 20:47:29 -04:00
+ + i ;
}
if ( window - > wm_state_below )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_STATE_BELOW ;
2002-10-01 20:47:29 -04:00
+ + i ;
}
Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 15:56:10 -04:00
if ( window - > wm_state_demands_attention )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_STATE_DEMANDS_ATTENTION ;
Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 15:56:10 -04:00
+ + i ;
}
2011-02-28 05:41:23 -05:00
if ( window - > on_all_workspaces_requested )
2008-10-23 00:09:14 -04:00
{
data [ i ] = window - > display - > atom__NET_WM_STATE_STICKY ;
+ + i ;
}
2011-10-26 14:00:18 -04:00
if ( meta_window_appears_focused ( window ) )
{
data [ i ] = window - > display - > atom__NET_WM_STATE_FOCUSED ;
+ + i ;
}
Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 15:56:10 -04:00
2001-06-10 23:24:20 -04:00
meta_verbose ( " Setting _NET_WM_STATE with %d atoms \n " , i ) ;
2008-12-18 07:41:56 -05:00
2001-06-10 23:24:20 -04:00
meta_error_trap_push ( window - > display ) ;
XChangeProperty ( window - > display - > xdisplay , window - > xwindow ,
2008-05-02 14:49:01 -04:00
window - > display - > atom__NET_WM_STATE ,
2001-06-10 23:24:20 -04:00
XA_ATOM ,
32 , PropModeReplace , ( guchar * ) data , i ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2008-11-16 21:57:20 -05:00
if ( window - > fullscreen )
{
data [ 0 ] = window - > fullscreen_monitors [ 0 ] ;
data [ 1 ] = window - > fullscreen_monitors [ 1 ] ;
data [ 2 ] = window - > fullscreen_monitors [ 2 ] ;
data [ 3 ] = window - > fullscreen_monitors [ 3 ] ;
meta_verbose ( " Setting _NET_WM_FULLSCREEN_MONITORS \n " ) ;
meta_error_trap_push ( window - > display ) ;
XChangeProperty ( window - > display - > xdisplay ,
window - > xwindow ,
window - > display - > atom__NET_WM_FULLSCREEN_MONITORS ,
XA_CARDINAL , 32 , PropModeReplace ,
( guchar * ) data , 4 ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2008-11-16 21:57:20 -05:00
}
2001-06-06 00:47:37 -04:00
}
2001-10-25 00:51:25 -04:00
gboolean
2004-12-22 19:20:33 -05:00
meta_window_located_on_workspace ( MetaWindow * window ,
2001-10-25 00:51:25 -04:00
MetaWorkspace * workspace )
{
2002-06-19 22:29:19 -04:00
return ( window - > on_all_workspaces & & window - > screen = = workspace - > screen ) | |
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
( window - > workspace = = workspace ) ;
2001-10-25 00:51:25 -04:00
}
2003-03-17 01:36:39 -05:00
static gboolean
is_minimized_foreach ( MetaWindow * window ,
void * data )
{
gboolean * result = data ;
* result = window - > minimized ;
if ( * result )
return FALSE ; /* stop as soon as we find one */
else
return TRUE ;
}
static gboolean
ancestor_is_minimized ( MetaWindow * window )
{
gboolean is_minimized ;
is_minimized = FALSE ;
meta_window_foreach_ancestor ( window , is_minimized_foreach , & is_minimized ) ;
return is_minimized ;
}
2011-03-09 10:01:44 -05:00
/**
* meta_window_showing_on_its_workspace :
* @ window : A # MetaWindow
*
* Returns : % TRUE if window would be visible , if its workspace was current
*/
2005-01-28 09:48:47 -05:00
gboolean
meta_window_showing_on_its_workspace ( MetaWindow * window )
2001-06-06 00:47:37 -04:00
{
2004-10-22 16:28:36 -04:00
gboolean showing ;
2003-11-08 00:29:23 -05:00
gboolean is_desktop_or_dock ;
2004-10-22 16:28:36 -04:00
MetaWorkspace * workspace_of_window ;
2001-07-03 22:10:54 -04:00
2004-10-22 16:28:36 -04:00
showing = TRUE ;
2001-10-14 23:39:41 -04:00
2004-10-22 16:28:36 -04:00
/* 1. See if we're minimized */
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
if ( window - > minimized )
showing = FALSE ;
2008-12-18 07:41:56 -05:00
2004-10-22 16:28:36 -04:00
/* 2. See if we're in "show desktop" mode */
2003-11-08 00:29:23 -05:00
is_desktop_or_dock = FALSE ;
is_desktop_or_dock_foreach ( window ,
& is_desktop_or_dock ) ;
meta_window_foreach_ancestor ( window , is_desktop_or_dock_foreach ,
& is_desktop_or_dock ) ;
2004-10-22 16:28:36 -04:00
if ( window - > on_all_workspaces )
workspace_of_window = window - > screen - > active_workspace ;
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
else if ( window - > workspace )
workspace_of_window = window - > workspace ;
2004-10-22 16:28:36 -04:00
else /* This only seems to be needed for startup */
workspace_of_window = NULL ;
2008-12-18 07:41:56 -05:00
if ( showing & &
2004-10-22 16:28:36 -04:00
workspace_of_window & & workspace_of_window - > showing_desktop & &
2003-11-08 00:29:23 -05:00
! is_desktop_or_dock )
2001-10-14 23:39:41 -04:00
{
2004-10-22 16:28:36 -04:00
meta_verbose ( " We're showing the desktop on the workspace(s) that window %s is on \n " ,
2001-10-14 23:39:41 -04:00
window - > desc ) ;
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
showing = FALSE ;
2001-10-14 23:39:41 -04:00
}
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
2004-10-22 16:28:36 -04:00
/* 3. See if an ancestor is minimized (note that
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
* ancestor ' s " mapped " field may not be up to date
* since it ' s being computed in this same idle queue )
*/
2008-12-18 07:41:56 -05:00
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
if ( showing )
{
2003-03-17 01:36:39 -05:00
if ( ancestor_is_minimized ( window ) )
showing = FALSE ;
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
}
2002-11-03 15:30:45 -05:00
return showing ;
}
2004-12-19 21:53:08 -05:00
gboolean
meta_window_should_be_showing ( MetaWindow * window )
2004-10-22 16:28:36 -04:00
{
gboolean on_workspace ;
meta_verbose ( " Should be showing for window %s \n " , window - > desc ) ;
/* See if we're on the workspace */
2008-12-18 07:41:56 -05:00
on_workspace = meta_window_located_on_workspace ( window ,
2004-10-22 16:28:36 -04:00
window - > screen - > active_workspace ) ;
if ( ! on_workspace )
meta_verbose ( " Window %s is not on workspace %d \n " ,
window - > desc ,
meta_workspace_index ( window - > screen - > active_workspace ) ) ;
else
meta_verbose ( " Window %s is on the active workspace %d \n " ,
window - > desc ,
meta_workspace_index ( window - > screen - > active_workspace ) ) ;
if ( window - > on_all_workspaces )
meta_verbose ( " Window %s is on all workspaces \n " , window - > desc ) ;
2005-01-28 09:48:47 -05:00
return on_workspace & & meta_window_showing_on_its_workspace ( window ) ;
2004-10-22 16:28:36 -04:00
}
2002-11-03 15:30:45 -05:00
static void
implement_showing ( MetaWindow * window ,
gboolean showing )
{
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
/* Actually show/hide the window */
2002-11-03 18:42:21 -05:00
meta_verbose ( " Implement showing = %d for window %s \n " ,
showing , window - > desc ) ;
2008-12-18 07:41:56 -05:00
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
if ( ! showing )
2011-02-02 19:14:27 -05:00
{
/* When we manage a new window, we normally delay placing it
* until it is is first shown , but if we ' re previewing hidden
* windows we might want to know where they are on the screen ,
* so we should place the window even if we ' re hiding it rather
* than showing it .
*/
2012-02-29 22:15:12 -05:00
if ( ! window - > placed )
2011-02-02 19:14:27 -05:00
meta_window_force_placement ( window ) ;
meta_window_hide ( window ) ;
}
2001-06-06 00:47:37 -04:00
else
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
meta_window_show ( window ) ;
window - > pending_compositor_effect = META_COMP_EFFECT_NONE ;
2001-06-06 00:47:37 -04:00
}
2001-06-21 23:20:21 -04:00
2002-11-03 15:30:45 -05:00
void
meta_window_calc_showing ( MetaWindow * window )
{
2004-12-19 21:53:08 -05:00
implement_showing ( window , meta_window_should_be_showing ( window ) ) ;
2002-11-03 15:30:45 -05:00
}
2001-06-21 23:20:21 -04:00
2009-09-25 15:47:22 -04:00
static guint queue_later [ NUMBER_OF_QUEUES ] = { 0 , 0 , 0 } ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
static GSList * queue_pending [ NUMBER_OF_QUEUES ] = { NULL , NULL , NULL } ;
2001-06-21 23:20:21 -04:00
2001-06-24 04:09:10 -04:00
static int
stackcmp ( gconstpointer a , gconstpointer b )
{
MetaWindow * aw = ( gpointer ) a ;
MetaWindow * bw = ( gpointer ) b ;
if ( aw - > screen ! = bw - > screen )
return 0 ; /* don't care how they sort with respect to each other */
else
return meta_stack_windows_cmp ( aw - > screen - > stack ,
aw , bw ) ;
}
2001-06-21 23:20:21 -04:00
static gboolean
idle_calc_showing ( gpointer data )
{
GSList * tmp ;
2001-10-29 21:00:53 -05:00
GSList * copy ;
2002-11-03 15:30:45 -05:00
GSList * should_show ;
GSList * should_hide ;
GSList * unplaced ;
2003-05-30 16:24:00 -04:00
GSList * displays ;
2006-12-03 15:05:23 -05:00
MetaWindow * first_window ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
guint queue_index = GPOINTER_TO_INT ( data ) ;
2004-06-24 16:02:46 -04:00
2011-03-29 15:16:23 -04:00
g_return_val_if_fail ( queue_pending [ queue_index ] ! = NULL , FALSE ) ;
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_WINDOW_STATE ,
" Clearing the calc_showing queue \n " ) ;
2001-10-29 21:00:53 -05:00
/* Work with a copy, for reentrancy. The allowed reentrancy isn't
* complete ; destroying a window while we ' re in here would result in
* badness . But it ' s OK to queue / unqueue calc_showings .
*/
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
copy = g_slist_copy ( queue_pending [ queue_index ] ) ;
g_slist_free ( queue_pending [ queue_index ] ) ;
queue_pending [ queue_index ] = NULL ;
2009-09-25 15:47:22 -04:00
queue_later [ queue_index ] = 0 ;
2002-01-18 22:50:03 -05:00
destroying_windows_disallowed + = 1 ;
2008-12-18 07:41:56 -05:00
2002-11-03 15:30:45 -05:00
/* We map windows from top to bottom and unmap from bottom to
* top , to avoid extra expose events . The exception is
* for unplaced windows , which have to be mapped from bottom to
* top so placement works .
2001-06-24 04:09:10 -04:00
*/
2002-11-03 15:30:45 -05:00
should_show = NULL ;
should_hide = NULL ;
unplaced = NULL ;
2003-05-30 16:24:00 -04:00
displays = NULL ;
2001-10-29 21:00:53 -05:00
tmp = copy ;
2001-06-21 23:20:21 -04:00
while ( tmp ! = NULL )
{
MetaWindow * window ;
window = tmp - > data ;
2002-11-03 15:30:45 -05:00
if ( ! window - > placed )
unplaced = g_slist_prepend ( unplaced , window ) ;
2004-12-19 21:53:08 -05:00
else if ( meta_window_should_be_showing ( window ) )
2002-11-03 15:30:45 -05:00
should_show = g_slist_prepend ( should_show , window ) ;
else
should_hide = g_slist_prepend ( should_hide , window ) ;
2008-12-18 07:41:56 -05:00
2002-11-03 15:30:45 -05:00
tmp = tmp - > next ;
}
/* bottom to top */
unplaced = g_slist_sort ( unplaced , stackcmp ) ;
should_hide = g_slist_sort ( should_hide , stackcmp ) ;
/* top to bottom */
should_show = g_slist_sort ( should_show , stackcmp ) ;
should_show = g_slist_reverse ( should_show ) ;
2006-12-03 15:05:23 -05:00
first_window = copy - > data ;
meta_display_grab ( first_window - > display ) ;
2008-12-18 07:41:56 -05:00
2002-11-03 15:30:45 -05:00
tmp = unplaced ;
while ( tmp ! = NULL )
{
MetaWindow * window ;
window = tmp - > data ;
2001-06-21 23:20:21 -04:00
meta_window_calc_showing ( window ) ;
2008-12-18 07:41:56 -05:00
2002-11-03 15:30:45 -05:00
tmp = tmp - > next ;
}
2006-12-03 15:05:23 -05:00
tmp = should_show ;
2002-11-03 15:30:45 -05:00
while ( tmp ! = NULL )
{
MetaWindow * window ;
window = tmp - > data ;
2006-12-03 15:05:23 -05:00
implement_showing ( window , TRUE ) ;
2008-12-18 07:41:56 -05:00
2002-11-03 15:30:45 -05:00
tmp = tmp - > next ;
}
2008-12-18 07:41:56 -05:00
2006-12-03 15:05:23 -05:00
tmp = should_hide ;
2002-11-03 15:30:45 -05:00
while ( tmp ! = NULL )
{
MetaWindow * window ;
window = tmp - > data ;
2006-12-03 15:05:23 -05:00
implement_showing ( window , FALSE ) ;
2008-12-18 07:41:56 -05:00
2002-11-03 15:30:45 -05:00
tmp = tmp - > next ;
}
2008-12-18 07:41:56 -05:00
2002-11-03 15:30:45 -05:00
tmp = copy ;
while ( tmp ! = NULL )
{
MetaWindow * window ;
window = tmp - > data ;
2002-01-18 22:50:03 -05:00
/* important to set this here for reentrancy -
* if we queue a window again while it ' s in " copy " ,
* then queue_calc_showing will just return since
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
* we are still in the calc_showing queue
2002-01-18 22:50:03 -05:00
*/
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
window - > is_in_queues & = ~ META_QUEUE_CALC_SHOWING ;
2008-12-18 07:41:56 -05:00
2001-06-21 23:20:21 -04:00
tmp = tmp - > next ;
}
2003-05-30 16:24:00 -04:00
2011-06-24 12:14:15 -04:00
if ( meta_prefs_get_focus_mode ( ) ! = G_DESKTOP_FOCUS_MODE_CLICK )
2005-02-21 21:11:25 -05:00
{
/* When display->mouse_mode is false, we want to ignore
* EnterNotify events unless they come from mouse motion . To do
* that , we set a sentinel property on the root window if we ' re
* not in mouse_mode .
*/
tmp = should_show ;
while ( tmp ! = NULL )
{
MetaWindow * window = tmp - > data ;
2008-12-18 07:41:56 -05:00
2005-02-21 21:11:25 -05:00
if ( ! window - > display - > mouse_mode )
meta_display_increment_focus_sentinel ( window - > display ) ;
tmp = tmp - > next ;
}
}
2006-12-03 15:05:23 -05:00
meta_display_ungrab ( first_window - > display ) ;
2008-12-18 07:41:56 -05:00
2001-10-29 21:00:53 -05:00
g_slist_free ( copy ) ;
2002-01-18 22:50:03 -05:00
2002-11-03 15:30:45 -05:00
g_slist_free ( unplaced ) ;
g_slist_free ( should_show ) ;
g_slist_free ( should_hide ) ;
2003-05-30 16:24:00 -04:00
g_slist_free ( displays ) ;
2008-12-18 07:41:56 -05:00
2002-01-18 22:50:03 -05:00
destroying_windows_disallowed - = 1 ;
2008-12-18 07:41:56 -05:00
2001-06-21 23:20:21 -04:00
return FALSE ;
}
2009-02-10 23:34:17 -05:00
# ifdef WITH_VERBOSE_MODE
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
static const gchar * meta_window_queue_names [ NUMBER_OF_QUEUES ] =
{ " calc_showing " , " move_resize " , " update_icon " } ;
2009-02-10 23:34:17 -05:00
# endif
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
2006-01-20 17:03:56 -05:00
static void
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_unqueue ( MetaWindow * window , guint queuebits )
2001-06-21 23:20:21 -04:00
{
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
gint queuenum ;
2001-10-29 21:00:53 -05:00
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
for ( queuenum = 0 ; queuenum < NUMBER_OF_QUEUES ; queuenum + + )
2001-06-21 23:20:21 -04:00
{
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
if ( ( queuebits & 1 < < queuenum ) /* they have asked to unqueue */
& &
( window - > is_in_queues & 1 < < queuenum ) ) /* it's in the queue */
{
meta_topic ( META_DEBUG_WINDOW_STATE ,
" Removing %s from the %s queue \n " ,
window - > desc ,
meta_window_queue_names [ queuenum ] ) ;
/* Note that window may not actually be in the queue
* because it may have been in " copy " inside the idle handler
2008-12-18 07:41:56 -05:00
*/
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
queue_pending [ queuenum ] = g_slist_remove ( queue_pending [ queuenum ] , window ) ;
window - > is_in_queues & = ~ ( 1 < < queuenum ) ;
/* Okay, so maybe we've used up all the entries in the queue.
* In that case , we should kill the function that deals with
* the queue , because there ' s nothing left for it to do .
*/
2009-09-25 15:47:22 -04:00
if ( queue_pending [ queuenum ] = = NULL & & queue_later [ queuenum ] ! = 0 )
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
{
2009-09-25 15:47:22 -04:00
meta_later_remove ( queue_later [ queuenum ] ) ;
queue_later [ queuenum ] = 0 ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
}
}
2001-06-21 23:20:21 -04:00
}
}
2006-01-20 17:03:56 -05:00
static void
2001-10-29 02:00:46 -05:00
meta_window_flush_calc_showing ( MetaWindow * window )
{
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
if ( window - > is_in_queues & META_QUEUE_CALC_SHOWING )
2001-10-29 02:00:46 -05:00
{
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_unqueue ( window , META_QUEUE_CALC_SHOWING ) ;
2001-10-29 02:00:46 -05:00
meta_window_calc_showing ( window ) ;
}
}
2001-06-06 00:47:37 -04:00
void
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_queue ( MetaWindow * window , guint queuebits )
2001-06-06 00:47:37 -04:00
{
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
guint queuenum ;
2001-06-21 23:20:21 -04:00
2009-06-15 18:25:07 -04:00
/* Easier to debug by checking here rather than in the idle */
g_return_if_fail ( ! window - > override_redirect | | ( queuebits & META_QUEUE_MOVE_RESIZE ) = = 0 ) ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
for ( queuenum = 0 ; queuenum < NUMBER_OF_QUEUES ; queuenum + + )
{
if ( queuebits & 1 < < queuenum )
{
/* Data which varies between queues.
* Yes , these do look a lot like associative arrays :
* I seem to be turning into a Perl programmer .
*/
2001-06-21 23:20:21 -04:00
2009-09-25 15:47:22 -04:00
const MetaLaterType window_queue_later_when [ NUMBER_OF_QUEUES ] =
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
{
2009-09-25 15:47:22 -04:00
META_LATER_BEFORE_REDRAW , /* CALC_SHOWING */
META_LATER_RESIZE , /* MOVE_RESIZE */
META_LATER_BEFORE_REDRAW /* UPDATE_ICON */
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
} ;
2009-09-25 15:47:22 -04:00
const GSourceFunc window_queue_later_handler [ NUMBER_OF_QUEUES ] =
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
{
idle_calc_showing ,
idle_move_resize ,
idle_update_icon ,
} ;
/* If we're about to drop the window, there's no point in putting
* it on a queue .
*/
if ( window - > unmanaging )
break ;
/* If the window already claims to be in that queue, there's no
* point putting it in the queue .
*/
if ( window - > is_in_queues & 1 < < queuenum )
break ;
meta_topic ( META_DEBUG_WINDOW_STATE ,
" Putting %s in the %s queue \n " ,
window - > desc ,
meta_window_queue_names [ queuenum ] ) ;
/* So, mark it as being in this queue. */
window - > is_in_queues | = 1 < < queuenum ;
/* There's not a lot of point putting things into a queue if
* nobody ' s on the other end pulling them out . Therefore ,
* let ' s check to see whether an idle handler exists to do
* that . If not , we ' ll create one .
*/
2001-06-21 23:20:21 -04:00
2009-09-25 15:47:22 -04:00
if ( queue_later [ queuenum ] = = 0 )
queue_later [ queuenum ] = meta_later_add
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
(
2009-09-25 15:47:22 -04:00
window_queue_later_when [ queuenum ] ,
window_queue_later_handler [ queuenum ] ,
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
GUINT_TO_POINTER ( queuenum ) ,
NULL
) ;
/* And now we actually put it on the queue. */
queue_pending [ queuenum ] = g_slist_prepend ( queue_pending [ queuenum ] ,
window ) ;
}
}
2001-06-06 00:47:37 -04:00
}
2002-06-14 21:46:13 -04:00
static gboolean
2005-02-12 02:19:41 -05:00
intervening_user_event_occurred ( MetaWindow * window )
2002-06-14 21:46:13 -04:00
{
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
guint32 compare ;
2005-02-12 02:19:41 -05:00
MetaWindow * focus_window ;
focus_window = window - > display - > focus_window ;
meta_topic ( META_DEBUG_STARTUP ,
" COMPARISON: \n "
" net_wm_user_time_set : %d \n "
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
" net_wm_user_time : %u \n "
2005-02-12 02:19:41 -05:00
" initial_timestamp_set: %d \n "
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
" initial_timestamp : %u \n " ,
2005-02-12 02:19:41 -05:00
window - > net_wm_user_time_set ,
window - > net_wm_user_time ,
window - > initial_timestamp_set ,
window - > initial_timestamp ) ;
if ( focus_window ! = NULL )
{
meta_topic ( META_DEBUG_STARTUP ,
" COMPARISON (continued): \n "
2006-08-09 14:32:30 -04:00
" focus_window : %s \n "
" fw->net_wm_user_time_set : %d \n "
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
" fw->net_wm_user_time : %u \n " ,
2005-02-12 02:19:41 -05:00
focus_window - > desc ,
2006-08-09 14:32:30 -04:00
focus_window - > net_wm_user_time_set ,
2005-02-12 02:19:41 -05:00
focus_window - > net_wm_user_time ) ;
}
/* We expect the most common case for not focusing a new window
* to be when a hint to not focus it has been set . Since we can
* deal with that case rapidly , we use special case it - - this is
* merely a preliminary optimization . : )
*/
if ( ( ( window - > net_wm_user_time_set = = TRUE ) & &
( window - > net_wm_user_time = = 0 ) )
| |
( ( window - > initial_timestamp_set = = TRUE ) & &
( window - > initial_timestamp = = 0 ) ) )
{
meta_topic ( META_DEBUG_STARTUP ,
" window %s explicitly requested no focus \n " ,
window - > desc ) ;
return TRUE ;
}
if ( ! ( window - > net_wm_user_time_set ) & & ! ( window - > initial_timestamp_set ) )
{
meta_topic ( META_DEBUG_STARTUP ,
" no information about window %s found \n " ,
window - > desc ) ;
2007-11-09 14:01:31 -05:00
return FALSE ;
2005-02-12 02:19:41 -05:00
}
2006-08-09 14:32:30 -04:00
if ( focus_window ! = NULL & &
! focus_window - > net_wm_user_time_set )
{
meta_topic ( META_DEBUG_STARTUP ,
" focus window, %s, doesn't have a user time set yet! \n " ,
window - > desc ) ;
return FALSE ;
}
2005-02-12 02:19:41 -05:00
/* To determine the "launch" time of an application,
* startup - notification can set the TIMESTAMP and the
* application ( usually via its toolkit such as gtk or qt ) can
2009-08-08 12:59:01 -04:00
* set the _NET_WM_USER_TIME . If both are set , we need to be
* using the newer of the two values .
*
* See http : //bugzilla.gnome.org/show_bug.cgi?id=573922
2005-02-12 02:19:41 -05:00
*/
2009-08-08 12:59:01 -04:00
compare = 0 ;
if ( window - > net_wm_user_time_set & &
window - > initial_timestamp_set )
compare =
XSERVER_TIME_IS_BEFORE ( window - > net_wm_user_time ,
window - > initial_timestamp ) ?
window - > initial_timestamp : window - > net_wm_user_time ;
else if ( window - > net_wm_user_time_set )
compare = window - > net_wm_user_time ;
else if ( window - > initial_timestamp_set )
compare = window - > initial_timestamp ;
2005-02-12 02:19:41 -05:00
if ( ( focus_window ! = NULL ) & &
XSERVER_TIME_IS_BEFORE ( compare , focus_window - > net_wm_user_time ) )
{
meta_topic ( META_DEBUG_STARTUP ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
" window %s focus prevented by other activity; %u < %u \n " ,
window - > desc ,
2008-12-18 07:41:56 -05:00
compare ,
2005-02-12 02:19:41 -05:00
focus_window - > net_wm_user_time ) ;
return TRUE ;
}
else
{
meta_topic ( META_DEBUG_STARTUP ,
" new window %s with no intervening events \n " ,
window - > desc ) ;
return FALSE ;
}
}
2006-01-10 13:33:53 -05:00
/* This function is an ugly hack. It's experimental in nature and ought to be
* replaced by a real hint from the app to the WM if we decide the experimental
* behavior is worthwhile . The basic idea is to get more feedback about how
* usage scenarios of " strict " focus users and what they expect . See # 326159.
*/
gboolean
__window_is_terminal ( MetaWindow * window )
{
2006-10-29 15:30:18 -05:00
if ( window = = NULL | | window - > res_class = = NULL )
2006-01-10 13:33:53 -05:00
return FALSE ;
2006-10-29 15:30:18 -05:00
/*
* Compare res_class , which is not user - settable , and thus theoretically
* a more - reliable indication of term - ness .
*/
2006-01-10 13:33:53 -05:00
/* gnome-terminal -- if you couldn't guess */
2006-10-29 15:30:18 -05:00
if ( strcmp ( window - > res_class , " Gnome-terminal " ) = = 0 )
2006-01-10 13:33:53 -05:00
return TRUE ;
/* xterm, rxvt, aterm */
2006-10-29 15:30:18 -05:00
else if ( strcmp ( window - > res_class , " XTerm " ) = = 0 )
2006-01-10 13:33:53 -05:00
return TRUE ;
/* konsole, KDE's terminal program */
2006-10-29 15:30:18 -05:00
else if ( strcmp ( window - > res_class , " Konsole " ) = = 0 )
2006-01-10 13:33:53 -05:00
return TRUE ;
/* rxvt-unicode */
2006-10-29 15:30:18 -05:00
else if ( strcmp ( window - > res_class , " URxvt " ) = = 0 )
2006-01-10 13:33:53 -05:00
return TRUE ;
/* eterm */
2006-10-29 15:30:18 -05:00
else if ( strcmp ( window - > res_class , " Eterm " ) = = 0 )
2006-01-10 13:33:53 -05:00
return TRUE ;
/* KTerm -- some terminal not KDE based; so not like Konsole */
2006-10-29 15:30:18 -05:00
else if ( strcmp ( window - > res_class , " KTerm " ) = = 0 )
2006-01-10 13:33:53 -05:00
return TRUE ;
/* Multi-gnome-terminal */
2006-10-29 15:30:18 -05:00
else if ( strcmp ( window - > res_class , " Multi-gnome-terminal " ) = = 0 )
2006-01-10 13:33:53 -05:00
return TRUE ;
/* mlterm ("multi lingual terminal emulator on X") */
2006-10-29 15:30:18 -05:00
else if ( strcmp ( window - > res_class , " mlterm " ) = = 0 )
2006-01-10 13:33:53 -05:00
return TRUE ;
2009-10-21 21:11:46 -04:00
/* Terminal -- XFCE Terminal */
else if ( strcmp ( window - > res_class , " Terminal " ) = = 0 )
return TRUE ;
2006-01-10 13:33:53 -05:00
return FALSE ;
}
2005-02-12 02:19:41 -05:00
/* This function determines what state the window should have assuming that it
* and the focus_window have no relation
*/
static void
2008-12-18 07:41:56 -05:00
window_state_on_map ( MetaWindow * window ,
2005-02-12 02:19:41 -05:00
gboolean * takes_focus ,
gboolean * places_on_top )
{
gboolean intervening_events ;
intervening_events = intervening_user_event_occurred ( window ) ;
* takes_focus = ! intervening_events ;
* places_on_top = * takes_focus ;
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
2002-06-14 21:46:13 -04:00
/* don't initially focus windows that are intended to not accept
* focus
*/
if ( ! ( window - > input | | window - > take_focus ) )
2005-02-12 02:19:41 -05:00
{
* takes_focus = FALSE ;
return ;
}
2002-06-14 21:46:13 -04:00
2006-04-12 14:01:20 -04:00
/* Terminal usage may be different; some users intend to launch
2006-01-10 13:33:53 -05:00
* many apps in quick succession or to just view things in the new
2006-04-12 14:01:20 -04:00
* window while still interacting with the terminal . In that case ,
2006-01-10 13:33:53 -05:00
* apps launched from the terminal should not take focus . This
* isn ' t quite the same as not allowing focus to transfer from
* terminals due to new window map , but the latter is a much easier
* approximation to enforce so we do that .
*/
if ( * takes_focus & &
2011-06-24 12:14:15 -04:00
meta_prefs_get_focus_new_windows ( ) = = G_DESKTOP_FOCUS_NEW_WINDOWS_STRICT & &
2006-01-15 12:03:57 -05:00
! window - > display - > allow_terminal_deactivation & &
2006-01-10 13:33:53 -05:00
__window_is_terminal ( window - > display - > focus_window ) & &
! meta_window_is_ancestor_of_transient ( window - > display - > focus_window ,
window ) )
{
meta_topic ( META_DEBUG_FOCUS ,
" focus_window is terminal; not focusing new window. \n " ) ;
* takes_focus = FALSE ;
* places_on_top = FALSE ;
}
2002-06-14 21:46:13 -04:00
switch ( window - > type )
{
2005-02-12 02:19:41 -05:00
case META_WINDOW_UTILITY :
case META_WINDOW_TOOLBAR :
* takes_focus = FALSE ;
* places_on_top = FALSE ;
break ;
2002-06-14 21:46:13 -04:00
case META_WINDOW_DOCK :
case META_WINDOW_DESKTOP :
case META_WINDOW_SPLASHSCREEN :
case META_WINDOW_MENU :
2008-11-23 14:28:40 -05:00
/* override redirect types: */
case META_WINDOW_DROPDOWN_MENU :
case META_WINDOW_POPUP_MENU :
case META_WINDOW_TOOLTIP :
case META_WINDOW_NOTIFICATION :
case META_WINDOW_COMBO :
case META_WINDOW_DND :
case META_WINDOW_OVERRIDE_OTHER :
2005-02-12 02:19:41 -05:00
/* don't focus any of these; places_on_top may be irrelevant for some of
* these ( e . g . dock ) - - but you never know - - the focus window might also be
* of the same type in some weird situation . . .
*/
* takes_focus = FALSE ;
2002-06-14 21:46:13 -04:00
break ;
case META_WINDOW_NORMAL :
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
case META_WINDOW_DIALOG :
case META_WINDOW_MODAL_DIALOG :
2005-02-12 02:19:41 -05:00
/* The default is correct for these */
2002-06-14 21:46:13 -04:00
break ;
}
}
2006-01-10 00:14:48 -05:00
static gboolean
windows_overlap ( const MetaWindow * w1 , const MetaWindow * w2 )
{
MetaRectangle w1rect , w2rect ;
meta_window_get_outer_rect ( w1 , & w1rect ) ;
meta_window_get_outer_rect ( w2 , & w2rect ) ;
return meta_rectangle_overlap ( & w1rect , & w2rect ) ;
}
2007-10-16 18:29:59 -04:00
/* Returns whether a new window would be covered by any
* existing window on the same workspace that is set
* to be " above " ( " always on top " ) . A window that is not
* set " above " would be underneath the new window anyway .
*
* We take " covered " to mean even partially covered , but
* some people might prefer entirely covered . I think it
* is more useful to behave this way if any part of the
* window is covered , because a partial coverage could be
* ( say ) ninety per cent and almost indistinguishable from total .
*/
static gboolean
window_would_be_covered ( const MetaWindow * newbie )
{
MetaWorkspace * workspace = newbie - > workspace ;
GList * tmp , * windows ;
2008-12-18 07:41:56 -05:00
2007-10-16 18:29:59 -04:00
windows = meta_workspace_list_windows ( workspace ) ;
tmp = windows ;
while ( tmp ! = NULL )
2008-12-18 07:41:56 -05:00
{
2007-10-16 18:29:59 -04:00
MetaWindow * w = tmp - > data ;
2008-03-18 08:22:25 -04:00
if ( w - > wm_state_above & & w ! = newbie )
2007-10-16 18:29:59 -04:00
{
/* We have found a window that is "above". Perhaps it overlaps. */
if ( windows_overlap ( w , newbie ) )
{
g_list_free ( windows ) ; /* clean up... */
return TRUE ; /* yes, it does */
}
}
tmp = tmp - > next ;
}
g_list_free ( windows ) ;
return FALSE ; /* none found */
}
2012-04-26 06:54:12 -04:00
static gboolean
map_frame ( MetaWindow * window )
{
if ( window - > frame & & ! window - > frame - > mapped )
{
meta_topic ( META_DEBUG_WINDOW_STATE ,
" Frame actually needs map \n " ) ;
window - > frame - > mapped = TRUE ;
meta_ui_map_frame ( window - > screen - > ui , window - > frame - > xwindow ) ;
return TRUE ;
}
else
return FALSE ;
}
2009-06-18 16:35:31 -04:00
static gboolean
map_client_window ( MetaWindow * window )
{
if ( ! window - > mapped )
{
meta_topic ( META_DEBUG_WINDOW_STATE ,
" %s actually needs map \n " , window - > desc ) ;
window - > mapped = TRUE ;
meta_error_trap_push ( window - > display ) ;
XMapWindow ( window - > display - > xdisplay , window - > xwindow ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
2009-06-18 16:35:31 -04:00
return TRUE ;
}
else
return FALSE ;
}
static gboolean
unmap_client_window ( MetaWindow * window ,
const char * reason )
{
if ( window - > mapped )
{
meta_topic ( META_DEBUG_WINDOW_STATE ,
" %s actually needs unmap%s \n " ,
window - > desc , reason ) ;
meta_topic ( META_DEBUG_WINDOW_STATE ,
" Incrementing unmaps_pending on %s%s \n " ,
window - > desc , reason ) ;
window - > mapped = FALSE ;
window - > unmaps_pending + = 1 ;
meta_error_trap_push ( window - > display ) ;
XUnmapWindow ( window - > display - > xdisplay , window - > xwindow ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
2009-06-18 16:35:31 -04:00
return TRUE ;
}
else
return FALSE ;
}
2009-08-14 06:18:28 -04:00
/**
* meta_window_is_mapped :
* @ window : a # MetaWindow
*
* Determines whether the X window for the MetaWindow is mapped .
*/
gboolean
meta_window_is_mapped ( MetaWindow * window )
{
return window - > mapped ;
}
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
/**
* meta_window_toplevel_is_mapped :
* @ window : a # MetaWindow
*
* Determines whether the toplevel X window for the MetaWindow is
* mapped . ( The frame window is mapped even without the client window
* when a window is shaded . )
*
* Return Value : % TRUE if the toplevel is mapped .
*/
gboolean
meta_window_toplevel_is_mapped ( MetaWindow * window )
{
/* The frame is mapped but not the client window when the window
* is shaded .
*/
return window - > mapped | | ( window - > frame & & window - > frame - > mapped ) ;
}
2011-02-02 19:14:27 -05:00
static void
meta_window_force_placement ( MetaWindow * window )
{
if ( window - > placed )
return ;
/* We have to recalc the placement here since other windows may
* have been mapped / placed since we last did constrain_position
*/
/* calc_placement is an efficiency hack to avoid
* multiple placement calculations before we finally
* show the window .
*/
window - > calc_placement = TRUE ;
meta_window_move_resize_now ( window ) ;
window - > calc_placement = FALSE ;
/* don't ever do the initial position constraint thing again.
* This is toggled here so that initially - iconified windows
* still get placed when they are ultimately shown .
*/
window - > placed = TRUE ;
/* Don't want to accidentally reuse the fact that we had been denied
* focus in any future constraints unless we ' re denied focus again .
*/
window - > denied_focus_and_not_transient = FALSE ;
}
2009-06-14 07:59:59 -04:00
static void
2001-06-02 00:14:18 -04:00
meta_window_show ( MetaWindow * window )
{
2002-02-08 01:01:58 -05:00
gboolean did_show ;
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
gboolean takes_focus_on_map ;
2005-02-12 02:19:41 -05:00
gboolean place_on_top_on_map ;
2006-01-10 00:14:48 -05:00
gboolean needs_stacking_adjustment ;
MetaWindow * focus_window ;
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
gboolean toplevel_was_mapped ;
gboolean toplevel_now_mapped ;
2009-11-17 05:02:06 -05:00
gboolean notify_demands_attention = FALSE ;
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_WINDOW_STATE ,
" Showing window %s, shaded: %d iconic: %d placed: %d \n " ,
window - > desc , window - > shaded , window - > iconic , window - > placed ) ;
2001-06-07 22:17:48 -04:00
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
toplevel_was_mapped = meta_window_toplevel_is_mapped ( window ) ;
2006-01-10 00:14:48 -05:00
focus_window = window - > display - > focus_window ; /* May be NULL! */
2002-02-08 01:01:58 -05:00
did_show = FALSE ;
2005-02-12 02:19:41 -05:00
window_state_on_map ( window , & takes_focus_on_map , & place_on_top_on_map ) ;
2006-01-10 00:14:48 -05:00
needs_stacking_adjustment = FALSE ;
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
2005-02-12 02:19:41 -05:00
meta_topic ( META_DEBUG_WINDOW_STATE ,
" Window %s %s focus on map, and %s place on top on map. \n " ,
window - > desc ,
takes_focus_on_map ? " does " : " does not " ,
place_on_top_on_map ? " does " : " does not " ) ;
2007-10-16 18:29:59 -04:00
/* Now, in some rare cases we should *not* put a new window on top.
2007-11-11 19:45:35 -05:00
* These cases include certain types of windows showing for the first
2007-10-16 18:29:59 -04:00
* time , and any window which would be covered because of another window
* being set " above " ( " always on top " ) .
*
* FIXME : Although " place_on_top_on_map " and " takes_focus_on_map " are
* generally based on the window type , there is a special case when the
* focus window is a terminal for them both to be false ; this should
* probably rather be a term in the " if " condition below .
*/
2007-11-11 19:45:35 -05:00
if ( focus_window ! = NULL & & window - > showing_for_first_time & &
( ( ! place_on_top_on_map & & ! takes_focus_on_map ) | |
window_would_be_covered ( window ) )
) {
2006-01-10 00:14:48 -05:00
if ( meta_window_is_ancestor_of_transient ( focus_window , window ) )
2004-10-25 12:28:57 -04:00
{
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
guint32 timestamp ;
timestamp = meta_display_get_current_time_roundtrip ( window - > display ) ;
2004-10-25 12:28:57 -04:00
/* This happens for error dialogs or alerts; these need to remain on
* top , but it would be confusing to have its ancestor remain
* focused .
*/
meta_topic ( META_DEBUG_STARTUP ,
" The focus window %s is an ancestor of the newly mapped "
" window %s which isn't being focused. Unfocusing the "
" ancestor. \n " ,
2006-01-10 00:14:48 -05:00
focus_window - > desc , window - > desc ) ;
2004-10-25 12:28:57 -04:00
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_display_focus_the_no_focus_window ( window - > display ,
window - > screen ,
timestamp ) ;
2004-10-25 12:28:57 -04:00
}
else
{
2006-01-10 00:14:48 -05:00
needs_stacking_adjustment = TRUE ;
2005-02-11 14:20:44 -05:00
if ( ! window - > placed )
window - > denied_focus_and_not_transient = TRUE ;
2004-10-25 12:28:57 -04:00
}
2004-08-05 13:48:39 -04:00
}
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
2001-06-24 04:09:10 -04:00
if ( ! window - > placed )
2012-03-15 15:42:11 -04:00
{
2012-04-05 14:36:14 -04:00
if ( window - > showing_for_first_time & & window - > has_maximize_func )
2012-03-15 15:42:11 -04:00
{
MetaRectangle work_area ;
meta_window_get_work_area_for_monitor ( window , window - > monitor - > number , & work_area ) ;
/* Automaximize windows that map with a size > MAX_UNMAXIMIZED_WINDOW_AREA of the work area */
if ( window - > rect . width * window - > rect . height > work_area . width * work_area . height * MAX_UNMAXIMIZED_WINDOW_AREA )
{
window - > maximize_horizontally_after_placement = TRUE ;
window - > maximize_vertically_after_placement = TRUE ;
}
}
meta_window_force_placement ( window ) ;
}
2008-12-18 07:41:56 -05:00
2006-09-13 18:21:19 -04:00
if ( needs_stacking_adjustment )
{
2006-09-18 18:00:57 -04:00
gboolean overlap ;
2006-09-13 18:21:19 -04:00
/* This window isn't getting focus on map. We may need to do some
* special handing with it in regards to
* - the stacking of the window
* - the MRU position of the window
* - the demands attention setting of the window
2007-10-16 18:29:59 -04:00
*
* Firstly , set the flag so we don ' t give the window focus anyway
* and confuse people .
2006-09-13 18:21:19 -04:00
*/
2008-12-18 07:41:56 -05:00
2007-10-16 18:29:59 -04:00
takes_focus_on_map = FALSE ;
2006-09-13 18:21:19 -04:00
overlap = windows_overlap ( window , focus_window ) ;
/* We want alt tab to go to the denied-focus window */
ensure_mru_position_after ( window , focus_window ) ;
/* We don't want the denied-focus window to obscure the focus
* window , and if we ' re in both click - to - focus mode and
* raise - on - click mode then we want to maintain the invariant
* that MRU order = = stacking order . The need for this if
* comes from the fact that in sloppy / mouse focus the focus
* window may not overlap other windows and also can be
* considered " below " them ; this combination means that
* placing the denied - focus window " below " the focus window
* in the stack when it doesn ' t overlap it confusingly places
* that new window below a lot of other windows .
*/
2008-12-18 07:41:56 -05:00
if ( overlap | |
2011-06-24 12:14:15 -04:00
( meta_prefs_get_focus_mode ( ) = = G_DESKTOP_FOCUS_MODE_CLICK & &
2006-09-13 18:21:19 -04:00
meta_prefs_get_raise_on_click ( ) ) )
meta_window_stack_just_below ( window , focus_window ) ;
/* If the window will be obscured by the focus window, then the
* user might not notice the window appearing so set the
* demands attention hint .
*
2008-12-18 07:41:56 -05:00
* We set the hint ourselves rather than calling
2006-09-13 18:21:19 -04:00
* meta_window_set_demands_attention ( ) because that would cause
* a recalculation of overlap , and a call to set_net_wm_state ( )
* which we are going to call ourselves here a few lines down .
*/
if ( overlap )
2009-11-17 05:02:06 -05:00
{
if ( ! window - > wm_state_demands_attention )
{
window - > wm_state_demands_attention = TRUE ;
notify_demands_attention = TRUE ;
}
}
2008-12-18 07:41:56 -05:00
}
2006-09-13 18:21:19 -04:00
2001-06-07 22:17:48 -04:00
/* Shaded means the frame is mapped but the window is not */
2008-12-18 07:41:56 -05:00
2009-06-18 16:35:31 -04:00
if ( map_frame ( window ) )
did_show = TRUE ;
2001-06-02 00:14:18 -04:00
2001-06-07 22:17:48 -04:00
if ( window - > shaded )
{
2009-06-18 16:35:31 -04:00
unmap_client_window ( window , " (shading) " ) ;
2001-06-09 23:17:15 -04:00
2001-06-07 22:17:48 -04:00
if ( ! window - > iconic )
{
window - > iconic = TRUE ;
set_wm_state ( window , IconicState ) ;
}
}
else
2001-06-06 00:47:37 -04:00
{
2009-06-18 16:35:31 -04:00
if ( map_client_window ( window ) )
did_show = TRUE ;
2008-12-18 07:41:56 -05:00
2012-02-29 22:15:12 -05:00
if ( window - > hidden )
2008-10-24 05:07:24 -04:00
{
2012-02-29 22:15:12 -05:00
meta_stack_freeze ( window - > screen - > stack ) ;
window - > hidden = FALSE ;
meta_stack_thaw ( window - > screen - > stack ) ;
did_show = TRUE ;
2008-10-24 05:07:24 -04:00
}
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
if ( window - > iconic )
{
window - > iconic = FALSE ;
set_wm_state ( window , NormalState ) ;
}
}
2008-11-23 14:28:40 -05:00
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
toplevel_now_mapped = meta_window_toplevel_is_mapped ( window ) ;
if ( toplevel_now_mapped ! = toplevel_was_mapped )
{
if ( window - > display - > compositor )
meta_compositor_window_mapped ( window - > display - > compositor , window ) ;
}
2008-12-18 07:41:56 -05:00
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
if ( ! window - > visible_to_compositor )
{
2011-01-04 11:43:02 -05:00
window - > visible_to_compositor = TRUE ;
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
if ( window - > display - > compositor )
{
MetaCompEffect effect = META_COMP_EFFECT_NONE ;
2008-12-18 07:41:56 -05:00
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
switch ( window - > pending_compositor_effect )
2009-06-25 16:17:27 -04:00
{
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
case META_COMP_EFFECT_CREATE :
case META_COMP_EFFECT_UNMINIMIZE :
effect = window - > pending_compositor_effect ;
break ;
case META_COMP_EFFECT_NONE :
case META_COMP_EFFECT_DESTROY :
case META_COMP_EFFECT_MINIMIZE :
break ;
2009-06-25 16:17:27 -04:00
}
2008-11-23 14:28:40 -05:00
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
meta_compositor_show_window ( window - > display - > compositor ,
window , effect ) ;
2009-01-12 11:41:06 -05:00
}
2001-06-06 00:47:37 -04:00
}
2001-10-29 21:00:53 -05:00
2004-12-28 01:01:42 -05:00
/* We don't want to worry about all cases from inside
* implement_showing ( ) ; we only want to worry about focus if this
* window has not been shown before .
*/
if ( window - > showing_for_first_time )
2001-10-29 21:00:53 -05:00
{
2004-12-28 01:01:42 -05:00
window - > showing_for_first_time = FALSE ;
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
if ( takes_focus_on_map )
2008-12-18 07:41:56 -05:00
{
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
guint32 timestamp ;
timestamp = meta_display_get_current_time_roundtrip ( window - > display ) ;
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_window_focus ( window , timestamp ) ;
2002-05-16 15:08:20 -04:00
}
Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 15:56:10 -04:00
else
2004-10-25 12:28:57 -04:00
{
/* Prevent EnterNotify events in sloppy/mouse focus from
* erroneously focusing the window that had been denied
* focus . FIXME : This introduces a race ; I have a couple
* ideas for a better way to accomplish the same thing , but
* they ' re more involved so do it this way for now .
*/
meta_display_increment_focus_sentinel ( window - > display ) ;
}
2001-10-29 21:00:53 -05:00
}
2002-02-08 01:01:58 -05:00
2006-03-16 22:26:25 -05:00
set_net_wm_state ( window ) ;
Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 15:56:10 -04:00
2006-03-16 22:26:25 -05:00
if ( did_show & & window - > struts )
{
meta_topic ( META_DEBUG_WORKAREA ,
" Mapped window %s with struts, so invalidating work areas \n " ,
window - > desc ) ;
invalidate_work_areas ( window ) ;
2002-02-08 01:01:58 -05:00
}
2009-08-08 12:59:01 -04:00
/*
* Now that we have shown the window , we no longer want to consider the
* initial timestamp in any subsequent deliberations whether to focus this
* window or not , so clear the flag .
*
* See http : //bugzilla.gnome.org/show_bug.cgi?id=573922
*/
window - > initial_timestamp_set = FALSE ;
2009-11-17 05:02:06 -05:00
if ( notify_demands_attention )
2009-10-28 13:19:24 -04:00
{
g_object_notify ( G_OBJECT ( window ) , " demands-attention " ) ;
g_signal_emit_by_name ( window - > display , " window-demands-attention " ,
window ) ;
}
2001-06-02 00:14:18 -04:00
}
2006-01-13 14:41:01 -05:00
static void
2001-06-02 00:14:18 -04:00
meta_window_hide ( MetaWindow * window )
{
2002-01-10 22:31:14 -05:00
gboolean did_hide ;
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
gboolean toplevel_was_mapped ;
gboolean toplevel_now_mapped ;
2008-10-24 05:07:24 -04:00
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_WINDOW_STATE ,
" Hiding window %s \n " , window - > desc ) ;
2002-01-10 22:31:14 -05:00
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
toplevel_was_mapped = meta_window_toplevel_is_mapped ( window ) ;
if ( window - > visible_to_compositor )
{
2011-01-04 11:43:02 -05:00
window - > visible_to_compositor = FALSE ;
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
if ( window - > display - > compositor )
{
MetaCompEffect effect = META_COMP_EFFECT_NONE ;
switch ( window - > pending_compositor_effect )
{
case META_COMP_EFFECT_CREATE :
case META_COMP_EFFECT_UNMINIMIZE :
case META_COMP_EFFECT_NONE :
break ;
case META_COMP_EFFECT_DESTROY :
case META_COMP_EFFECT_MINIMIZE :
effect = window - > pending_compositor_effect ;
break ;
}
meta_compositor_hide_window ( window - > display - > compositor ,
window , effect ) ;
}
}
2002-01-10 22:31:14 -05:00
did_hide = FALSE ;
2008-10-24 05:07:24 -04:00
2012-02-29 22:15:12 -05:00
/* If this is the first time that we've calculating the showing
* state of the window , the frame and client window might not
* yet be mapped , so we need to map them now */
map_frame ( window ) ;
map_client_window ( window ) ;
2008-10-24 05:07:24 -04:00
2012-02-29 22:15:12 -05:00
if ( ! window - > hidden )
2001-06-09 23:17:15 -04:00
{
2012-02-29 22:15:12 -05:00
meta_stack_freeze ( window - > screen - > stack ) ;
window - > hidden = TRUE ;
meta_stack_thaw ( window - > screen - > stack ) ;
did_hide = TRUE ;
2001-06-09 23:17:15 -04:00
}
2001-06-04 02:17:52 -04:00
2001-06-06 00:47:37 -04:00
if ( ! window - > iconic )
{
window - > iconic = TRUE ;
set_wm_state ( window , IconicState ) ;
}
2008-12-18 07:41:56 -05:00
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
toplevel_now_mapped = meta_window_toplevel_is_mapped ( window ) ;
if ( toplevel_now_mapped ! = toplevel_was_mapped )
{
if ( window - > display - > compositor )
{
/* As above, we may be *mapping* live hidden windows */
if ( toplevel_now_mapped )
meta_compositor_window_mapped ( window - > display - > compositor , window ) ;
else
meta_compositor_window_unmapped ( window - > display - > compositor , window ) ;
}
}
2006-03-16 22:26:25 -05:00
set_net_wm_state ( window ) ;
2008-12-18 07:41:56 -05:00
2006-03-16 22:26:25 -05:00
if ( did_hide & & window - > struts )
{
meta_topic ( META_DEBUG_WORKAREA ,
" Unmapped window %s with struts, so invalidating work areas \n " ,
window - > desc ) ;
invalidate_work_areas ( window ) ;
2002-01-10 22:31:14 -05:00
}
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
2009-10-07 13:43:33 -04:00
/* The check on expected_focus_window is a temporary workaround for
* https : //bugzilla.gnome.org/show_bug.cgi?id=597352
* We may have already switched away from this window but not yet
* gotten FocusIn / FocusOut events . A more complete comprehensive
* fix for these type of issues is described in the bug .
*/
if ( window - > has_focus & &
window = = window - > display - > expected_focus_window )
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
{
MetaWindow * not_this_one = NULL ;
MetaWorkspace * my_workspace = meta_window_get_workspace ( window ) ;
guint32 timestamp = meta_display_get_current_time_roundtrip ( window - > display ) ;
/*
* If this window is modal , passing the not_this_one window to
* _focus_default_window ( ) makes the focus to be given to this window ' s
* ancestor . This can only be the case if the window is on the currently
* active workspace ; when it is not , we need to pass in NULL , so as to
* focus the default window for the active workspace ( this scenario
* arises when we are switching workspaces ) .
2012-10-26 08:39:21 -04:00
* We also pass in NULL if we are in the process of hiding all non - desktop
* windows to avoid unexpected changes to the stacking order .
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
*/
2012-10-26 08:39:21 -04:00
if ( my_workspace = = window - > screen - > active_workspace & &
! my_workspace - > showing_desktop )
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
not_this_one = window ;
meta_workspace_focus_default_window ( window - > screen - > active_workspace ,
not_this_one ,
timestamp ) ;
}
2001-06-04 02:17:52 -04:00
}
2003-03-17 01:36:39 -05:00
static gboolean
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
queue_calc_showing_func ( MetaWindow * window ,
void * data )
{
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_queue ( window , META_QUEUE_CALC_SHOWING ) ;
2003-03-17 01:36:39 -05:00
return TRUE ;
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
}
2001-06-04 02:17:52 -04:00
void
meta_window_minimize ( MetaWindow * window )
{
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2001-06-04 02:17:52 -04:00
if ( ! window - > minimized )
{
window - > minimized = TRUE ;
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
window - > pending_compositor_effect = META_COMP_EFFECT_MINIMIZE ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_queue ( window , META_QUEUE_CALC_SHOWING ) ;
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
meta_window_foreach_transient ( window ,
queue_calc_showing_func ,
NULL ) ;
2008-12-18 07:41:56 -05:00
2002-01-03 18:28:19 -05:00
if ( window - > has_focus )
{
meta_topic ( META_DEBUG_FOCUS ,
2004-06-24 16:02:46 -04:00
" Focusing default window due to minimization of focus window %s \n " ,
2002-01-03 18:28:19 -05:00
window - > desc ) ;
}
else
{
meta_topic ( META_DEBUG_FOCUS ,
" Minimizing window %s which doesn't have the focus \n " ,
window - > desc ) ;
}
2011-05-31 13:52:04 -04:00
g_object_notify ( G_OBJECT ( window ) , " minimized " ) ;
2001-06-04 02:17:52 -04:00
}
}
void
meta_window_unminimize ( MetaWindow * window )
{
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2001-06-04 02:17:52 -04:00
if ( window - > minimized )
{
window - > minimized = FALSE ;
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 17:10:40 -04:00
window - > pending_compositor_effect = META_COMP_EFFECT_UNMINIMIZE ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_queue ( window , META_QUEUE_CALC_SHOWING ) ;
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
meta_window_foreach_transient ( window ,
queue_calc_showing_func ,
NULL ) ;
2011-05-31 13:52:04 -04:00
g_object_notify ( G_OBJECT ( window ) , " minimized " ) ;
2001-06-07 01:18:10 -04:00
}
}
2007-04-04 17:54:56 -04:00
static void
ensure_size_hints_satisfied ( MetaRectangle * rect ,
const XSizeHints * size_hints )
{
int minw , minh , maxw , maxh ; /* min/max width/height */
int basew , baseh , winc , hinc ; /* base width/height, width/height increment */
int extra_width , extra_height ;
minw = size_hints - > min_width ; minh = size_hints - > min_height ;
maxw = size_hints - > max_width ; maxh = size_hints - > max_height ;
basew = size_hints - > base_width ; baseh = size_hints - > base_height ;
winc = size_hints - > width_inc ; hinc = size_hints - > height_inc ;
2008-12-18 07:41:56 -05:00
2007-04-04 17:54:56 -04:00
/* First, enforce min/max size constraints */
rect - > width = CLAMP ( rect - > width , minw , maxw ) ;
rect - > height = CLAMP ( rect - > height , minh , maxh ) ;
/* Now, verify size increment constraints are satisfied, or make them be */
extra_width = ( rect - > width - basew ) % winc ;
extra_height = ( rect - > height - baseh ) % hinc ;
rect - > width - = extra_width ;
rect - > height - = extra_height ;
/* Adjusting width/height down, as done above, may violate minimum size
* constraints , so one last fix .
*/
if ( rect - > width < minw )
rect - > width + = ( ( minw - rect - > width ) / winc + 1 ) * winc ;
if ( rect - > height < minh )
rect - > height + = ( ( minh - rect - > height ) / hinc + 1 ) * hinc ;
}
2002-09-24 17:33:34 -04:00
static void
meta_window_save_rect ( MetaWindow * window )
{
2010-09-24 14:31:36 -04:00
if ( ! ( META_WINDOW_MAXIMIZED ( window ) | | META_WINDOW_TILED_SIDE_BY_SIDE ( window ) | | window - > fullscreen ) )
2002-09-24 17:33:34 -04:00
{
/* save size/pos as appropriate args for move_resize */
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
if ( ! window - > maximized_horizontally )
2002-09-24 17:33:34 -04:00
{
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
window - > saved_rect . x = window - > rect . x ;
window - > saved_rect . width = window - > rect . width ;
if ( window - > frame )
window - > saved_rect . x + = window - > frame - > rect . x ;
}
if ( ! window - > maximized_vertically )
{
window - > saved_rect . y = window - > rect . y ;
window - > saved_rect . height = window - > rect . height ;
if ( window - > frame )
window - > saved_rect . y + = window - > frame - > rect . y ;
2002-09-24 17:33:34 -04:00
}
}
}
2008-08-15 23:09:40 -04:00
/**
2011-11-02 11:34:45 -04:00
* force_save_user_window_placement :
* @ window : Store current position of this window for future reference
*
2008-08-15 23:09:40 -04:00
* Save the user_rect regardless of whether the window is maximized or
* fullscreen . See save_user_window_placement ( ) for most uses .
*/
static void
force_save_user_window_placement ( MetaWindow * window )
{
meta_window_get_client_root_coords ( window , & window - > user_rect ) ;
}
/**
2011-11-02 11:34:45 -04:00
* save_user_window_placement :
* @ window : Store current position of this window for future reference
*
2008-08-15 23:09:40 -04:00
* Save the user_rect , but only if the window is neither maximized nor
* fullscreen , otherwise the window may snap back to those dimensions
* ( bug # 461927 ) .
*/
2007-11-13 08:31:14 -05:00
static void
2008-08-15 23:09:40 -04:00
save_user_window_placement ( MetaWindow * window )
2007-11-13 08:31:14 -05:00
{
2010-09-24 14:31:36 -04:00
if ( ! ( META_WINDOW_MAXIMIZED ( window ) | | META_WINDOW_TILED_SIDE_BY_SIDE ( window ) | | window - > fullscreen ) )
2007-11-13 08:31:14 -05:00
{
MetaRectangle user_rect ;
meta_window_get_client_root_coords ( window , & user_rect ) ;
if ( ! window - > maximized_horizontally )
{
window - > user_rect . x = user_rect . x ;
window - > user_rect . width = user_rect . width ;
}
if ( ! window - > maximized_vertically )
{
window - > user_rect . y = user_rect . y ;
window - > user_rect . height = user_rect . height ;
}
}
}
2003-06-09 19:49:02 -04:00
void
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
meta_window_maximize_internal ( MetaWindow * window ,
MetaMaximizeFlags directions ,
MetaRectangle * saved_rect )
2003-06-09 19:49:02 -04:00
{
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* At least one of the two directions ought to be set */
gboolean maximize_horizontally , maximize_vertically ;
maximize_horizontally = directions & META_MAXIMIZE_HORIZONTAL ;
maximize_vertically = directions & META_MAXIMIZE_VERTICAL ;
g_assert ( maximize_horizontally | | maximize_vertically ) ;
2003-06-09 19:49:02 -04:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
" Maximizing %s%s \n " ,
window - > desc ,
maximize_horizontally & & maximize_vertically ? " " :
maximize_horizontally ? " horizontally " :
maximize_vertically ? " vertically " : " BUGGGGG " ) ;
2008-12-18 07:41:56 -05:00
2003-06-09 19:49:02 -04:00
if ( saved_rect ! = NULL )
window - > saved_rect = * saved_rect ;
else
meta_window_save_rect ( window ) ;
2008-12-18 07:41:56 -05:00
2011-12-05 15:52:46 -05:00
if ( maximize_horizontally & & maximize_vertically )
window - > saved_maximize = TRUE ;
2008-12-18 07:41:56 -05:00
window - > maximized_horizontally =
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
window - > maximized_horizontally | | maximize_horizontally ;
2008-12-18 07:41:56 -05:00
window - > maximized_vertically =
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
window - > maximized_vertically | | maximize_vertically ;
2010-01-20 10:59:07 -05:00
if ( maximize_horizontally | | maximize_vertically )
window - > force_save_user_rect = FALSE ;
2006-07-31 15:56:56 -04:00
2003-06-09 19:49:02 -04:00
recalc_window_features ( window ) ;
set_net_wm_state ( window ) ;
2010-02-12 15:26:52 -05:00
g_object_freeze_notify ( G_OBJECT ( window ) ) ;
g_object_notify ( G_OBJECT ( window ) , " maximized-horizontally " ) ;
g_object_notify ( G_OBJECT ( window ) , " maximized-vertically " ) ;
g_object_thaw_notify ( G_OBJECT ( window ) ) ;
2003-06-09 19:49:02 -04:00
}
2001-06-07 01:18:10 -04:00
void
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
meta_window_maximize ( MetaWindow * window ,
MetaMaximizeFlags directions )
2001-06-07 01:18:10 -04:00
{
2010-06-24 14:41:28 -04:00
MetaRectangle * saved_rect = NULL ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
gboolean maximize_horizontally , maximize_vertically ;
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
/* At least one of the two directions ought to be set */
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
maximize_horizontally = directions & META_MAXIMIZE_HORIZONTAL ;
maximize_vertically = directions & META_MAXIMIZE_VERTICAL ;
g_assert ( maximize_horizontally | | maximize_vertically ) ;
/* Only do something if the window isn't already maximized in the
* given direction ( s ) .
*/
if ( ( maximize_horizontally & & ! window - > maximized_horizontally ) | |
( maximize_vertically & & ! window - > maximized_vertically ) )
2001-06-07 01:18:10 -04:00
{
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
if ( window - > shaded & & maximize_vertically )
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
{
/* Shading sucks anyway; I'm not adding a timestamp argument
* to this function just for this niche usage & corner case .
*/
2008-12-18 07:41:56 -05:00
guint32 timestamp =
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_display_get_current_time_roundtrip ( window - > display ) ;
meta_window_unshade ( window , timestamp ) ;
}
2008-12-18 07:41:56 -05:00
2003-06-09 19:49:02 -04:00
/* if the window hasn't been placed yet, we'll maximize it then
*/
if ( ! window - > placed )
{
2008-12-18 07:41:56 -05:00
window - > maximize_horizontally_after_placement =
window - > maximize_horizontally_after_placement | |
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
maximize_horizontally ;
2008-12-18 07:41:56 -05:00
window - > maximize_vertically_after_placement =
window - > maximize_vertically_after_placement | |
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
maximize_vertically ;
2003-06-09 19:49:02 -04:00
return ;
}
2010-06-24 14:41:28 -04:00
if ( window - > tile_mode ! = META_TILE_NONE )
{
saved_rect = & window - > saved_rect ;
window - > maximized_vertically = FALSE ;
}
2008-12-18 07:41:56 -05:00
meta_window_maximize_internal ( window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
directions ,
2010-06-24 14:41:28 -04:00
saved_rect ) ;
2001-10-14 18:13:53 -04:00
2008-09-18 11:09:11 -04:00
if ( window - > display - > compositor )
{
2009-06-28 12:26:23 -04:00
MetaRectangle old_rect ;
MetaRectangle new_rect ;
meta_window_get_outer_rect ( window , & old_rect ) ;
2008-11-23 14:28:40 -05:00
2008-09-18 11:09:11 -04:00
meta_window_move_resize_now ( window ) ;
2009-06-28 12:26:23 -04:00
meta_window_get_outer_rect ( window , & new_rect ) ;
2008-09-18 11:09:11 -04:00
meta_compositor_maximize_window ( window - > display - > compositor ,
window ,
2009-06-28 12:26:23 -04:00
& old_rect ,
& new_rect ) ;
2008-09-18 11:09:11 -04:00
}
else
{
/* move_resize with new maximization constraints
*/
meta_window_queue ( window , META_QUEUE_MOVE_RESIZE ) ;
}
2001-06-07 01:18:10 -04:00
}
}
2010-11-11 18:42:44 -05:00
/**
* meta_window_get_maximized :
*
* Gets the current maximization state of the window , as combination
* of the % META_MAXIMIZE_HORIZONTAL and % META_MAXIMIZE_VERTICAL flags ;
*
* Return value : current maximization state
*/
MetaMaximizeFlags
meta_window_get_maximized ( MetaWindow * window )
{
return ( ( window - > maximized_horizontally ? META_MAXIMIZE_HORIZONTAL : 0 ) |
( window - > maximized_vertically ? META_MAXIMIZE_VERTICAL : 0 ) ) ;
}
/**
* meta_window_is_fullscreen :
*
* Return value : % TRUE if the window is currently fullscreen
*/
gboolean
meta_window_is_fullscreen ( MetaWindow * window )
{
return window - > fullscreen ;
}
2011-03-09 07:04:18 -05:00
/**
* meta_window_is_on_primary_monitor :
*
* Return value : % TRUE if the window is on the primary monitor
*/
gboolean
meta_window_is_on_primary_monitor ( MetaWindow * window )
{
2011-05-20 04:56:12 -04:00
return window - > monitor - > is_primary ;
2011-03-09 07:04:18 -05:00
}
2011-01-19 10:41:16 -05:00
void
2010-06-24 14:41:28 -04:00
meta_window_tile ( MetaWindow * window )
{
2010-09-24 15:35:00 -04:00
MetaMaximizeFlags directions ;
2010-06-24 14:41:28 -04:00
/* Don't do anything if no tiling is requested */
if ( window - > tile_mode = = META_TILE_NONE )
return ;
2010-09-24 15:35:00 -04:00
if ( window - > tile_mode = = META_TILE_MAXIMIZED )
directions = META_MAXIMIZE_VERTICAL | META_MAXIMIZE_HORIZONTAL ;
else
directions = META_MAXIMIZE_VERTICAL ;
meta_window_maximize_internal ( window , directions , NULL ) ;
2010-06-24 14:41:28 -04:00
meta_screen_tile_preview_update ( window - > screen , FALSE ) ;
if ( window - > display - > compositor )
{
MetaRectangle old_rect ;
MetaRectangle new_rect ;
meta_window_get_outer_rect ( window , & old_rect ) ;
meta_window_move_resize_now ( window ) ;
meta_window_get_outer_rect ( window , & new_rect ) ;
meta_compositor_maximize_window ( window - > display - > compositor ,
window ,
& old_rect ,
& new_rect ) ;
2011-12-05 15:45:26 -05:00
if ( window - > frame )
meta_ui_queue_frame_draw ( window - > screen - > ui ,
window - > frame - > xwindow ) ;
2010-06-24 14:41:28 -04:00
}
else
{
/* move_resize with new tiling constraints
*/
meta_window_queue ( window , META_QUEUE_MOVE_RESIZE ) ;
}
}
2011-04-18 12:27:03 -04:00
static gboolean
meta_window_can_tile_maximized ( MetaWindow * window )
{
2011-12-05 18:52:09 -05:00
return window - > has_maximize_func ;
2011-04-18 12:27:03 -04:00
}
2011-12-05 15:52:54 -05:00
gboolean
2010-09-24 14:31:36 -04:00
meta_window_can_tile_side_by_side ( MetaWindow * window )
2010-06-24 14:41:28 -04:00
{
2012-06-11 10:12:39 -04:00
int monitor ;
2010-06-24 14:41:28 -04:00
MetaRectangle tile_area ;
2012-03-12 23:11:07 -04:00
MetaFrameBorders borders ;
2010-06-24 14:41:28 -04:00
2011-04-18 12:27:03 -04:00
if ( ! meta_window_can_tile_maximized ( window ) )
2010-06-24 14:41:28 -04:00
return FALSE ;
monitor = meta_screen_get_current_monitor ( window - > screen ) ;
2012-06-08 04:21:10 -04:00
meta_window_get_work_area_for_monitor ( window , monitor , & tile_area ) ;
2010-06-24 14:41:28 -04:00
2010-09-24 07:23:18 -04:00
/* Do not allow tiling in portrait orientation */
if ( tile_area . height > tile_area . width )
return FALSE ;
2010-06-24 14:41:28 -04:00
tile_area . width / = 2 ;
2012-03-12 23:11:07 -04:00
meta_frame_calc_borders ( window - > frame , & borders ) ;
2010-06-24 14:41:28 -04:00
2012-03-12 23:11:07 -04:00
tile_area . width - = ( borders . visible . left + borders . visible . right ) ;
tile_area . height - = ( borders . visible . top + borders . visible . bottom ) ;
2010-06-24 14:41:28 -04:00
return tile_area . width > = window - > size_hints . min_width & &
tile_area . height > = window - > size_hints . min_height ;
}
2006-01-20 18:36:23 -05:00
static void
unmaximize_window_before_freeing ( MetaWindow * window )
{
meta_topic ( META_DEBUG_WINDOW_OPS ,
" Unmaximizing %s just before freeing \n " ,
window - > desc ) ;
window - > maximized_horizontally = FALSE ;
window - > maximized_vertically = FALSE ;
2006-10-01 17:59:09 -04:00
if ( window - > withdrawn ) /* See bug #137185 */
{
window - > rect = window - > saved_rect ;
set_net_wm_state ( window ) ;
}
else if ( window - > screen - > closing ) /* See bug #358042 */
{
/* Do NOT update net_wm_state: this screen is closing,
* it likely will be managed by another window manager
* that will need the current _NET_WM_STATE atoms .
* Moreover , it will need to know the unmaximized geometry ,
* therefore move_resize the window to saved_rect here
* before closing it . */
meta_window_move_resize ( window ,
FALSE ,
window - > saved_rect . x ,
window - > saved_rect . y ,
window - > saved_rect . width ,
window - > saved_rect . height ) ;
}
2006-01-20 18:36:23 -05:00
}
2010-09-18 16:28:30 -04:00
static void
meta_window_unmaximize_internal ( MetaWindow * window ,
MetaMaximizeFlags directions ,
MetaRectangle * desired_rect ,
int gravity )
2001-06-07 01:18:10 -04:00
{
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
gboolean unmaximize_horizontally , unmaximize_vertically ;
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
/* At least one of the two directions ought to be set */
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
unmaximize_horizontally = directions & META_MAXIMIZE_HORIZONTAL ;
unmaximize_vertically = directions & META_MAXIMIZE_VERTICAL ;
g_assert ( unmaximize_horizontally | | unmaximize_vertically ) ;
2011-12-05 15:52:46 -05:00
if ( unmaximize_horizontally & & unmaximize_vertically )
window - > saved_maximize = FALSE ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* Only do something if the window isn't already maximized in the
* given direction ( s ) .
*/
if ( ( unmaximize_horizontally & & window - > maximized_horizontally ) | |
( unmaximize_vertically & & window - > maximized_vertically ) )
2001-06-07 01:18:10 -04:00
{
2007-04-03 23:07:26 -04:00
MetaRectangle target_rect ;
2012-03-12 12:09:17 -04:00
MetaRectangle work_area ;
meta_window_get_work_area_for_monitor ( window , window - > monitor - > number , & work_area ) ;
2007-04-03 23:07:26 -04:00
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
" Unmaximizing %s%s \n " ,
window - > desc ,
unmaximize_horizontally & & unmaximize_vertically ? " " :
unmaximize_horizontally ? " horizontally " :
unmaximize_vertically ? " vertically " : " BUGGGGG " ) ;
2008-12-18 07:41:56 -05:00
window - > maximized_horizontally =
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
window - > maximized_horizontally & & ! unmaximize_horizontally ;
2008-12-18 07:41:56 -05:00
window - > maximized_vertically =
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
window - > maximized_vertically & & ! unmaximize_vertically ;
2001-06-07 01:18:10 -04:00
2010-12-10 10:45:27 -05:00
/* Reset the tile mode for maximized tiled windows for consistency
* with " normal " maximized windows , but keep other tile modes ,
* as side - by - side tiled windows may snap back .
*/
if ( window - > tile_mode = = META_TILE_MAXIMIZED )
window - > tile_mode = META_TILE_NONE ;
2007-04-03 23:07:26 -04:00
/* Unmaximize to the saved_rect position in the direction(s)
* being unmaximized .
*/
2007-04-08 23:43:55 -04:00
meta_window_get_client_root_coords ( window , & target_rect ) ;
2012-03-12 12:09:17 -04:00
/* Avoid unmaximizing to "almost maximized" size when the previous size
* is greater then 80 % of the work area use MAX_UNMAXIMIZED_WINDOW_AREA of the work area as upper limit
* while maintaining the aspect ratio .
*/
if ( unmaximize_horizontally & & unmaximize_vertically & &
desired_rect - > width * desired_rect - > height > work_area . width * work_area . height * MAX_UNMAXIMIZED_WINDOW_AREA )
{
if ( desired_rect - > width > desired_rect - > height )
{
float aspect = ( float ) desired_rect - > height / ( float ) desired_rect - > width ;
desired_rect - > width = MAX ( work_area . width * sqrt ( MAX_UNMAXIMIZED_WINDOW_AREA ) , window - > size_hints . min_width ) ;
desired_rect - > height = MAX ( desired_rect - > width * aspect , window - > size_hints . min_height ) ;
}
else
{
float aspect = ( float ) desired_rect - > width / ( float ) desired_rect - > height ;
desired_rect - > height = MAX ( work_area . height * sqrt ( MAX_UNMAXIMIZED_WINDOW_AREA ) , window - > size_hints . min_height ) ;
desired_rect - > width = MAX ( desired_rect - > height * aspect , window - > size_hints . min_width ) ;
}
}
2007-04-03 23:07:26 -04:00
if ( unmaximize_horizontally )
{
2010-09-18 16:28:30 -04:00
target_rect . x = desired_rect - > x ;
target_rect . width = desired_rect - > width ;
2007-04-03 23:07:26 -04:00
}
if ( unmaximize_vertically )
{
2010-09-18 16:28:30 -04:00
target_rect . y = desired_rect - > y ;
target_rect . height = desired_rect - > height ;
2007-04-03 23:07:26 -04:00
}
2007-04-04 17:54:56 -04:00
/* Window's size hints may have changed while maximized, making
* saved_rect invalid . # 329152
*/
ensure_size_hints_satisfied ( & target_rect , & window - > size_hints ) ;
2008-09-18 11:09:11 -04:00
if ( window - > display - > compositor )
{
2009-06-28 12:26:23 -04:00
MetaRectangle old_rect , new_rect ;
meta_window_get_outer_rect ( window , & old_rect ) ;
2008-11-23 14:28:40 -05:00
2010-09-18 16:28:30 -04:00
meta_window_move_resize_internal ( window ,
META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION ,
gravity ,
target_rect . x ,
target_rect . y ,
target_rect . width ,
target_rect . height ) ;
2008-11-23 14:28:40 -05:00
2009-06-28 12:26:23 -04:00
meta_window_get_outer_rect ( window , & new_rect ) ;
2008-09-18 11:09:11 -04:00
meta_compositor_unmaximize_window ( window - > display - > compositor ,
2008-11-23 14:28:40 -05:00
window ,
2009-06-28 12:26:23 -04:00
& old_rect ,
& new_rect ) ;
2008-09-18 11:09:11 -04:00
}
else
{
2010-09-18 16:28:30 -04:00
meta_window_move_resize_internal ( window ,
META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION ,
gravity ,
target_rect . x ,
target_rect . y ,
target_rect . width ,
target_rect . height ) ;
2008-09-18 11:09:11 -04:00
}
2001-06-10 23:24:20 -04:00
2010-06-14 16:40:38 -04:00
/* Make sure user_rect is current.
*/
force_save_user_window_placement ( window ) ;
2010-06-24 14:41:28 -04:00
/* When we unmaximize, if we're doing a mouse move also we could
* get the window suddenly jumping to the upper left corner of
* the workspace , since that ' s where it was when the grab op
* started . So we need to update the grab state . We have to do
* it after the actual operation , as the window may have been moved
* by constraints .
*/
if ( meta_grab_op_is_moving ( window - > display - > grab_op ) & &
window - > display - > grab_window = = window )
{
window - > display - > grab_anchor_window_pos = window - > user_rect ;
}
2003-01-15 22:20:34 -05:00
recalc_window_features ( window ) ;
2001-06-10 23:24:20 -04:00
set_net_wm_state ( window ) ;
2001-06-04 02:17:52 -04:00
}
2010-02-12 15:26:52 -05:00
g_object_freeze_notify ( G_OBJECT ( window ) ) ;
g_object_notify ( G_OBJECT ( window ) , " maximized-horizontally " ) ;
g_object_notify ( G_OBJECT ( window ) , " maximized-vertically " ) ;
g_object_thaw_notify ( G_OBJECT ( window ) ) ;
2001-06-02 00:14:18 -04:00
}
2010-09-18 16:28:30 -04:00
void
meta_window_unmaximize ( MetaWindow * window ,
MetaMaximizeFlags directions )
{
meta_window_unmaximize_internal ( window , directions , & window - > saved_rect ,
NorthWestGravity ) ;
}
/* Like meta_window_unmaximize(), but instead of unmaximizing to the
* saved position , we give the new desired size , and the gravity that
* determines the positioning relationship between the area occupied
* maximized and the new are . The arguments are similar to
* meta_window_resize_with_gravity ( ) .
2010-09-19 10:54:08 -04:00
* Unlike meta_window_unmaximize ( ) , tiling is not restored for windows
* with a tile mode other than META_TILE_NONE .
2010-09-18 16:28:30 -04:00
*/
void
meta_window_unmaximize_with_gravity ( MetaWindow * window ,
MetaMaximizeFlags directions ,
int new_width ,
int new_height ,
int gravity )
{
MetaRectangle desired_rect ;
meta_window_get_position ( window , & desired_rect . x , & desired_rect . y ) ;
desired_rect . width = new_width ;
desired_rect . height = new_height ;
meta_window_unmaximize_internal ( window , directions , & desired_rect , gravity ) ;
}
2003-06-27 10:49:56 -04:00
void
meta_window_make_above ( MetaWindow * window )
{
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2011-07-02 07:08:17 -04:00
meta_window_set_above ( window , TRUE ) ;
2003-06-27 10:49:56 -04:00
meta_window_raise ( window ) ;
}
void
meta_window_unmake_above ( MetaWindow * window )
{
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2011-07-02 07:08:17 -04:00
meta_window_set_above ( window , FALSE ) ;
2003-06-27 10:49:56 -04:00
meta_window_raise ( window ) ;
2011-07-02 07:08:17 -04:00
}
static void
meta_window_set_above ( MetaWindow * window ,
gboolean new_value )
{
new_value = new_value ! = FALSE ;
if ( new_value = = window - > wm_state_above )
return ;
window - > wm_state_above = new_value ;
2003-06-27 10:49:56 -04:00
meta_window_update_layer ( window ) ;
set_net_wm_state ( window ) ;
2011-07-02 07:08:17 -04:00
g_object_notify ( G_OBJECT ( window ) , " above " ) ;
2003-06-27 10:49:56 -04:00
}
2002-02-23 17:58:02 -05:00
void
Fix several bugs with handling of fullscreen windows, causing them to not
2006-08-21 Elijah Newren <newren gmail com>
Fix several bugs with handling of fullscreen windows, causing them
to not actually be fullscreen. #343115 (and also #346927,
#350547, #351643, the recent additional WINE-related issue
mentioned on the mailing list, and probably others...)
* src/constraints.c (setup_constraint_info): if a window tries to
resize to fullscreen-size and it has a fullscreen function but
isn't actually marked as fullscreen then assist it by marking it
as such, (constrain_fully_onscreen, constrain_titlebar_visible):
ignore this constraint for fullscreen windows since such windows
have a separate specialized constraint
* src/stack.c (window_is_fullscreen_size, get_standalone_layer):
remove the old window_is_fullscreen_size() hack for detecting
windows to treat as fullscreen since it doesn't work well with the
new constraints framework (i.e. we needed a slightly different
hack)
* src/window.[ch] (meta_window_new_with_addrs): shuffle the order
of adding the window to the stack and moveresizing the window
since moveresizing can cause stack changes if the window's initial
size is fullscreen size, (meta_window_make_fullscreen,
meta_window_make_fullscreen_internal): split
meta_window_make_fullscreen() similar to meta_window_maximize() so
that constraints can make use of it
2006-08-21 14:08:05 -04:00
meta_window_make_fullscreen_internal ( MetaWindow * window )
2002-02-23 17:58:02 -05:00
{
if ( ! window - > fullscreen )
{
meta_topic ( META_DEBUG_WINDOW_OPS ,
" Fullscreening %s \n " , window - > desc ) ;
2002-08-10 15:04:55 -04:00
if ( window - > shaded )
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
{
/* Shading sucks anyway; I'm not adding a timestamp argument
* to this function just for this niche usage & corner case .
*/
2008-12-18 07:41:56 -05:00
guint32 timestamp =
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_display_get_current_time_roundtrip ( window - > display ) ;
meta_window_unshade ( window , timestamp ) ;
}
2002-09-24 17:33:34 -04:00
meta_window_save_rect ( window ) ;
2008-12-18 07:41:56 -05:00
2002-02-23 17:58:02 -05:00
window - > fullscreen = TRUE ;
2010-01-20 10:59:07 -05:00
window - > force_save_user_rect = FALSE ;
2002-02-23 17:58:02 -05:00
2002-08-12 17:32:13 -04:00
meta_stack_freeze ( window - > screen - > stack ) ;
2002-09-24 17:22:06 -04:00
meta_window_update_layer ( window ) ;
2008-12-18 07:41:56 -05:00
2002-02-23 17:58:02 -05:00
meta_window_raise ( window ) ;
2002-08-12 17:32:13 -04:00
meta_stack_thaw ( window - > screen - > stack ) ;
2008-12-18 07:41:56 -05:00
Fix several bugs with handling of fullscreen windows, causing them to not
2006-08-21 Elijah Newren <newren gmail com>
Fix several bugs with handling of fullscreen windows, causing them
to not actually be fullscreen. #343115 (and also #346927,
#350547, #351643, the recent additional WINE-related issue
mentioned on the mailing list, and probably others...)
* src/constraints.c (setup_constraint_info): if a window tries to
resize to fullscreen-size and it has a fullscreen function but
isn't actually marked as fullscreen then assist it by marking it
as such, (constrain_fully_onscreen, constrain_titlebar_visible):
ignore this constraint for fullscreen windows since such windows
have a separate specialized constraint
* src/stack.c (window_is_fullscreen_size, get_standalone_layer):
remove the old window_is_fullscreen_size() hack for detecting
windows to treat as fullscreen since it doesn't work well with the
new constraints framework (i.e. we needed a slightly different
hack)
* src/window.[ch] (meta_window_new_with_addrs): shuffle the order
of adding the window to the stack and moveresizing the window
since moveresizing can cause stack changes if the window's initial
size is fullscreen size, (meta_window_make_fullscreen,
meta_window_make_fullscreen_internal): split
meta_window_make_fullscreen() similar to meta_window_maximize() so
that constraints can make use of it
2006-08-21 14:08:05 -04:00
recalc_window_features ( window ) ;
set_net_wm_state ( window ) ;
2009-03-17 08:27:13 -04:00
g_object_notify ( G_OBJECT ( window ) , " fullscreen " ) ;
Fix several bugs with handling of fullscreen windows, causing them to not
2006-08-21 Elijah Newren <newren gmail com>
Fix several bugs with handling of fullscreen windows, causing them
to not actually be fullscreen. #343115 (and also #346927,
#350547, #351643, the recent additional WINE-related issue
mentioned on the mailing list, and probably others...)
* src/constraints.c (setup_constraint_info): if a window tries to
resize to fullscreen-size and it has a fullscreen function but
isn't actually marked as fullscreen then assist it by marking it
as such, (constrain_fully_onscreen, constrain_titlebar_visible):
ignore this constraint for fullscreen windows since such windows
have a separate specialized constraint
* src/stack.c (window_is_fullscreen_size, get_standalone_layer):
remove the old window_is_fullscreen_size() hack for detecting
windows to treat as fullscreen since it doesn't work well with the
new constraints framework (i.e. we needed a slightly different
hack)
* src/window.[ch] (meta_window_new_with_addrs): shuffle the order
of adding the window to the stack and moveresizing the window
since moveresizing can cause stack changes if the window's initial
size is fullscreen size, (meta_window_make_fullscreen,
meta_window_make_fullscreen_internal): split
meta_window_make_fullscreen() similar to meta_window_maximize() so
that constraints can make use of it
2006-08-21 14:08:05 -04:00
}
}
void
meta_window_make_fullscreen ( MetaWindow * window )
{
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
Fix several bugs with handling of fullscreen windows, causing them to not
2006-08-21 Elijah Newren <newren gmail com>
Fix several bugs with handling of fullscreen windows, causing them
to not actually be fullscreen. #343115 (and also #346927,
#350547, #351643, the recent additional WINE-related issue
mentioned on the mailing list, and probably others...)
* src/constraints.c (setup_constraint_info): if a window tries to
resize to fullscreen-size and it has a fullscreen function but
isn't actually marked as fullscreen then assist it by marking it
as such, (constrain_fully_onscreen, constrain_titlebar_visible):
ignore this constraint for fullscreen windows since such windows
have a separate specialized constraint
* src/stack.c (window_is_fullscreen_size, get_standalone_layer):
remove the old window_is_fullscreen_size() hack for detecting
windows to treat as fullscreen since it doesn't work well with the
new constraints framework (i.e. we needed a slightly different
hack)
* src/window.[ch] (meta_window_new_with_addrs): shuffle the order
of adding the window to the stack and moveresizing the window
since moveresizing can cause stack changes if the window's initial
size is fullscreen size, (meta_window_make_fullscreen,
meta_window_make_fullscreen_internal): split
meta_window_make_fullscreen() similar to meta_window_maximize() so
that constraints can make use of it
2006-08-21 14:08:05 -04:00
if ( ! window - > fullscreen )
{
meta_window_make_fullscreen_internal ( window ) ;
2002-02-23 17:58:02 -05:00
/* move_resize with new constraints
*/
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_queue ( window , META_QUEUE_MOVE_RESIZE ) ;
2002-02-23 17:58:02 -05:00
}
}
void
meta_window_unmake_fullscreen ( MetaWindow * window )
{
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2002-02-23 17:58:02 -05:00
if ( window - > fullscreen )
{
2007-04-04 17:54:56 -04:00
MetaRectangle target_rect ;
2002-02-23 17:58:02 -05:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
" Unfullscreening %s \n " , window - > desc ) ;
2008-12-18 07:41:56 -05:00
2002-02-23 17:58:02 -05:00
window - > fullscreen = FALSE ;
2007-04-04 17:54:56 -04:00
target_rect = window - > saved_rect ;
/* Window's size hints may have changed while maximized, making
* saved_rect invalid . # 329152
*/
ensure_size_hints_satisfied ( & target_rect , & window - > size_hints ) ;
2002-02-23 17:58:02 -05:00
2011-10-17 14:56:56 -04:00
/* Need to update window->has_resize_func before we move_resize()
*/
recalc_window_features ( window ) ;
set_net_wm_state ( window ) ;
2002-02-23 17:58:02 -05:00
meta_window_move_resize ( window ,
2005-11-22 10:48:30 -05:00
FALSE ,
2007-04-04 17:54:56 -04:00
target_rect . x ,
target_rect . y ,
target_rect . width ,
target_rect . height ) ;
2002-02-23 17:58:02 -05:00
2010-01-20 10:59:07 -05:00
/* Make sure user_rect is current.
*/
force_save_user_window_placement ( window ) ;
2005-01-31 11:49:23 -05:00
meta_window_update_layer ( window ) ;
2008-12-18 07:41:56 -05:00
2009-03-17 08:27:13 -04:00
g_object_notify ( G_OBJECT ( window ) , " fullscreen " ) ;
2002-02-23 17:58:02 -05:00
}
}
2008-11-16 21:57:20 -05:00
void
meta_window_update_fullscreen_monitors ( MetaWindow * window ,
unsigned long top ,
unsigned long bottom ,
unsigned long left ,
unsigned long right )
{
2009-08-31 09:52:16 -04:00
if ( ( int ) top < window - > screen - > n_monitor_infos & &
( int ) bottom < window - > screen - > n_monitor_infos & &
( int ) left < window - > screen - > n_monitor_infos & &
( int ) right < window - > screen - > n_monitor_infos )
2008-11-16 21:57:20 -05:00
{
window - > fullscreen_monitors [ 0 ] = top ;
window - > fullscreen_monitors [ 1 ] = bottom ;
window - > fullscreen_monitors [ 2 ] = left ;
window - > fullscreen_monitors [ 3 ] = right ;
}
else
{
window - > fullscreen_monitors [ 0 ] = - 1 ;
}
if ( window - > fullscreen )
{
meta_window_queue ( window , META_QUEUE_MOVE_RESIZE ) ;
}
}
2001-06-02 21:33:27 -04:00
void
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_window_shade ( MetaWindow * window ,
guint32 timestamp )
2001-06-02 21:33:27 -04:00
{
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
" Shading %s \n " , window - > desc ) ;
2001-06-07 22:17:48 -04:00
if ( ! window - > shaded )
2008-12-18 07:41:56 -05:00
{
2001-08-06 00:43:31 -04:00
window - > shaded = TRUE ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_queue ( window , META_QUEUE_MOVE_RESIZE | META_QUEUE_CALC_SHOWING ) ;
2001-06-10 23:24:20 -04:00
2002-01-03 18:28:19 -05:00
/* After queuing the calc showing, since _focus flushes it,
* and we need to focus the frame
*/
meta_topic ( META_DEBUG_FOCUS ,
" Re-focusing window %s after shading it \n " ,
window - > desc ) ;
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_window_focus ( window , timestamp ) ;
2008-12-18 07:41:56 -05:00
2001-06-10 23:24:20 -04:00
set_net_wm_state ( window ) ;
2001-06-02 21:33:27 -04:00
}
}
2001-06-06 00:47:37 -04:00
void
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_window_unshade ( MetaWindow * window ,
guint32 timestamp )
2001-06-06 00:47:37 -04:00
{
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
" Unshading %s \n " , window - > desc ) ;
2001-06-07 22:17:48 -04:00
if ( window - > shaded )
{
window - > shaded = FALSE ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_queue ( window , META_QUEUE_MOVE_RESIZE | META_QUEUE_CALC_SHOWING ) ;
2002-01-03 18:28:19 -05:00
2001-06-09 17:58:30 -04:00
/* focus the window */
2002-01-03 18:28:19 -05:00
meta_topic ( META_DEBUG_FOCUS ,
" Focusing window %s after unshading it \n " ,
window - > desc ) ;
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_window_focus ( window , timestamp ) ;
2001-06-10 23:24:20 -04:00
set_net_wm_state ( window ) ;
}
}
2003-03-17 01:36:39 -05:00
static gboolean
unminimize_func ( MetaWindow * window ,
void * data )
{
meta_window_unminimize ( window ) ;
return TRUE ;
}
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
static void
unminimize_window_and_all_transient_parents ( MetaWindow * window )
{
2003-05-18 13:16:03 -04:00
meta_window_unminimize ( window ) ;
2003-03-17 01:36:39 -05:00
meta_window_foreach_ancestor ( window , unminimize_func , NULL ) ;
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
}
2006-01-10 00:44:40 -05:00
static void
window_activate ( MetaWindow * window ,
guint32 timestamp ,
2006-08-07 14:08:27 -04:00
MetaClientType source_indication ,
MetaWorkspace * workspace )
2001-10-29 02:00:46 -05:00
{
2006-01-10 00:44:40 -05:00
gboolean can_ignore_outdated_timestamps ;
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
meta_topic ( META_DEBUG_FOCUS ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
" _NET_ACTIVE_WINDOW message sent for %s at time %u "
2006-01-10 00:44:40 -05:00
" by client type %u. \n " ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
window - > desc , timestamp , source_indication ) ;
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
2006-01-10 00:44:40 -05:00
/* Older EWMH spec didn't specify a timestamp; we decide to honor these only
* if the app specifies that it is a pager .
*
* Update : Unconditionally honor 0 timestamps for now ; we ' ll fight
* that battle later . Just remove the " FALSE && " in order to only
* honor 0 timestamps for pagers .
2005-02-06 11:52:26 -05:00
*/
2006-01-10 00:44:40 -05:00
can_ignore_outdated_timestamps =
( timestamp ! = 0 | | ( FALSE & & source_indication ! = META_CLIENT_TYPE_PAGER ) ) ;
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
if ( XSERVER_TIME_IS_BEFORE ( timestamp , window - > display - > last_user_time ) & &
2006-01-10 00:44:40 -05:00
can_ignore_outdated_timestamps )
2005-02-06 11:52:26 -05:00
{
meta_topic ( META_DEBUG_FOCUS ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
" last_user_time (%u) is more recent; ignoring "
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
" _NET_ACTIVE_WINDOW message. \n " ,
window - > display - > last_user_time ) ;
2006-03-29 13:43:22 -05:00
meta_window_set_demands_attention ( window ) ;
2005-02-06 11:52:26 -05:00
return ;
}
2006-01-10 00:44:40 -05:00
2008-12-18 07:41:56 -05:00
/* For those stupid pagers, get a valid timestamp and show a warning */
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
if ( timestamp = = 0 )
{
meta_warning ( " meta_window_activate called by a pager with a 0 timestamp; "
" the pager needs to be fixed. \n " ) ;
timestamp = meta_display_get_current_time_roundtrip ( window - > display ) ;
}
2005-02-08 22:15:11 -05:00
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
meta_window_set_user_time ( window , timestamp ) ;
2004-08-07 20:02:02 -04:00
2002-04-28 00:52:26 -04:00
/* disable show desktop mode unless we're a desktop component */
2003-05-16 17:59:08 -04:00
maybe_leave_show_desktop_mode ( window ) ;
2008-12-18 07:41:56 -05:00
2006-08-07 14:08:27 -04:00
/* Get window on current or given workspace */
if ( workspace = = NULL )
workspace = window - > screen - > active_workspace ;
2008-12-21 00:35:30 -05:00
2009-03-17 08:27:13 -04:00
/* For non-transient windows, we just set up a pulsing indicator,
2008-12-21 00:35:30 -05:00
rather than move windows or workspaces .
See http : //bugzilla.gnome.org/show_bug.cgi?id=482354 */
2009-03-17 08:27:13 -04:00
if ( window - > xtransient_for = = None & &
2008-12-21 00:35:30 -05:00
! meta_window_located_on_workspace ( window , workspace ) )
{
meta_window_set_demands_attention ( window ) ;
/* We've marked it as demanding, don't need to do anything else. */
return ;
}
else if ( window - > xtransient_for ! = None )
{
2009-03-17 08:27:13 -04:00
/* Move transients to current workspace - preference dialogs should appear over
2008-12-21 00:35:30 -05:00
the source window . */
2006-08-07 14:08:27 -04:00
meta_window_change_workspace ( window , workspace ) ;
2008-12-21 00:35:30 -05:00
}
2008-12-18 07:41:56 -05:00
2002-02-08 01:50:09 -05:00
if ( window - > shaded )
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_window_unshade ( window , timestamp ) ;
2001-10-29 02:00:46 -05:00
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
unminimize_window_and_all_transient_parents ( window ) ;
Add a raise on click option, basically only because all the major distros
2006-01-10 Elijah Newren <newren@gmail.com>
Add a raise on click option, basically only because all the major
distros are patching it in anyway. See #326156.
* src/metacity.schemas.in: add the new gconf key and explanation
* src/prefs.[ch] (#define KEY_RAISE_ON_CLICK, static gboolean
raise_on_click, update_raise_on_click, meta_prefs_init,
change_notify, meta_prefs_get_raise_on_click,
meta_preference_to_string):
Add all the normal preference handling stuff for this new
raise-on-click option.
* src/core.c (meta_core_show_window_menu):
* src/display.c (event_callback, meta_display_begin_grab_op):
* src/window.c (window_activate, meta_window_configure_request, ):
Only raise the window if in raise_on_click mode.
* src/display.c (meta_display_begin_grab_op,
meta_display_end_grab_op, meta_display_check_threshold_reached):
* src/display.h (struct MetaDisplay):
* src/window.c (meta_window_handle_mouse_grab_op_event):
if not in raise-on-click mode only raise on button release if the
click didn't start a move or resize operation; needs a few extra
MetaDisplay fields to handle this
* src/core.c (meta_core_user_lower_and_unfocus):
no need to do the MRU shuffling if not maintaining the stacking
order == MRU order invariant
* src/frames.c (meta_frames_button_press_event):
* src/window.c (meta_window_begin_grab_op):
remove an unneeded window raising that is already handled elsewhere
2006-01-10 14:35:03 -05:00
if ( meta_prefs_get_raise_on_click ( ) | |
source_indication = = META_CLIENT_TYPE_PAGER )
meta_window_raise ( window ) ;
2005-07-23 21:13:41 -04:00
meta_topic ( META_DEBUG_FOCUS ,
" Focusing window %s due to activation \n " ,
window - > desc ) ;
meta_window_focus ( window , timestamp ) ;
2001-10-29 02:00:46 -05:00
}
2001-06-10 23:24:20 -04:00
2006-01-10 00:44:40 -05:00
/* This function exists since most of the functionality in window_activate
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
* is useful for Mutter , but Mutter shouldn ' t need to specify a client
2006-01-10 00:44:40 -05:00
* type for itself . ; - )
*/
void
meta_window_activate ( MetaWindow * window ,
guint32 timestamp )
{
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2006-01-10 00:44:40 -05:00
/* We're not really a pager, but the behavior we want is the same as if
* we were such . If we change the pager behavior later , we could revisit
* this and just add extra flags to window_activate .
*/
2006-08-07 14:08:27 -04:00
window_activate ( window , timestamp , META_CLIENT_TYPE_PAGER , NULL ) ;
}
void
meta_window_activate_with_workspace ( MetaWindow * window ,
guint32 timestamp ,
MetaWorkspace * workspace )
{
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2006-08-07 14:08:27 -04:00
/* We're not really a pager, but the behavior we want is the same as if
* we were such . If we change the pager behavior later , we could revisit
* this and just add extra flags to window_activate .
*/
window_activate ( window , timestamp , META_CLIENT_TYPE_APPLICATION , workspace ) ;
2006-01-10 00:44:40 -05:00
}
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* Manually fix all the weirdness explained in the big comment at the
* beginning of meta_window_move_resize_internal ( ) giving positions
* expected by meta_window_constrain ( i . e . positions & sizes of the
* internal or client window ) .
2003-03-08 18:43:17 -05:00
*/
2001-07-28 02:35:19 -04:00
static void
2001-06-10 23:24:20 -04:00
adjust_for_gravity ( MetaWindow * window ,
2011-07-12 00:37:41 -04:00
MetaFrameBorders * borders ,
2001-06-10 23:24:20 -04:00
gboolean coords_assume_border ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
int gravity ,
MetaRectangle * rect )
2001-06-10 23:24:20 -04:00
{
int ref_x , ref_y ;
int bw ;
int child_x , child_y ;
int frame_width , frame_height ;
2008-12-18 07:41:56 -05:00
2001-06-10 23:24:20 -04:00
if ( coords_assume_border )
bw = window - > border_width ;
else
bw = 0 ;
2011-07-12 00:37:41 -04:00
if ( borders )
2001-06-10 23:24:20 -04:00
{
2011-09-22 14:17:01 -04:00
child_x = borders - > visible . left ;
child_y = borders - > visible . top ;
frame_width = child_x + rect - > width + borders - > visible . right ;
frame_height = child_y + rect - > height + borders - > visible . bottom ;
2001-06-10 23:24:20 -04:00
}
else
{
child_x = 0 ;
child_y = 0 ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
frame_width = rect - > width ;
frame_height = rect - > height ;
2001-06-10 23:24:20 -04:00
}
2008-12-18 07:41:56 -05:00
2001-06-10 23:24:20 -04:00
/* We're computing position to pass to window_move, which is
* the position of the client window ( StaticGravity basically )
*
* ( see WM spec description of gravity computation , but note that
* their formulas assume we ' re honoring the border width , rather
* than compensating for having turned it off )
*/
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
switch ( gravity )
2001-06-10 23:24:20 -04:00
{
case NorthWestGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
ref_x = rect - > x ;
ref_y = rect - > y ;
2001-06-10 23:24:20 -04:00
break ;
case NorthGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
ref_x = rect - > x + rect - > width / 2 + bw ;
ref_y = rect - > y ;
2001-06-10 23:24:20 -04:00
break ;
case NorthEastGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
ref_x = rect - > x + rect - > width + bw * 2 ;
ref_y = rect - > y ;
2001-06-10 23:24:20 -04:00
break ;
case WestGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
ref_x = rect - > x ;
ref_y = rect - > y + rect - > height / 2 + bw ;
2001-06-10 23:24:20 -04:00
break ;
case CenterGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
ref_x = rect - > x + rect - > width / 2 + bw ;
ref_y = rect - > y + rect - > height / 2 + bw ;
2001-06-10 23:24:20 -04:00
break ;
case EastGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
ref_x = rect - > x + rect - > width + bw * 2 ;
ref_y = rect - > y + rect - > height / 2 + bw ;
2001-06-10 23:24:20 -04:00
break ;
case SouthWestGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
ref_x = rect - > x ;
ref_y = rect - > y + rect - > height + bw * 2 ;
2001-06-10 23:24:20 -04:00
break ;
case SouthGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
ref_x = rect - > x + rect - > width / 2 + bw ;
ref_y = rect - > y + rect - > height + bw * 2 ;
2001-06-10 23:24:20 -04:00
break ;
case SouthEastGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
ref_x = rect - > x + rect - > width + bw * 2 ;
ref_y = rect - > y + rect - > height + bw * 2 ;
2001-06-10 23:24:20 -04:00
break ;
case StaticGravity :
default :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
ref_x = rect - > x ;
ref_y = rect - > y ;
2001-06-10 23:24:20 -04:00
break ;
}
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
switch ( gravity )
2001-06-10 23:24:20 -04:00
{
case NorthWestGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
rect - > x = ref_x + child_x ;
rect - > y = ref_y + child_y ;
2001-06-10 23:24:20 -04:00
break ;
case NorthGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
rect - > x = ref_x - frame_width / 2 + child_x ;
rect - > y = ref_y + child_y ;
2001-06-10 23:24:20 -04:00
break ;
case NorthEastGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
rect - > x = ref_x - frame_width + child_x ;
rect - > y = ref_y + child_y ;
2001-06-10 23:24:20 -04:00
break ;
case WestGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
rect - > x = ref_x + child_x ;
rect - > y = ref_y - frame_height / 2 + child_y ;
2001-06-10 23:24:20 -04:00
break ;
case CenterGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
rect - > x = ref_x - frame_width / 2 + child_x ;
rect - > y = ref_y - frame_height / 2 + child_y ;
2001-06-10 23:24:20 -04:00
break ;
case EastGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
rect - > x = ref_x - frame_width + child_x ;
rect - > y = ref_y - frame_height / 2 + child_y ;
2001-06-10 23:24:20 -04:00
break ;
case SouthWestGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
rect - > x = ref_x + child_x ;
rect - > y = ref_y - frame_height + child_y ;
2001-06-10 23:24:20 -04:00
break ;
case SouthGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
rect - > x = ref_x - frame_width / 2 + child_x ;
rect - > y = ref_y - frame_height + child_y ;
2001-06-10 23:24:20 -04:00
break ;
case SouthEastGravity :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
rect - > x = ref_x - frame_width + child_x ;
rect - > y = ref_y - frame_height + child_y ;
2001-06-10 23:24:20 -04:00
break ;
case StaticGravity :
default :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
rect - > x = ref_x ;
rect - > y = ref_y ;
2001-06-10 23:24:20 -04:00
break ;
2001-06-07 22:17:48 -04:00
}
}
2002-01-19 18:59:11 -05:00
static gboolean
static_gravity_works ( MetaDisplay * display )
{
return display - > static_gravity_works ;
}
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
# ifdef HAVE_XSYNC
static void
send_sync_request ( MetaWindow * window )
{
XSyncValue value ;
XClientMessageEvent ev ;
window - > sync_request_serial + + ;
XSyncIntToValue ( & value , window - > sync_request_serial ) ;
2008-12-18 07:41:56 -05:00
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
ev . type = ClientMessage ;
ev . window = window - > xwindow ;
2008-05-02 14:49:01 -04:00
ev . message_type = window - > display - > atom_WM_PROTOCOLS ;
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
ev . format = 32 ;
2008-05-02 14:49:01 -04:00
ev . data . l [ 0 ] = window - > display - > atom__NET_WM_SYNC_REQUEST ;
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
/* FIXME: meta_display_get_current_time() is bad, but since calls
* come from meta_window_move_resize_internal ( which in turn come
* from all over ) , I ' m not sure what we can do to fix it . Do we
* want to use _roundtrip , though ?
*/
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
ev . data . l [ 1 ] = meta_display_get_current_time ( window - > display ) ;
ev . data . l [ 2 ] = XSyncValueLow32 ( value ) ;
ev . data . l [ 3 ] = XSyncValueHigh32 ( value ) ;
/* We don't need to trap errors here as we are already
* inside an error_trap_push ( ) / pop ( ) pair .
*/
XSendEvent ( window - > display - > xdisplay ,
window - > xwindow , False , 0 , ( XEvent * ) & ev ) ;
g_get_current_time ( & window - > sync_request_time ) ;
}
# endif
2010-09-10 05:55:20 -04:00
static gboolean
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
maybe_move_attached_dialog ( MetaWindow * window ,
void * data )
2010-09-10 05:55:20 -04:00
{
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
if ( meta_window_is_attached_dialog ( window ) )
2010-09-10 05:55:20 -04:00
/* It ignores x,y for such a dialog */
meta_window_move ( window , FALSE , 0 , 0 ) ;
return FALSE ;
}
2011-02-28 09:21:35 -05:00
/**
* meta_window_get_monitor :
* @ window : a # MetaWindow
*
* Gets index of the monitor that this window is on .
*
* Return Value : The index of the monitor in the screens monitor list
*/
int
meta_window_get_monitor ( MetaWindow * window )
{
return window - > monitor - > number ;
}
2011-05-20 04:56:12 -04:00
/* This is called when the monitor setup has changed. The window->monitor
* reference is still " valid " , but refer to the previous monitor setup */
2011-02-25 10:37:05 -05:00
void
2011-05-20 04:56:12 -04:00
meta_window_update_for_monitors_changed ( MetaWindow * window )
{
const MetaMonitorInfo * old , * new ;
int i ;
2012-10-04 13:57:49 -04:00
if ( window - > type = = META_WINDOW_DESKTOP )
return ;
2011-05-20 04:56:12 -04:00
old = window - > monitor ;
/* Start on primary */
new = & window - > screen - > monitor_infos [ window - > screen - > primary_monitor_index ] ;
/* But, if we can find the old output on a new monitor, use that */
for ( i = 0 ; i < window - > screen - > n_monitor_infos ; i + + )
{
MetaMonitorInfo * info = & window - > screen - > monitor_infos [ i ] ;
if ( info - > output = = old - > output )
{
new = info ;
break ;
}
}
2011-10-08 11:00:16 -04:00
if ( window - > tile_mode ! = META_TILE_NONE )
window - > tile_monitor_number = new - > number ;
2011-05-20 04:56:12 -04:00
/* This will eventually reach meta_window_update_monitor that
* will send leave / enter - monitor events . The old ! = new monitor
* check will always fail ( due to the new monitor_infos set ) so
* we will always send the events , even if the new and old monitor
* index is the same . That is right , since the enumeration of the
* monitors changed and the same index could be refereing
* to a different monitor . */
meta_window_move_between_rects ( window ,
& old - > rect ,
& new - > rect ) ;
}
static void
2011-02-25 10:37:05 -05:00
meta_window_update_monitor ( MetaWindow * window )
{
2011-02-28 07:48:28 -05:00
const MetaMonitorInfo * old ;
old = window - > monitor ;
2011-02-25 10:37:05 -05:00
window - > monitor = meta_screen_get_monitor_for_window ( window - > screen , window ) ;
2011-02-28 07:48:28 -05:00
if ( old ! = window - > monitor )
{
meta_window_update_on_all_workspaces ( window ) ;
/* If workspaces only on primary and we moved back to primary, ensure that the
* window is now in that workspace . We do this because while the window is on a
* non - primary monitor it is always visible , so it would be very jarring if it
* disappeared when it crossed the monitor border .
* The one time we want it to both change to the primary monitor and a non - active
* workspace is when dropping the window on some other workspace thumbnail directly .
* That should be handled by explicitly moving the window before changing the
* workspace
2011-05-20 04:56:12 -04:00
* Don ' t do this if old = = NULL , because thats what happens when starting up , and
* we don ' t want to move all windows around from a previous WM instance . Nor do
* we want it when moving from one primary monitor to another ( can happen during
* screen reconfiguration .
2011-02-28 07:48:28 -05:00
*/
if ( meta_prefs_get_workspaces_only_on_primary ( ) & &
meta_window_is_on_primary_monitor ( window ) & &
2011-05-20 04:56:12 -04:00
old ! = NULL & & ! old - > is_primary & &
2011-02-28 07:48:28 -05:00
window - > screen - > active_workspace ! = window - > workspace )
meta_window_change_workspace ( window , window - > screen - > active_workspace ) ;
2011-02-28 15:26:11 -05:00
if ( old )
g_signal_emit_by_name ( window - > screen , " window-left-monitor " , old - > number , window ) ;
g_signal_emit_by_name ( window - > screen , " window-entered-monitor " , window - > monitor - > number , window ) ;
2012-03-12 23:18:03 -04:00
/* If we're changing monitors, we need to update the has_maximize_func flag,
* as the working area has changed . */
recalc_window_features ( window ) ;
2011-02-28 07:48:28 -05:00
}
2011-02-25 10:37:05 -05:00
}
2001-06-07 22:17:48 -04:00
static void
2007-04-09 19:00:55 -04:00
meta_window_move_resize_internal ( MetaWindow * window ,
MetaMoveResizeFlags flags ,
int gravity ,
int root_x_nw ,
int root_y_nw ,
int w ,
int h )
2001-06-09 17:58:30 -04:00
{
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* meta_window_move_resize_internal gets called with very different
2007-04-09 19:00:55 -04:00
* meanings for root_x_nw and root_y_nw . w & h are always the area
* of the inner or client window ( i . e . excluding the frame ) and
* gravity is the relevant gravity associated with the request ( note
* that gravity is ignored for move - only operations unless its
* e . g . a configure request ) . The location is different for
* different cases because of how this function gets called ; note
* that in all cases what we want to find out is the upper left
* corner of the position of the inner window :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
*
2007-04-09 19:00:55 -04:00
* Case | Called from ( flags ; gravity )
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
* - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* 1 | A resize only ConfigureRequest
* 1 | meta_window_resize
* 1 | meta_window_resize_with_gravity
* 2 | New window
* 2 | Session restore
2007-04-09 19:00:55 -04:00
* 2 | A not - resize - only ConfigureRequest / net_moveresize_window request
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
* 3 | meta_window_move
* 3 | meta_window_move_resize
*
* For each of the cases , root_x_nw and root_y_nw must be treated as follows :
*
* ( 1 ) They should be entirely ignored ; instead the previous position
* and size of the window should be resized according to the given
* gravity in order to determine the new position of the window .
* ( 2 ) Needs to be fixed up by adjust_for_gravity ( ) as these
* coordinates are relative to some corner or side of the outer
* window ( except for the case of StaticGravity ) and we want to
* know the location of the upper left corner of the inner window .
* ( 3 ) These values are already the desired positon of the NW corner
* of the inner window
*/
2001-06-09 17:58:30 -04:00
XWindowChanges values ;
unsigned int mask ;
gboolean need_configure_notify ;
2011-07-12 00:37:41 -04:00
MetaFrameBorders borders ;
2001-06-09 23:17:15 -04:00
gboolean need_move_client = FALSE ;
gboolean need_move_frame = FALSE ;
gboolean need_resize_client = FALSE ;
gboolean need_resize_frame = FALSE ;
2003-11-08 12:25:49 -05:00
int size_dx ;
int size_dy ;
2011-03-22 15:36:12 -04:00
gboolean frame_shape_changed = FALSE ;
2001-08-28 23:37:03 -04:00
gboolean is_configure_request ;
gboolean do_gravity_adjust ;
2001-09-10 22:57:05 -04:00
gboolean is_user_action ;
2002-01-19 18:59:11 -05:00
gboolean configure_frame_first ;
gboolean use_static_gravity ;
/* used for the configure request, but may not be final
* destination due to StaticGravity etc .
*/
int client_move_x ;
int client_move_y ;
2003-03-08 18:43:17 -05:00
MetaRectangle new_rect ;
MetaRectangle old_rect ;
2008-12-18 07:41:56 -05:00
2009-06-15 18:25:07 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2001-08-28 23:37:03 -04:00
is_configure_request = ( flags & META_IS_CONFIGURE_REQUEST ) ! = 0 ;
do_gravity_adjust = ( flags & META_DO_GRAVITY_ADJUST ) ! = 0 ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
is_user_action = ( flags & META_IS_USER_ACTION ) ! = 0 ;
/* The action has to be a move or a resize or both... */
g_assert ( flags & ( META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION ) ) ;
2008-12-18 07:41:56 -05:00
2002-05-29 00:14:15 -04:00
/* We don't need it in the idle queue anymore. */
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_unqueue ( window , META_QUEUE_MOVE_RESIZE ) ;
2003-02-23 12:09:46 -05:00
2007-04-08 23:43:55 -04:00
meta_window_get_client_root_coords ( window , & old_rect ) ;
2008-12-18 07:41:56 -05:00
2003-03-08 18:43:17 -05:00
meta_topic ( META_DEBUG_GEOMETRY ,
" Move/resize %s to %d,%d %dx%d%s%s from %d,%d %dx%d \n " ,
window - > desc , root_x_nw , root_y_nw , w , h ,
is_configure_request ? " (configure request) " : " " ,
is_user_action ? " (user move/resize) " : " " ,
old_rect . x , old_rect . y , old_rect . width , old_rect . height ) ;
2008-12-18 07:41:56 -05:00
2012-03-12 23:11:07 -04:00
meta_frame_calc_borders ( window - > frame ,
& borders ) ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
new_rect . x = root_x_nw ;
new_rect . y = root_y_nw ;
new_rect . width = w ;
new_rect . height = h ;
/* If this is a resize only, the position should be ignored and
* instead obtained by resizing the old rectangle according to the
* relevant gravity .
*/
2008-12-18 07:41:56 -05:00
if ( ( flags & ( META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION ) ) = =
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
META_IS_RESIZE_ACTION )
2008-12-18 07:41:56 -05:00
{
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
meta_rectangle_resize_with_gravity ( & old_rect ,
& new_rect ,
2007-04-09 19:00:55 -04:00
gravity ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
new_rect . width ,
new_rect . height ) ;
meta_topic ( META_DEBUG_GEOMETRY ,
" Compensated for gravity in resize action; new pos %d,%d \n " ,
new_rect . x , new_rect . y ) ;
}
else if ( is_configure_request | | do_gravity_adjust )
2008-12-18 07:41:56 -05:00
{
2003-03-08 18:43:17 -05:00
adjust_for_gravity ( window ,
2011-07-12 00:37:41 -04:00
window - > frame ? & borders : NULL ,
2003-03-08 18:43:17 -05:00
/* configure request coords assume
* the border width existed
*/
is_configure_request ,
2007-04-09 19:00:55 -04:00
gravity ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
& new_rect ) ;
2003-03-08 18:43:17 -05:00
meta_topic ( META_DEBUG_GEOMETRY ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
" Compensated for configure_request/do_gravity_adjust needing "
" weird positioning; new pos %d,%d \n " ,
new_rect . x , new_rect . y ) ;
2003-03-08 18:43:17 -05:00
}
2001-06-09 23:17:15 -04:00
2003-03-08 18:43:17 -05:00
meta_window_constrain ( window ,
2011-07-12 00:37:41 -04:00
window - > frame ? & borders : NULL ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
flags ,
2007-04-09 19:00:55 -04:00
gravity ,
2003-03-08 18:43:17 -05:00
& old_rect ,
& new_rect ) ;
2003-06-25 23:09:38 -04:00
2003-03-08 18:43:17 -05:00
w = new_rect . width ;
h = new_rect . height ;
root_x_nw = new_rect . x ;
root_y_nw = new_rect . y ;
2008-12-18 07:41:56 -05:00
2001-06-09 23:17:15 -04:00
if ( w ! = window - > rect . width | |
h ! = window - > rect . height )
2008-12-18 07:41:56 -05:00
need_resize_client = TRUE ;
2001-06-09 23:17:15 -04:00
window - > rect . width = w ;
window - > rect . height = h ;
2008-12-18 07:41:56 -05:00
2001-06-09 17:58:30 -04:00
if ( window - > frame )
{
2012-04-26 10:05:20 -04:00
int frame_size_dx , frame_size_dy ;
2001-06-09 17:58:30 -04:00
int new_w , new_h ;
2011-07-03 13:58:25 -04:00
new_w = window - > rect . width + borders . total . left + borders . total . right ;
2001-06-09 17:58:30 -04:00
if ( window - > shaded )
2011-07-03 13:58:25 -04:00
new_h = borders . total . top ;
2001-06-09 17:58:30 -04:00
else
2011-07-03 13:58:25 -04:00
new_h = window - > rect . height + borders . total . top + borders . total . bottom ;
2001-06-09 17:58:30 -04:00
2001-06-30 19:17:52 -04:00
frame_size_dx = new_w - window - > frame - > rect . width ;
frame_size_dy = new_h - window - > frame - > rect . height ;
2002-01-19 18:59:11 -05:00
need_resize_frame = ( frame_size_dx ! = 0 | | frame_size_dy ! = 0 ) ;
2008-12-18 07:41:56 -05:00
2001-06-09 17:58:30 -04:00
window - > frame - > rect . width = new_w ;
window - > frame - > rect . height = new_h ;
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_GEOMETRY ,
" Calculated frame size %dx%d \n " ,
window - > frame - > rect . width ,
window - > frame - > rect . height ) ;
2001-06-09 23:17:15 -04:00
}
2001-06-10 23:24:20 -04:00
2002-01-19 18:59:11 -05:00
/* For nice effect, when growing the window we want to move/resize
* the frame first , when shrinking the window we want to move / resize
* the client first . If we grow one way and shrink the other ,
* see which way we ' re moving " more "
*
* Mail from Owen subject " Suggestion: Gravity and resizing from the left "
* http : //mail.gnome.org/archives/wm-spec-list/1999-November/msg00088.html
*
* An annoying fact you need to know in this code is that StaticGravity
* does nothing if you _only_ resize or _only_ move the frame ;
* it must move _and_ resize , otherwise you get NorthWestGravity
* behavior . The move and resize must actually occur , it is not
* enough to set CWX | CWWidth but pass in the current size / pos .
*/
2008-12-18 07:41:56 -05:00
2001-06-09 23:17:15 -04:00
if ( window - > frame )
{
int new_x , new_y ;
2002-01-19 18:59:11 -05:00
int frame_pos_dx , frame_pos_dy ;
2008-12-18 07:41:56 -05:00
2002-01-19 18:59:11 -05:00
/* Compute new frame coords */
2011-07-03 13:58:25 -04:00
new_x = root_x_nw - borders . total . left ;
new_y = root_y_nw - borders . total . top ;
2001-06-07 22:17:48 -04:00
2002-01-19 18:59:11 -05:00
frame_pos_dx = new_x - window - > frame - > rect . x ;
frame_pos_dy = new_y - window - > frame - > rect . y ;
2001-06-09 23:17:15 -04:00
2002-01-19 18:59:11 -05:00
need_move_frame = ( frame_pos_dx ! = 0 | | frame_pos_dy ! = 0 ) ;
2008-12-18 07:41:56 -05:00
2001-06-09 23:17:15 -04:00
window - > frame - > rect . x = new_x ;
2008-12-18 07:41:56 -05:00
window - > frame - > rect . y = new_y ;
2002-01-19 18:59:11 -05:00
/* If frame will both move and resize, then StaticGravity
* on the child window will kick in and implicitly move
* the child with respect to the frame . The implicit
* move will keep the child in the same place with
* respect to the root window . If frame only moves
* or only resizes , then the child will just move along
* with the frame .
*/
2001-06-09 23:17:15 -04:00
/* window->rect.x, window->rect.y are relative to frame,
* remember they are the server coords
*/
2008-12-18 07:41:56 -05:00
2011-07-03 13:58:25 -04:00
new_x = borders . total . left ;
new_y = borders . total . top ;
2002-01-19 18:59:11 -05:00
if ( need_resize_frame & & need_move_frame & &
static_gravity_works ( window - > display ) )
{
/* static gravity kicks in because frame
* is both moved and resized
*/
/* when we move the frame by frame_pos_dx, frame_pos_dy the
* client will implicitly move relative to frame by the
* inverse delta .
2008-12-18 07:41:56 -05:00
*
2002-01-19 18:59:11 -05:00
* When moving client then frame , we move the client by the
* frame delta , to be canceled out by the implicit move by
* the inverse frame delta , resulting in a client at new_x ,
* new_y .
*
* When moving frame then client , we move the client
* by the same delta as the frame , because the client
* was " left behind " by the frame - resulting in a client
* at new_x , new_y .
*
* In both cases we need to move the client window
* in all cases where we had to move the frame window .
*/
2008-12-18 07:41:56 -05:00
2002-01-19 18:59:11 -05:00
client_move_x = new_x + frame_pos_dx ;
client_move_y = new_y + frame_pos_dy ;
if ( need_move_frame )
need_move_client = TRUE ;
use_static_gravity = TRUE ;
}
else
{
client_move_x = new_x ;
client_move_y = new_y ;
if ( client_move_x ! = window - > rect . x | |
client_move_y ! = window - > rect . y )
need_move_client = TRUE ;
use_static_gravity = FALSE ;
}
/* This is the final target position, but not necessarily what
* we pass to XConfigureWindow , due to StaticGravity implicit
* movement .
2008-12-18 07:41:56 -05:00
*/
2002-01-19 18:59:11 -05:00
window - > rect . x = new_x ;
window - > rect . y = new_y ;
2001-06-09 23:17:15 -04:00
}
else
{
if ( root_x_nw ! = window - > rect . x | |
root_y_nw ! = window - > rect . y )
need_move_client = TRUE ;
2008-12-18 07:41:56 -05:00
2001-06-09 23:17:15 -04:00
window - > rect . x = root_x_nw ;
window - > rect . y = root_y_nw ;
2002-01-19 18:59:11 -05:00
client_move_x = window - > rect . x ;
client_move_y = window - > rect . y ;
use_static_gravity = FALSE ;
2001-06-06 00:47:37 -04:00
}
2001-06-07 22:17:48 -04:00
2004-01-10 12:16:07 -05:00
/* If frame extents have changed, fill in other frame fields and
change frame ' s extents property . */
if ( window - > frame & &
2011-07-03 13:58:25 -04:00
( window - > frame - > child_x ! = borders . total . left | |
window - > frame - > child_y ! = borders . total . top | |
window - > frame - > right_width ! = borders . total . right | |
window - > frame - > bottom_height ! = borders . total . bottom ) )
{
window - > frame - > child_x = borders . total . left ;
window - > frame - > child_y = borders . total . top ;
window - > frame - > right_width = borders . total . right ;
window - > frame - > bottom_height = borders . total . bottom ;
2004-01-10 12:16:07 -05:00
update_net_frame_extents ( window ) ;
2001-06-07 22:17:48 -04:00
}
2004-01-10 12:16:07 -05:00
2001-06-12 20:56:08 -04:00
/* See ICCCM 4.1.5 for when to send ConfigureNotify */
2008-12-18 07:41:56 -05:00
2001-06-12 20:56:08 -04:00
need_configure_notify = FALSE ;
2008-12-18 07:41:56 -05:00
2001-06-09 17:58:30 -04:00
/* If this is a configure request and we change nothing, then we
2001-06-12 20:56:08 -04:00
* must send configure notify .
2001-06-09 17:58:30 -04:00
*/
2001-06-12 20:56:08 -04:00
if ( is_configure_request & &
! ( need_move_client | | need_move_frame | |
need_resize_client | | need_resize_frame | |
window - > border_width ! = 0 ) )
need_configure_notify = TRUE ;
/* We must send configure notify if we move but don't resize, since
* the client window may not get a real event
*/
if ( ( need_move_client | | need_move_frame ) & &
! ( need_resize_client | | need_resize_frame ) )
need_configure_notify = TRUE ;
2007-04-04 19:52:21 -04:00
/* MapRequest events with a PPosition or UPosition hint with a frame
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
* are moved by mutter without resizing ; send a configure notify
2007-04-04 19:52:21 -04:00
* in such cases . See # 322840. ( Note that window - > constructing is
* only true iff this call is due to a MapRequest , and when
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
* PPosition / UPosition hints aren ' t set , mutter seems to send a
2007-04-04 19:52:21 -04:00
* ConfigureNotify anyway due to the above code . )
*/
if ( window - > constructing & & window - > frame & &
( ( window - > size_hints . flags & PPosition ) | |
( window - > size_hints . flags & USPosition ) ) )
need_configure_notify = TRUE ;
2008-12-18 07:41:56 -05:00
2001-06-30 19:17:52 -04:00
/* The rest of this function syncs our new size/pos with X as
* efficiently as possible
*/
2002-01-19 18:59:11 -05:00
2003-11-08 12:25:49 -05:00
/* configure frame first if we grow more than we shrink
*/
size_dx = w - window - > rect . width ;
size_dy = h - window - > rect . height ;
configure_frame_first = ( size_dx + size_dy > = 0 ) ;
2002-01-19 18:59:11 -05:00
if ( use_static_gravity )
2008-12-18 07:41:56 -05:00
meta_window_set_gravity ( window , StaticGravity ) ;
2002-01-19 18:59:11 -05:00
if ( configure_frame_first & & window - > frame )
2011-03-22 15:36:12 -04:00
frame_shape_changed = meta_frame_sync_to_window ( window - > frame ,
gravity ,
need_move_frame , need_resize_frame ) ;
2002-01-19 18:59:11 -05:00
2001-06-09 17:58:30 -04:00
values . border_width = 0 ;
2002-01-19 18:59:11 -05:00
values . x = client_move_x ;
values . y = client_move_y ;
2001-06-09 17:58:30 -04:00
values . width = window - > rect . width ;
values . height = window - > rect . height ;
2008-12-18 07:41:56 -05:00
2001-06-09 17:58:30 -04:00
mask = 0 ;
if ( is_configure_request & & window - > border_width ! = 0 )
mask | = CWBorderWidth ; /* must force to 0 */
2001-06-09 23:17:15 -04:00
if ( need_move_client )
2001-06-09 17:58:30 -04:00
mask | = ( CWX | CWY ) ;
2001-06-09 23:17:15 -04:00
if ( need_resize_client )
2001-06-09 17:58:30 -04:00
mask | = ( CWWidth | CWHeight ) ;
if ( mask ! = 0 )
2001-06-07 22:17:48 -04:00
{
2001-06-12 20:56:08 -04:00
{
int newx , newy ;
meta_window_get_position ( window , & newx , & newy ) ;
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_GEOMETRY ,
" Syncing new client geometry %d,%d %dx%d, border: %s pos: %s size: %s \n " ,
newx , newy ,
window - > rect . width , window - > rect . height ,
mask & CWBorderWidth ? " true " : " false " ,
need_move_client ? " true " : " false " ,
need_resize_client ? " true " : " false " ) ;
2001-06-12 20:56:08 -04:00
}
2008-12-18 07:41:56 -05:00
2001-06-09 17:58:30 -04:00
meta_error_trap_push ( window - > display ) ;
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
2004-08-08 12:18:52 -04:00
# ifdef HAVE_XSYNC
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
if ( window - > sync_request_counter ! = None & &
window - > display - > grab_sync_request_alarm ! = None & &
window - > sync_request_time . tv_usec = = 0 & &
window - > sync_request_time . tv_sec = = 0 )
{
2008-12-18 07:41:56 -05:00
/* turn off updating */
2006-02-15 14:50:12 -05:00
if ( window - > display - > compositor )
meta_compositor_set_updates ( window - > display - > compositor , window , FALSE ) ;
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
send_sync_request ( window ) ;
}
2004-08-08 12:18:52 -04:00
# endif
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
2001-06-09 17:58:30 -04:00
XConfigureWindow ( window - > display - > xdisplay ,
window - > xwindow ,
mask ,
& values ) ;
2008-12-18 07:41:56 -05:00
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2001-06-07 22:17:48 -04:00
}
2002-01-19 18:59:11 -05:00
if ( ! configure_frame_first & & window - > frame )
2011-03-22 15:36:12 -04:00
frame_shape_changed = meta_frame_sync_to_window ( window - > frame ,
gravity ,
need_move_frame , need_resize_frame ) ;
2001-09-10 22:57:05 -04:00
2002-01-19 18:59:11 -05:00
/* Put gravity back to be nice to lesser window managers */
if ( use_static_gravity )
2008-12-18 07:41:56 -05:00
meta_window_set_gravity ( window , NorthWestGravity ) ;
2001-06-09 17:58:30 -04:00
if ( need_configure_notify )
send_configure_notify ( window ) ;
2001-06-09 23:17:15 -04:00
2010-01-20 10:59:07 -05:00
if ( ! window - > placed & & window - > force_save_user_rect & & ! window - > fullscreen )
2008-08-15 23:09:40 -04:00
force_save_user_window_placement ( window ) ;
else if ( is_user_action )
save_user_window_placement ( window ) ;
2001-09-10 22:57:05 -04:00
if ( need_move_frame | | need_resize_frame | |
need_move_client | | need_resize_client )
{
int newx , newy ;
meta_window_get_position ( window , & newx , & newy ) ;
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_GEOMETRY ,
" New size/position %d,%d %dx%d (user %d,%d %dx%d) \n " ,
newx , newy , window - > rect . width , window - > rect . height ,
window - > user_rect . x , window - > user_rect . y ,
window - > user_rect . width , window - > user_rect . height ) ;
2009-06-25 16:17:27 -04:00
if ( window - > display - > compositor )
meta_compositor_sync_window_geometry ( window - > display - > compositor ,
window ) ;
2001-09-10 22:57:05 -04:00
}
else
{
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_GEOMETRY , " Size/position not modified \n " ) ;
2001-09-10 22:57:05 -04:00
}
2008-12-18 07:41:56 -05:00
2009-05-07 13:53:47 -04:00
meta_window_refresh_resize_popup ( window ) ;
2008-12-18 07:41:56 -05:00
2011-02-25 10:37:05 -05:00
meta_window_update_monitor ( window ) ;
2001-06-09 23:17:15 -04:00
/* Invariants leaving this function are:
* a ) window - > rect and frame - > rect reflect the actual
* server - side size / pos of window - > xwindow and frame - > xwindow
* b ) all constraints are obeyed by window - > rect and frame - > rect
*/
2010-09-10 05:55:20 -04:00
2011-03-22 15:36:12 -04:00
if ( frame_shape_changed & & window - > frame_bounds )
{
cairo_region_destroy ( window - > frame_bounds ) ;
window - > frame_bounds = NULL ;
}
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
meta_window_foreach_transient ( window , maybe_move_attached_dialog , NULL ) ;
2012-02-24 11:08:55 -05:00
meta_stack_update_window_tile_matches ( window - > screen - > stack ,
window - > screen - > active_workspace ) ;
2001-06-07 22:17:48 -04:00
}
2011-03-09 10:01:44 -05:00
/**
* meta_window_resize :
* @ window : a # MetaWindow
* @ user_op : bool to indicate whether or not this is a user operation
* @ w : desired width
* @ h : desired height
*
* Resize the window to the desired size .
*/
2001-06-07 22:17:48 -04:00
void
meta_window_resize ( MetaWindow * window ,
2001-08-28 23:37:03 -04:00
gboolean user_op ,
2001-06-07 22:17:48 -04:00
int w ,
int h )
{
2001-06-09 23:17:15 -04:00
int x , y ;
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
2006-01-02 Elijah Newren <newren@gmail.com>
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
* src/boxes.c (meta_rectangle_region_to_string,
meta_rectangle_edge_list_to_string, fix_up_edges):
* src/constraints.c (meta_window_constrain, setup_constraint_info,
place_window_if_needed, constrain_maximization,
constrain_fullscreen, constrain_size_increments,
constrain_size_limits, constrain_aspect_ratio,
do_screen_and_xinerama_relative_constrai,
constrain_to_single_xinerama, constrain_fully_onscreen,
constrain_partially_onscreen):
* src/edge-resistance.c (find_nearest_position,
apply_edge_resistance, apply_edge_resistance_to_each_side):
* src/testboxes.c (test_clamping_to_region,
test_clipping_to_region, test_shoving_into_region):
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_resize,
meta_window_resize_with_gravity, meta_window_configure_request):
Remove C99 style variable initiailization
2006-01-02 13:37:46 -05:00
MetaMoveResizeFlags flags ;
2001-06-09 23:17:15 -04:00
2009-06-15 18:25:07 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2001-06-09 23:17:15 -04:00
meta_window_get_position ( window , & x , & y ) ;
2008-12-18 07:41:56 -05:00
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
2006-01-02 Elijah Newren <newren@gmail.com>
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
* src/boxes.c (meta_rectangle_region_to_string,
meta_rectangle_edge_list_to_string, fix_up_edges):
* src/constraints.c (meta_window_constrain, setup_constraint_info,
place_window_if_needed, constrain_maximization,
constrain_fullscreen, constrain_size_increments,
constrain_size_limits, constrain_aspect_ratio,
do_screen_and_xinerama_relative_constrai,
constrain_to_single_xinerama, constrain_fully_onscreen,
constrain_partially_onscreen):
* src/edge-resistance.c (find_nearest_position,
apply_edge_resistance, apply_edge_resistance_to_each_side):
* src/testboxes.c (test_clamping_to_region,
test_clipping_to_region, test_shoving_into_region):
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_resize,
meta_window_resize_with_gravity, meta_window_configure_request):
Remove C99 style variable initiailization
2006-01-02 13:37:46 -05:00
flags = ( user_op ? META_IS_USER_ACTION : 0 ) | META_IS_RESIZE_ACTION ;
2001-08-28 23:37:03 -04:00
meta_window_move_resize_internal ( window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
flags ,
2001-06-30 19:17:52 -04:00
NorthWestGravity ,
x , y , w , h ) ;
2001-06-07 22:17:48 -04:00
}
2011-03-09 10:01:44 -05:00
/**
* meta_window_move :
* @ window : a # MetaWindow
* @ user_op : bool to indicate whether or not this is a user operation
* @ root_x_nw : desired x pos
* @ root_y_nw : desired y pos
*
* Moves the window to the desired location on window ' s assigned workspace .
* NOTE : does NOT place according to the origin of the enclosing
* frame / window - decoration , but according to the origin of the window ,
* itself .
*/
2001-06-07 22:17:48 -04:00
void
meta_window_move ( MetaWindow * window ,
2001-08-28 23:37:03 -04:00
gboolean user_op ,
2001-06-07 22:17:48 -04:00
int root_x_nw ,
int root_y_nw )
{
2009-06-15 18:25:07 -04:00
MetaMoveResizeFlags flags ;
g_return_if_fail ( ! window - > override_redirect ) ;
flags = ( user_op ? META_IS_USER_ACTION : 0 ) | META_IS_MOVE_ACTION ;
2001-08-28 23:37:03 -04:00
meta_window_move_resize_internal ( window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
flags ,
2001-06-30 19:17:52 -04:00
NorthWestGravity ,
2001-06-09 23:17:15 -04:00
root_x_nw , root_y_nw ,
window - > rect . width ,
window - > rect . height ) ;
2001-06-07 22:17:48 -04:00
}
2011-03-09 10:01:44 -05:00
/**
* meta_window_move_frame :
* @ window : a # MetaWindow
* @ user_op : bool to indicate whether or not this is a user operation
* @ root_x_nw : desired x pos
* @ root_y_nw : desired y pos
*
* Moves the window to the desired location on window ' s assigned
* workspace , using the northwest edge of the frame as the reference ,
* instead of the actual window ' s origin , but only if a frame is present .
* Otherwise , acts identically to meta_window_move ( ) .
*/
void
meta_window_move_frame ( MetaWindow * window ,
gboolean user_op ,
int root_x_nw ,
int root_y_nw )
{
int x = root_x_nw ;
int y = root_y_nw ;
2012-03-12 23:11:07 -04:00
2012-05-01 13:40:08 -04:00
if ( window - > frame )
{
MetaFrameBorders borders ;
meta_frame_calc_borders ( window - > frame , & borders ) ;
2011-09-20 17:45:19 -04:00
2012-05-01 13:40:08 -04:00
/* root_x_nw and root_y_nw correspond to where the top of
* the visible frame should be . Offset by the distance between
* the origin of the window and the origin of the enclosing
* window decorations .
*/
x + = window - > frame - > child_x - borders . invisible . left ;
y + = window - > frame - > child_y - borders . invisible . top ;
}
2011-03-09 10:01:44 -05:00
meta_window_move ( window , user_op , x , y ) ;
}
2001-06-07 22:17:48 -04:00
2011-05-20 04:56:12 -04:00
static void
meta_window_move_between_rects ( MetaWindow * window ,
const MetaRectangle * old_area ,
const MetaRectangle * new_area )
{
int rel_x , rel_y ;
double scale_x , scale_y ;
rel_x = window - > user_rect . x - old_area - > x ;
rel_y = window - > user_rect . y - old_area - > y ;
scale_x = ( double ) new_area - > width / old_area - > width ;
scale_y = ( double ) new_area - > height / old_area - > height ;
window - > user_rect . x = new_area - > x + rel_x * scale_x ;
window - > user_rect . y = new_area - > y + rel_y * scale_y ;
window - > saved_rect . x = window - > user_rect . x ;
window - > saved_rect . y = window - > user_rect . y ;
meta_window_move_resize ( window , FALSE ,
window - > user_rect . x ,
window - > user_rect . y ,
window - > user_rect . width ,
window - > user_rect . height ) ;
}
2011-06-04 21:02:44 -04:00
/**
* meta_window_move_resize_frame :
* @ window : a # MetaWindow
* @ user_op : bool to indicate whether or not this is a user operation
* @ root_x_nw : new x
* @ root_y_nw : new y
* @ w : desired width
* @ h : desired height
*
* Resizes the window so that its outer bounds ( including frame )
* fit within the given rect
*/
void
meta_window_move_resize_frame ( MetaWindow * window ,
gboolean user_op ,
int root_x_nw ,
int root_y_nw ,
int w ,
int h )
{
2012-03-12 23:11:07 -04:00
MetaFrameBorders borders ;
meta_frame_calc_borders ( window - > frame , & borders ) ;
/* offset by the distance between the origin of the window
* and the origin of the enclosing window decorations ( + border )
*/
root_x_nw + = borders . visible . left ;
root_y_nw + = borders . visible . top ;
w - = borders . visible . left + borders . visible . right ;
h - = borders . visible . top + borders . visible . bottom ;
2011-06-04 21:02:44 -04:00
meta_window_move_resize ( window , user_op , root_x_nw , root_y_nw , w , h ) ;
}
2011-03-21 07:36:01 -04:00
/**
* meta_window_move_to_monitor :
* @ window : a # MetaWindow
* @ monitor : desired monitor index
*
* Moves the window to the monitor with index @ monitor , keeping
* the relative position of the window ' s top left corner .
*/
void
meta_window_move_to_monitor ( MetaWindow * window ,
int monitor )
{
MetaRectangle old_area , new_area ;
if ( monitor = = window - > monitor - > number )
return ;
meta_window_get_work_area_for_monitor ( window ,
window - > monitor - > number ,
& old_area ) ;
meta_window_get_work_area_for_monitor ( window ,
monitor ,
& new_area ) ;
2011-10-08 11:00:16 -04:00
if ( window - > tile_mode ! = META_TILE_NONE )
window - > tile_monitor_number = monitor ;
2011-05-20 04:56:12 -04:00
meta_window_move_between_rects ( window , & old_area , & new_area ) ;
2011-03-21 07:36:01 -04:00
}
2001-06-07 22:17:48 -04:00
void
meta_window_move_resize ( MetaWindow * window ,
2001-08-28 23:37:03 -04:00
gboolean user_op ,
2001-06-07 22:17:48 -04:00
int root_x_nw ,
int root_y_nw ,
int w ,
int h )
{
2009-06-15 18:25:07 -04:00
MetaMoveResizeFlags flags ;
g_return_if_fail ( ! window - > override_redirect ) ;
flags = ( user_op ? META_IS_USER_ACTION : 0 ) |
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION ;
2001-08-28 23:37:03 -04:00
meta_window_move_resize_internal ( window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
flags ,
2001-06-30 19:17:52 -04:00
NorthWestGravity ,
2001-06-07 22:17:48 -04:00
root_x_nw , root_y_nw ,
w , h ) ;
2001-06-06 00:47:37 -04:00
}
2001-06-30 19:17:52 -04:00
void
meta_window_resize_with_gravity ( MetaWindow * window ,
2001-08-28 23:37:03 -04:00
gboolean user_op ,
2001-06-30 19:17:52 -04:00
int w ,
int h ,
int gravity )
{
int x , y ;
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
2006-01-02 Elijah Newren <newren@gmail.com>
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
* src/boxes.c (meta_rectangle_region_to_string,
meta_rectangle_edge_list_to_string, fix_up_edges):
* src/constraints.c (meta_window_constrain, setup_constraint_info,
place_window_if_needed, constrain_maximization,
constrain_fullscreen, constrain_size_increments,
constrain_size_limits, constrain_aspect_ratio,
do_screen_and_xinerama_relative_constrai,
constrain_to_single_xinerama, constrain_fully_onscreen,
constrain_partially_onscreen):
* src/edge-resistance.c (find_nearest_position,
apply_edge_resistance, apply_edge_resistance_to_each_side):
* src/testboxes.c (test_clamping_to_region,
test_clipping_to_region, test_shoving_into_region):
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_resize,
meta_window_resize_with_gravity, meta_window_configure_request):
Remove C99 style variable initiailization
2006-01-02 13:37:46 -05:00
MetaMoveResizeFlags flags ;
2001-06-30 19:17:52 -04:00
meta_window_get_position ( window , & x , & y ) ;
2008-12-18 07:41:56 -05:00
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
2006-01-02 Elijah Newren <newren@gmail.com>
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
* src/boxes.c (meta_rectangle_region_to_string,
meta_rectangle_edge_list_to_string, fix_up_edges):
* src/constraints.c (meta_window_constrain, setup_constraint_info,
place_window_if_needed, constrain_maximization,
constrain_fullscreen, constrain_size_increments,
constrain_size_limits, constrain_aspect_ratio,
do_screen_and_xinerama_relative_constrai,
constrain_to_single_xinerama, constrain_fully_onscreen,
constrain_partially_onscreen):
* src/edge-resistance.c (find_nearest_position,
apply_edge_resistance, apply_edge_resistance_to_each_side):
* src/testboxes.c (test_clamping_to_region,
test_clipping_to_region, test_shoving_into_region):
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_resize,
meta_window_resize_with_gravity, meta_window_configure_request):
Remove C99 style variable initiailization
2006-01-02 13:37:46 -05:00
flags = ( user_op ? META_IS_USER_ACTION : 0 ) | META_IS_RESIZE_ACTION ;
2001-08-28 23:37:03 -04:00
meta_window_move_resize_internal ( window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
flags ,
2001-06-30 19:17:52 -04:00
gravity ,
x , y , w , h ) ;
}
2006-01-20 17:03:56 -05:00
static void
2001-06-24 04:09:10 -04:00
meta_window_move_resize_now ( MetaWindow * window )
2001-06-09 17:58:30 -04:00
{
2007-04-08 23:43:55 -04:00
/* If constraints have changed then we want to snap back to wherever
* the user had the window . We use user_rect for this reason . See
* also bug 426519 comment 3.
2002-04-21 23:10:53 -04:00
*/
2007-04-08 23:43:55 -04:00
meta_window_move_resize ( window , FALSE ,
window - > user_rect . x ,
window - > user_rect . y ,
window - > user_rect . width ,
window - > user_rect . height ) ;
2001-06-09 17:58:30 -04:00
}
2002-01-18 22:50:03 -05:00
static gboolean
idle_move_resize ( gpointer data )
{
GSList * tmp ;
GSList * copy ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
guint queue_index = GPOINTER_TO_INT ( data ) ;
2002-01-18 22:50:03 -05:00
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_GEOMETRY , " Clearing the move_resize queue \n " ) ;
2002-01-18 22:50:03 -05:00
/* Work with a copy, for reentrancy. The allowed reentrancy isn't
* complete ; destroying a window while we ' re in here would result in
* badness . But it ' s OK to queue / unqueue move_resizes .
*/
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
copy = g_slist_copy ( queue_pending [ queue_index ] ) ;
g_slist_free ( queue_pending [ queue_index ] ) ;
queue_pending [ queue_index ] = NULL ;
2009-09-25 15:47:22 -04:00
queue_later [ queue_index ] = 0 ;
2002-01-18 22:50:03 -05:00
destroying_windows_disallowed + = 1 ;
2008-12-18 07:41:56 -05:00
2002-01-18 22:50:03 -05:00
tmp = copy ;
while ( tmp ! = NULL )
{
MetaWindow * window ;
window = tmp - > data ;
/* As a side effect, sets window->move_resize_queued = FALSE */
2008-12-18 07:41:56 -05:00
meta_window_move_resize_now ( window ) ;
2002-01-18 22:50:03 -05:00
tmp = tmp - > next ;
}
g_slist_free ( copy ) ;
destroying_windows_disallowed - = 1 ;
2008-12-18 07:41:56 -05:00
2002-01-18 22:50:03 -05:00
return FALSE ;
}
2010-09-01 15:39:53 -04:00
/**
* meta_window_configure_notify : ( skip )
* @ window : a # MetaWindow
* @ event : a # XConfigureEvent
*
* This is used to notify us of an unrequested configuration
* ( only applicable to override redirect windows )
*/
2008-11-23 14:28:40 -05:00
void
2010-09-01 15:39:53 -04:00
meta_window_configure_notify ( MetaWindow * window ,
XConfigureEvent * event )
2008-11-23 14:28:40 -05:00
{
g_assert ( window - > override_redirect ) ;
g_assert ( window - > frame = = NULL ) ;
window - > rect . x = event - > x ;
window - > rect . y = event - > y ;
window - > rect . width = event - > width ;
window - > rect . height = event - > height ;
2011-02-25 10:37:05 -05:00
meta_window_update_monitor ( window ) ;
2008-11-23 14:28:40 -05:00
if ( ! event - > override_redirect & & ! event - > send_event )
meta_warning ( " Unhandled change of windows override redirect status \n " ) ;
2002-01-18 22:50:03 -05:00
2009-06-25 16:17:27 -04:00
if ( window - > display - > compositor )
meta_compositor_sync_window_geometry ( window - > display - > compositor , window ) ;
2008-11-23 14:28:40 -05:00
}
2001-06-09 17:58:30 -04:00
void
meta_window_get_position ( MetaWindow * window ,
int * x ,
int * y )
{
if ( window - > frame )
{
2001-07-12 01:53:56 -04:00
if ( x )
* x = window - > frame - > rect . x + window - > frame - > child_x ;
if ( y )
* y = window - > frame - > rect . y + window - > frame - > child_y ;
2001-06-09 17:58:30 -04:00
}
else
{
2001-07-12 01:53:56 -04:00
if ( x )
* x = window - > rect . x ;
if ( y )
* y = window - > rect . y ;
2001-06-09 17:58:30 -04:00
}
}
2007-04-08 23:43:55 -04:00
void
meta_window_get_client_root_coords ( MetaWindow * window ,
MetaRectangle * rect )
{
meta_window_get_position ( window , & rect - > x , & rect - > y ) ;
rect - > width = window - > rect . width ;
rect - > height = window - > rect . height ;
}
2001-07-07 14:36:50 -04:00
void
meta_window_get_gravity_position ( MetaWindow * window ,
2007-04-09 19:00:55 -04:00
int gravity ,
2001-07-07 14:36:50 -04:00
int * root_x ,
int * root_y )
{
MetaRectangle frame_extents ;
int w , h ;
int x , y ;
2008-12-18 07:41:56 -05:00
2001-07-07 14:36:50 -04:00
w = window - > rect . width ;
h = window - > rect . height ;
2007-04-09 19:00:55 -04:00
if ( gravity = = StaticGravity )
2001-08-18 22:29:38 -04:00
{
frame_extents = window - > rect ;
if ( window - > frame )
{
frame_extents . x = window - > frame - > rect . x + window - > frame - > child_x ;
frame_extents . y = window - > frame - > rect . y + window - > frame - > child_y ;
}
}
2001-07-07 14:36:50 -04:00
else
2001-08-18 22:29:38 -04:00
{
if ( window - > frame = = NULL )
frame_extents = window - > rect ;
else
frame_extents = window - > frame - > rect ;
}
2001-07-07 14:36:50 -04:00
x = frame_extents . x ;
y = frame_extents . y ;
2008-12-18 07:41:56 -05:00
2007-04-09 19:00:55 -04:00
switch ( gravity )
2001-07-07 14:36:50 -04:00
{
case NorthGravity :
case CenterGravity :
case SouthGravity :
/* Find center of frame. */
x + = frame_extents . width / 2 ;
/* Center client window on that point. */
x - = w / 2 ;
break ;
2008-12-18 07:41:56 -05:00
2001-07-07 14:36:50 -04:00
case SouthEastGravity :
case EastGravity :
case NorthEastGravity :
/* Find right edge of frame */
x + = frame_extents . width ;
/* Align left edge of client at that point. */
x - = w ;
break ;
default :
break ;
}
2008-12-18 07:41:56 -05:00
2007-04-09 19:00:55 -04:00
switch ( gravity )
2001-07-07 14:36:50 -04:00
{
case WestGravity :
case CenterGravity :
case EastGravity :
/* Find center of frame. */
y + = frame_extents . height / 2 ;
/* Center client window there. */
y - = h / 2 ;
break ;
case SouthWestGravity :
case SouthGravity :
case SouthEastGravity :
/* Find south edge of frame */
y + = frame_extents . height ;
/* Place bottom edge of client there */
y - = h ;
break ;
default :
break ;
}
2008-12-18 07:41:56 -05:00
2001-07-07 14:36:50 -04:00
if ( root_x )
* root_x = x ;
if ( root_y )
* root_y = y ;
}
2001-07-28 02:35:19 -04:00
void
meta_window_get_geometry ( MetaWindow * window ,
int * x ,
int * y ,
int * width ,
int * height )
{
2007-04-09 19:00:55 -04:00
meta_window_get_gravity_position ( window ,
window - > size_hints . win_gravity ,
x , y ) ;
2001-07-28 02:35:19 -04:00
* width = ( window - > rect . width - window - > size_hints . base_width ) /
window - > size_hints . width_inc ;
* height = ( window - > rect . height - window - > size_hints . base_height ) /
window - > size_hints . height_inc ;
}
2011-06-29 13:37:04 -04:00
/**
* meta_window_get_input_rect :
* @ window : a # MetaWindow
* @ rect : ( out ) : pointer to an allocated # MetaRectangle
*
* Gets the rectangle that bounds @ window that is responsive to mouse events .
* This includes decorations - the visible portion of its border - and ( if
* present ) any invisible area that we make make responsive to mouse clicks in
* order to allow convenient border dragging .
*/
void
meta_window_get_input_rect ( const MetaWindow * window ,
MetaRectangle * rect )
{
if ( window - > frame )
* rect = window - > frame - > rect ;
else
* rect = window - > rect ;
}
2010-11-22 16:26:37 -05:00
/**
* meta_window_get_outer_rect :
* @ window : a # MetaWindow
* @ rect : ( out ) : pointer to an allocated # MetaRectangle
*
2011-06-29 13:37:04 -04:00
* Gets the rectangle that bounds @ window that is responsive to mouse events .
* This includes only what is visible ; it doesn ' t include any extra reactive
* area we add to the edges of windows .
2010-11-22 16:26:37 -05:00
*/
2001-07-12 01:53:56 -04:00
void
2006-01-10 00:14:48 -05:00
meta_window_get_outer_rect ( const MetaWindow * window ,
MetaRectangle * rect )
2001-07-12 01:53:56 -04:00
{
if ( window - > frame )
2011-06-29 13:37:04 -04:00
{
MetaFrameBorders borders ;
* rect = window - > frame - > rect ;
meta_frame_calc_borders ( window - > frame , & borders ) ;
rect - > x + = borders . invisible . left ;
rect - > y + = borders . invisible . top ;
rect - > width - = borders . invisible . left + borders . invisible . right ;
rect - > height - = borders . invisible . top + borders . invisible . bottom ;
}
2001-07-12 01:53:56 -04:00
else
* rect = window - > rect ;
}
2002-11-30 22:58:04 -05:00
const char *
meta_window_get_startup_id ( MetaWindow * window )
{
if ( window - > startup_id = = NULL )
{
MetaGroup * group ;
group = meta_window_get_group ( window ) ;
if ( group ! = NULL )
return meta_group_get_startup_id ( group ) ;
}
return window - > startup_id ;
}
2005-01-25 12:26:06 -05:00
static MetaWindow *
get_modal_transient ( MetaWindow * window )
{
GSList * windows ;
GSList * tmp ;
MetaWindow * modal_transient ;
/* A window can't be the transient of itself, but this is just for
* convenience in the loop below ; we manually fix things up at the
* end if no real modal transient was found .
*/
modal_transient = window ;
2009-06-15 15:32:23 -04:00
windows = meta_display_list_windows ( window - > display , META_LIST_DEFAULT ) ;
2005-01-25 12:26:06 -05:00
tmp = windows ;
while ( tmp ! = NULL )
{
MetaWindow * transient = tmp - > data ;
2008-12-18 07:41:56 -05:00
2005-01-25 12:26:06 -05:00
if ( transient - > xtransient_for = = modal_transient - > xwindow & &
transient - > wm_state_modal )
{
modal_transient = transient ;
tmp = windows ;
continue ;
}
2008-12-18 07:41:56 -05:00
2005-01-25 12:26:06 -05:00
tmp = tmp - > next ;
}
g_slist_free ( windows ) ;
if ( window = = modal_transient )
modal_transient = NULL ;
return modal_transient ;
}
2006-05-23 17:42:34 -04:00
/* XXX META_EFFECT_FOCUS */
2001-06-04 00:58:22 -04:00
void
meta_window_focus ( MetaWindow * window ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
guint32 timestamp )
2008-12-18 07:41:56 -05:00
{
2005-01-25 12:26:06 -05:00
MetaWindow * modal_transient ;
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2002-01-03 18:28:19 -05:00
meta_topic ( META_DEBUG_FOCUS ,
" Setting input focus to window %s, input: %d take_focus: %d \n " ,
window - > desc , window - > input , window - > take_focus ) ;
2008-12-18 07:41:56 -05:00
2001-07-11 02:22:00 -04:00
if ( window - > display - > grab_window & &
window - > display - > grab_window - > all_keys_grabbed )
{
2002-01-05 22:15:49 -05:00
meta_topic ( META_DEBUG_FOCUS ,
" Current focus window %s has global keygrab, not focusing window %s after all \n " ,
window - > display - > grab_window - > desc , window - > desc ) ;
2001-07-11 02:22:00 -04:00
return ;
}
2001-10-29 02:00:46 -05:00
2005-01-25 12:26:06 -05:00
modal_transient = get_modal_transient ( window ) ;
2005-06-02 11:24:40 -04:00
if ( modal_transient ! = NULL & &
! modal_transient - > unmanaging )
2005-01-25 12:26:06 -05:00
{
meta_topic ( META_DEBUG_FOCUS ,
" %s has %s as a modal transient, so focusing it instead. \n " ,
window - > desc , modal_transient - > desc ) ;
if ( ! modal_transient - > on_all_workspaces & &
modal_transient - > workspace ! = window - > screen - > active_workspace )
2008-12-18 07:41:56 -05:00
meta_window_change_workspace ( modal_transient ,
2005-01-25 12:26:06 -05:00
window - > screen - > active_workspace ) ;
window = modal_transient ;
}
2001-10-29 02:00:46 -05:00
meta_window_flush_calc_showing ( window ) ;
2002-05-10 22:25:11 -04:00
2008-11-03 07:36:55 -05:00
if ( ( ! window - > mapped | | window - > hidden ) & & ! window - > shaded )
2002-05-10 22:25:11 -04:00
{
meta_topic ( META_DEBUG_FOCUS ,
" Window %s is not showing, not focusing after all \n " ,
window - > desc ) ;
return ;
}
Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 15:56:10 -04:00
2001-06-24 12:37:18 -04:00
/* For output-only or shaded windows, focus the frame.
* This seems to result in the client window getting key events
* though , so I don ' t know if it ' s icccm - compliant .
*
* Still , we have to do this or keynav breaks for these windows .
*/
if ( window - > frame & &
( window - > shaded | |
! ( window - > input | | window - > take_focus ) ) )
2001-06-04 00:58:22 -04:00
{
2001-06-23 01:49:35 -04:00
if ( window - > frame )
{
2002-01-05 22:15:49 -05:00
meta_topic ( META_DEBUG_FOCUS ,
" Focusing frame of %s \n " , window - > desc ) ;
2004-12-23 01:44:56 -05:00
meta_display_set_input_focus_window ( window - > display ,
window ,
TRUE ,
timestamp ) ;
2001-06-23 01:49:35 -04:00
}
2001-06-10 15:23:28 -04:00
}
2001-06-23 01:49:35 -04:00
else
2001-06-10 15:23:28 -04:00
{
2001-06-23 01:49:35 -04:00
if ( window - > input )
{
2002-01-05 22:15:49 -05:00
meta_topic ( META_DEBUG_FOCUS ,
2004-12-23 01:44:56 -05:00
" Setting input focus on %s since input = true \n " ,
2002-01-05 22:15:49 -05:00
window - > desc ) ;
2004-12-23 01:44:56 -05:00
meta_display_set_input_focus_window ( window - > display ,
window ,
FALSE ,
timestamp ) ;
2001-06-23 01:49:35 -04:00
}
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
if ( window - > take_focus )
{
2002-01-05 22:15:49 -05:00
meta_topic ( META_DEBUG_FOCUS ,
" Sending WM_TAKE_FOCUS to %s since take_focus = true \n " ,
window - > desc ) ;
2001-06-23 01:49:35 -04:00
meta_window_send_icccm_message ( window ,
2008-05-02 14:49:01 -04:00
window - > display - > atom_WM_TAKE_FOCUS ,
2001-06-23 01:49:35 -04:00
timestamp ) ;
2002-08-08 00:45:13 -04:00
window - > display - > expected_focus_window = window ;
2001-06-23 01:49:35 -04:00
}
2001-06-04 00:58:22 -04:00
}
Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 15:56:10 -04:00
if ( window - > wm_state_demands_attention )
2006-03-29 13:43:22 -05:00
meta_window_unset_demands_attention ( window ) ;
2006-05-25 10:40:50 -04:00
2009-05-07 13:53:47 -04:00
/* meta_effect_run_focus(window, NULL, NULL); */
2001-06-04 00:58:22 -04:00
}
2002-11-22 01:00:18 -05:00
static void
meta_window_change_workspace_without_transients ( MetaWindow * window ,
MetaWorkspace * workspace )
2002-08-06 00:11:23 -04:00
{
2009-01-20 07:52:06 -05:00
int old_workspace = - 1 ;
2001-06-09 01:14:43 -04:00
meta_verbose ( " Changing window %s to workspace %d \n " ,
window - > desc , meta_workspace_index ( workspace ) ) ;
2008-12-18 07:41:56 -05:00
2011-02-28 05:41:23 -05:00
if ( ! window - > on_all_workspaces_requested )
2009-01-20 07:52:06 -05:00
{
old_workspace = meta_workspace_index ( window - > workspace ) ;
}
2008-12-18 07:41:56 -05:00
/* unstick if stuck. meta_window_unstick would call
2002-10-04 10:49:00 -04:00
* meta_window_change_workspace recursively if the window
* is not in the active workspace .
*/
2011-02-28 05:41:23 -05:00
if ( window - > on_all_workspaces_requested )
2002-10-04 10:49:00 -04:00
meta_window_unstick ( window ) ;
2002-06-17 21:41:08 -04:00
/* See if we're already on this space. If not, make sure we are */
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
if ( window - > workspace ! = workspace )
2002-08-06 00:11:23 -04:00
{
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
meta_workspace_remove_window ( window - > workspace , window ) ;
meta_workspace_add_window ( workspace , window ) ;
2009-01-20 07:52:06 -05:00
g_signal_emit ( window , window_signals [ WORKSPACE_CHANGED ] , 0 ,
old_workspace ) ;
2002-08-06 00:11:23 -04:00
}
2001-06-09 01:14:43 -04:00
}
2003-03-17 01:36:39 -05:00
static gboolean
2002-11-22 01:00:18 -05:00
change_workspace_foreach ( MetaWindow * window ,
void * data )
{
meta_window_change_workspace_without_transients ( window , data ) ;
2003-03-17 01:36:39 -05:00
return TRUE ;
2002-11-22 01:00:18 -05:00
}
void
meta_window_change_workspace ( MetaWindow * window ,
MetaWorkspace * workspace )
{
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2012-04-14 09:12:48 -04:00
if ( window - > always_sticky )
return ;
2002-11-22 01:00:18 -05:00
meta_window_change_workspace_without_transients ( window , workspace ) ;
meta_window_foreach_transient ( window , change_workspace_foreach ,
workspace ) ;
2005-10-03 15:00:01 -04:00
meta_window_foreach_ancestor ( window , change_workspace_foreach ,
workspace ) ;
2002-11-22 01:00:18 -05:00
}
2005-01-26 18:25:05 -05:00
static void
window_stick_impl ( MetaWindow * window )
2001-06-09 23:17:15 -04:00
{
2002-11-19 23:37:55 -05:00
meta_verbose ( " Sticking window %s current on_all_workspaces = %d \n " ,
window - > desc , window - > on_all_workspaces ) ;
2008-12-18 07:41:56 -05:00
2011-02-28 05:41:23 -05:00
if ( window - > on_all_workspaces_requested )
2001-06-09 23:17:15 -04:00
return ;
/* We don't change window->workspaces, because we revert
* to that original workspace list if on_all_workspaces is
* toggled back off .
*/
2011-02-28 05:41:23 -05:00
window - > on_all_workspaces_requested = TRUE ;
meta_window_update_on_all_workspaces ( window ) ;
2008-12-18 07:41:56 -05:00
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_queue ( window , META_QUEUE_CALC_SHOWING ) ;
2001-06-09 23:17:15 -04:00
}
2005-01-26 18:25:05 -05:00
static void
window_unstick_impl ( MetaWindow * window )
2001-06-09 23:17:15 -04:00
{
2011-02-28 05:41:23 -05:00
if ( ! window - > on_all_workspaces_requested )
2001-06-09 23:17:15 -04:00
return ;
/* Revert to window->workspaces */
2011-02-28 05:41:23 -05:00
window - > on_all_workspaces_requested = FALSE ;
meta_window_update_on_all_workspaces ( window ) ;
2003-08-15 18:09:55 -04:00
2001-06-09 23:17:15 -04:00
/* We change ourselves to the active workspace, since otherwise you'd get
* a weird window - vaporization effect . Once we have UI for being
* on more than one workspace this should probably be add_workspace
* not change_workspace .
*/
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
if ( window - > screen - > active_workspace ! = window - > workspace )
2001-06-09 23:17:15 -04:00
meta_window_change_workspace ( window , window - > screen - > active_workspace ) ;
2008-12-18 07:41:56 -05:00
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_queue ( window , META_QUEUE_CALC_SHOWING ) ;
2001-06-09 23:17:15 -04:00
}
2005-01-26 18:25:05 -05:00
static gboolean
stick_foreach_func ( MetaWindow * window ,
void * data )
{
gboolean stick ;
stick = * ( gboolean * ) data ;
if ( stick )
window_stick_impl ( window ) ;
else
window_unstick_impl ( window ) ;
return TRUE ;
}
void
meta_window_stick ( MetaWindow * window )
{
gboolean stick = TRUE ;
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2005-01-26 18:25:05 -05:00
window_stick_impl ( window ) ;
meta_window_foreach_transient ( window ,
stick_foreach_func ,
& stick ) ;
}
void
meta_window_unstick ( MetaWindow * window )
{
gboolean stick = FALSE ;
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2005-01-26 18:25:05 -05:00
window_unstick_impl ( window ) ;
meta_window_foreach_transient ( window ,
stick_foreach_func ,
& stick ) ;
}
2001-06-21 01:23:24 -04:00
unsigned long
meta_window_get_net_wm_desktop ( MetaWindow * window )
{
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
if ( window - > on_all_workspaces )
2001-06-21 01:23:24 -04:00
return 0xFFFFFFFF ;
else
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
return meta_workspace_index ( window - > workspace ) ;
2001-06-21 01:23:24 -04:00
}
2004-01-10 12:16:07 -05:00
static void
update_net_frame_extents ( MetaWindow * window )
{
2012-03-12 23:11:07 -04:00
unsigned long data [ 4 ] ;
MetaFrameBorders borders ;
2011-09-22 13:42:01 -04:00
2012-03-12 23:11:07 -04:00
meta_frame_calc_borders ( window - > frame , & borders ) ;
/* Left */
data [ 0 ] = borders . visible . left ;
/* Right */
data [ 1 ] = borders . visible . right ;
/* Top */
data [ 2 ] = borders . visible . top ;
/* Bottom */
data [ 3 ] = borders . visible . bottom ;
2004-01-10 12:16:07 -05:00
meta_topic ( META_DEBUG_GEOMETRY ,
" Setting _NET_FRAME_EXTENTS on managed window 0x%lx "
2012-02-29 22:15:12 -05:00
" to left = %lu, right = %lu, top = %lu, bottom = %lu \n " ,
2004-01-10 12:16:07 -05:00
window - > xwindow , data [ 0 ] , data [ 1 ] , data [ 2 ] , data [ 3 ] ) ;
meta_error_trap_push ( window - > display ) ;
XChangeProperty ( window - > display - > xdisplay , window - > xwindow ,
2008-05-02 14:49:01 -04:00
window - > display - > atom__NET_FRAME_EXTENTS ,
2004-01-10 12:16:07 -05:00
XA_CARDINAL ,
32 , PropModeReplace , ( guchar * ) data , 4 ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2004-01-10 12:16:07 -05:00
}
2002-10-21 17:44:35 -04:00
void
2001-06-09 23:17:15 -04:00
meta_window_set_current_workspace_hint ( MetaWindow * window )
{
/* FIXME if on more than one workspace, we claim to be "sticky",
* the WM spec doesn ' t say what to do here .
*/
unsigned long data [ 1 ] ;
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 18:52:52 -05:00
if ( window - > workspace = = NULL )
2002-03-10 10:48:38 -05:00
{
2008-12-18 07:41:56 -05:00
/* this happens when unmanaging windows */
2002-10-21 17:44:35 -04:00
return ;
2002-03-10 10:48:38 -05:00
}
2008-12-18 07:41:56 -05:00
2001-06-21 01:23:24 -04:00
data [ 0 ] = meta_window_get_net_wm_desktop ( window ) ;
2001-06-09 23:17:15 -04:00
2006-01-20 17:03:56 -05:00
meta_verbose ( " Setting _NET_WM_DESKTOP of %s to %lu \n " ,
2001-06-09 23:17:15 -04:00
window - > desc , data [ 0 ] ) ;
2008-12-18 07:41:56 -05:00
2001-06-09 23:17:15 -04:00
meta_error_trap_push ( window - > display ) ;
XChangeProperty ( window - > display - > xdisplay , window - > xwindow ,
2008-05-02 14:49:01 -04:00
window - > display - > atom__NET_WM_DESKTOP ,
2001-06-09 23:17:15 -04:00
XA_CARDINAL ,
32 , PropModeReplace , ( guchar * ) data , 1 ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2001-06-09 23:17:15 -04:00
}
2005-02-12 02:34:30 -05:00
static gboolean
find_root_ancestor ( MetaWindow * window ,
void * data )
{
MetaWindow * * ancestor = data ;
/* Overwrite the previously "most-root" ancestor with the new one found */
* ancestor = window ;
/* We want this to continue until meta_window_foreach_ancestor quits because
* there are no more valid ancestors .
*/
return TRUE ;
}
2010-09-01 15:39:53 -04:00
/**
* meta_window_find_root_ancestor :
* @ window : a # MetaWindow
*
* Follow the chain of parents of @ window , skipping transient windows ,
* and return the " root " window which has no non - transient parent .
*
* Returns : ( transfer none ) : The root ancestor window
*/
2006-03-30 14:22:38 -05:00
MetaWindow *
meta_window_find_root_ancestor ( MetaWindow * window )
2001-06-06 00:47:37 -04:00
{
2005-02-12 02:34:30 -05:00
MetaWindow * ancestor ;
ancestor = window ;
meta_window_foreach_ancestor ( window , find_root_ancestor , & ancestor ) ;
2006-03-30 14:22:38 -05:00
return ancestor ;
}
void
meta_window_raise ( MetaWindow * window )
{
MetaWindow * ancestor ;
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2006-03-30 14:22:38 -05:00
ancestor = meta_window_find_root_ancestor ( window ) ;
2005-02-12 02:34:30 -05:00
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
2008-12-18 07:41:56 -05:00
" Raising window %s, ancestor of %s \n " ,
2005-02-12 02:34:30 -05:00
ancestor - > desc , window - > desc ) ;
2001-06-06 00:47:37 -04:00
2005-07-24 21:52:50 -04:00
/* Raise the ancestor of the window (if the window has no ancestor,
* then ancestor will be set to the window itself ) ; do this because
* it ' s weird to see windows from other apps stacked between a child
* and parent window of the currently active app . The stacking
* constraints in stack . c then magically take care of raising all
* the child windows appropriately .
*/
if ( window - > screen - > stack = = ancestor - > screen - > stack )
meta_stack_raise ( window - > screen - > stack , ancestor ) ;
else
2005-02-12 02:34:30 -05:00
{
meta_warning (
" Either stacks aren't per screen or some window has a weird "
" transient_for hint; window->screen->stack != "
" ancestor->screen->stack. window = %s, ancestor = %s. \n " ,
window - > desc , ancestor - > desc ) ;
2005-07-24 21:52:50 -04:00
/* We could raise the window here, but don't want to do that twice and
* so we let the case below handle that .
*/
2005-02-12 02:34:30 -05:00
}
2005-07-24 21:52:50 -04:00
/* Okay, so stacking constraints misses one case: If a window has
* two children and we want to raise one of those children , then
* raising the ancestor isn ' t enough ; we need to also raise the
* correct child . See bug 307875.
*/
if ( window ! = ancestor )
meta_stack_raise ( window - > screen - > stack , window ) ;
2009-02-02 09:08:46 -05:00
g_signal_emit ( window , window_signals [ RAISED ] , 0 ) ;
2001-06-06 00:47:37 -04:00
}
2001-09-16 17:50:27 -04:00
void
meta_window_lower ( MetaWindow * window )
{
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
" Lowering window %s \n " , window - > desc ) ;
2001-09-16 17:50:27 -04:00
meta_stack_lower ( window - > screen - > stack , window ) ;
}
2001-06-04 00:58:22 -04:00
void
meta_window_send_icccm_message ( MetaWindow * window ,
Atom atom ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
guint32 timestamp )
2001-06-04 00:58:22 -04:00
{
/* This comment and code are from twm, copyright
* Open Group , Evans & Sutherland , etc .
*/
2008-12-18 07:41:56 -05:00
2001-06-04 00:58:22 -04:00
/*
* ICCCM Client Messages - Section 4.2 .8 of the ICCCM dictates that all
* client messages will have the following form :
*
* event type ClientMessage
* message type _XA_WM_PROTOCOLS
* window tmp - > w
* format 32
* data [ 0 ] message atom
* data [ 1 ] time stamp
*/
2008-12-18 07:41:56 -05:00
2001-06-04 00:58:22 -04:00
XClientMessageEvent ev ;
2008-12-18 07:41:56 -05:00
2001-06-04 00:58:22 -04:00
ev . type = ClientMessage ;
ev . window = window - > xwindow ;
2008-05-02 14:49:01 -04:00
ev . message_type = window - > display - > atom_WM_PROTOCOLS ;
2001-06-04 00:58:22 -04:00
ev . format = 32 ;
ev . data . l [ 0 ] = atom ;
ev . data . l [ 1 ] = timestamp ;
2002-04-21 23:23:29 -04:00
meta_error_trap_push ( window - > display ) ;
2001-06-04 00:58:22 -04:00
XSendEvent ( window - > display - > xdisplay ,
window - > xwindow , False , 0 , ( XEvent * ) & ev ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2001-06-04 00:58:22 -04:00
}
2007-04-09 19:00:55 -04:00
void
meta_window_move_resize_request ( MetaWindow * window ,
guint value_mask ,
int gravity ,
int new_x ,
int new_y ,
int new_width ,
int new_height )
2001-06-02 21:33:27 -04:00
{
2001-07-07 14:36:50 -04:00
int x , y , width , height ;
2002-04-30 23:23:46 -04:00
gboolean allow_position_change ;
2002-07-24 11:41:44 -04:00
gboolean in_grab_op ;
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
2006-01-02 Elijah Newren <newren@gmail.com>
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
* src/boxes.c (meta_rectangle_region_to_string,
meta_rectangle_edge_list_to_string, fix_up_edges):
* src/constraints.c (meta_window_constrain, setup_constraint_info,
place_window_if_needed, constrain_maximization,
constrain_fullscreen, constrain_size_increments,
constrain_size_limits, constrain_aspect_ratio,
do_screen_and_xinerama_relative_constrai,
constrain_to_single_xinerama, constrain_fully_onscreen,
constrain_partially_onscreen):
* src/edge-resistance.c (find_nearest_position,
apply_edge_resistance, apply_edge_resistance_to_each_side):
* src/testboxes.c (test_clamping_to_region,
test_clipping_to_region, test_shoving_into_region):
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_resize,
meta_window_resize_with_gravity, meta_window_configure_request):
Remove C99 style variable initiailization
2006-01-02 13:37:46 -05:00
MetaMoveResizeFlags flags ;
2002-07-24 11:41:44 -04:00
/* We ignore configure requests while the user is moving/resizing
* the window , since these represent the app sucking and fighting
* the user , most likely due to a bug in the app ( e . g . pfaedit
* seemed to do this )
*
* Still have to do the ConfigureNotify and all , but pretend the
* app asked for the current size / position instead of the new one .
2008-12-18 07:41:56 -05:00
*/
2002-07-24 11:41:44 -04:00
in_grab_op = FALSE ;
if ( window - > display - > grab_op ! = META_GRAB_OP_NONE & &
window = = window - > display - > grab_window )
{
switch ( window - > display - > grab_op )
{
case META_GRAB_OP_MOVING :
case META_GRAB_OP_RESIZING_SE :
case META_GRAB_OP_RESIZING_S :
case META_GRAB_OP_RESIZING_SW :
case META_GRAB_OP_RESIZING_N :
case META_GRAB_OP_RESIZING_NE :
case META_GRAB_OP_RESIZING_NW :
case META_GRAB_OP_RESIZING_W :
case META_GRAB_OP_RESIZING_E :
in_grab_op = TRUE ;
break ;
default :
break ;
}
}
2008-12-18 07:41:56 -05:00
2001-07-07 12:50:01 -04:00
/* it's essential to use only the explicitly-set fields,
* and otherwise use our current up - to - date position .
*
* Otherwise you get spurious position changes when the app changes
* size , for example , if window - > rect is not in sync with the
* server - side position in effect when the configure request was
* generated .
*/
2007-04-09 19:00:55 -04:00
meta_window_get_gravity_position ( window ,
gravity ,
& x , & y ) ;
2001-07-07 12:50:01 -04:00
2002-04-30 23:23:46 -04:00
allow_position_change = FALSE ;
2008-12-18 07:41:56 -05:00
2002-04-30 23:23:46 -04:00
if ( meta_prefs_get_disable_workarounds ( ) )
{
if ( window - > type = = META_WINDOW_DIALOG | |
window - > type = = META_WINDOW_MODAL_DIALOG | |
window - > type = = META_WINDOW_SPLASHSCREEN )
; /* No position change for these */
else if ( ( window - > size_hints . flags & PPosition ) | |
/* USPosition is just stale if window is placed;
* no - - geometry involved here .
*/
( ( window - > size_hints . flags & USPosition ) & &
! window - > placed ) )
allow_position_change = TRUE ;
}
else
{
2002-05-24 22:03:09 -04:00
allow_position_change = TRUE ;
2002-04-30 23:23:46 -04:00
}
2002-07-24 11:41:44 -04:00
if ( in_grab_op )
allow_position_change = FALSE ;
2008-12-18 07:41:56 -05:00
2002-04-30 23:23:46 -04:00
if ( allow_position_change )
2001-08-17 18:44:36 -04:00
{
2007-04-09 19:00:55 -04:00
if ( value_mask & CWX )
x = new_x ;
if ( value_mask & CWY )
y = new_y ;
if ( value_mask & ( CWX | CWY ) )
2002-04-30 23:23:46 -04:00
{
/* Once manually positioned, windows shouldn't be placed
* by the window manager .
*/
window - > placed = TRUE ;
}
2001-07-07 12:50:01 -04:00
}
2002-05-24 22:03:09 -04:00
else
{
meta_topic ( META_DEBUG_GEOMETRY ,
2008-12-18 07:41:56 -05:00
" Not allowing position change for window %s PPosition 0x%lx USPosition 0x%lx type %u \n " ,
window - > desc , window - > size_hints . flags & PPosition ,
2002-05-24 22:03:09 -04:00
window - > size_hints . flags & USPosition ,
2008-12-18 07:41:56 -05:00
window - > type ) ;
2002-05-24 22:03:09 -04:00
}
2001-07-07 12:50:01 -04:00
width = window - > rect . width ;
height = window - > rect . height ;
2002-07-24 11:41:44 -04:00
if ( ! in_grab_op )
{
2007-04-09 19:00:55 -04:00
if ( value_mask & CWWidth )
width = new_width ;
2008-12-18 07:41:56 -05:00
2007-04-09 19:00:55 -04:00
if ( value_mask & CWHeight )
height = new_height ;
2002-07-24 11:41:44 -04:00
}
2001-07-07 12:50:01 -04:00
/* ICCCM 4.1.5 */
2008-12-18 07:41:56 -05:00
2001-07-07 12:50:01 -04:00
/* We're ignoring the value_mask here, since sizes
* not in the mask will be the current window geometry .
*/
window - > size_hints . x = x ;
window - > size_hints . y = y ;
window - > size_hints . width = width ;
window - > size_hints . height = height ;
2007-04-08 23:43:55 -04:00
/* NOTE: We consider ConfigureRequests to be "user" actions in one
* way , but not in another . Explanation of the two cases are in the
* next two big comments .
*/
/* The constraints code allows user actions to move windows
* offscreen , etc . , and configure request actions would often send
* windows offscreen when users don ' t want it if not constrained
* ( e . g . hitting a dropdown triangle in a fileselector to show more
* options , which makes the window bigger ) . Thus we do not set
* META_IS_USER_ACTION in flags to the
* meta_window_move_resize_internal ( ) call .
2001-08-18 22:45:55 -04:00
*/
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
2006-01-02 Elijah Newren <newren@gmail.com>
Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
* src/boxes.c (meta_rectangle_region_to_string,
meta_rectangle_edge_list_to_string, fix_up_edges):
* src/constraints.c (meta_window_constrain, setup_constraint_info,
place_window_if_needed, constrain_maximization,
constrain_fullscreen, constrain_size_increments,
constrain_size_limits, constrain_aspect_ratio,
do_screen_and_xinerama_relative_constrai,
constrain_to_single_xinerama, constrain_fully_onscreen,
constrain_partially_onscreen):
* src/edge-resistance.c (find_nearest_position,
apply_edge_resistance, apply_edge_resistance_to_each_side):
* src/testboxes.c (test_clamping_to_region,
test_clipping_to_region, test_shoving_into_region):
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_resize,
meta_window_resize_with_gravity, meta_window_configure_request):
Remove C99 style variable initiailization
2006-01-02 13:37:46 -05:00
flags = META_IS_CONFIGURE_REQUEST ;
2007-04-09 19:00:55 -04:00
if ( value_mask & ( CWX | CWY ) )
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
flags | = META_IS_MOVE_ACTION ;
2007-04-09 19:00:55 -04:00
if ( value_mask & ( CWWidth | CWHeight ) )
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
flags | = META_IS_RESIZE_ACTION ;
if ( flags & ( META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION ) )
2008-12-18 07:41:56 -05:00
meta_window_move_resize_internal ( window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
flags ,
2007-04-09 19:00:55 -04:00
gravity ,
x ,
y ,
width ,
height ) ;
2001-07-07 13:08:42 -04:00
2007-04-08 23:43:55 -04:00
/* window->user_rect exists to allow "snapping-back" the window if a
* new strut is set ( causing the window to move ) and then the strut
* is later removed without the user moving the window in the
* interim . We ' d like to " snap-back " to the position specified by
* ConfigureRequest events ( at least the constrained version of the
* ConfigureRequest , since that is guaranteed to be onscreen ) so we
* set user_rect here .
*
* See also bug 426519.
*/
2008-08-15 23:09:40 -04:00
save_user_window_placement ( window ) ;
2007-04-09 19:00:55 -04:00
}
gboolean
meta_window_configure_request ( MetaWindow * window ,
XEvent * event )
{
/* Note that x, y is the corner of the window border,
* and width , height is the size of the window inside
* its border , but that we always deny border requests
* and give windows a border of 0. But we save the
* requested border here .
*/
if ( event - > xconfigurerequest . value_mask & CWBorderWidth )
window - > border_width = event - > xconfigurerequest . border_width ;
meta_window_move_resize_request ( window ,
event - > xconfigurerequest . value_mask ,
window - > size_hints . win_gravity ,
event - > xconfigurerequest . x ,
event - > xconfigurerequest . y ,
event - > xconfigurerequest . width ,
event - > xconfigurerequest . height ) ;
2008-12-18 07:41:56 -05:00
2002-05-28 22:22:04 -04:00
/* Handle stacking. We only handle raises/lowers, mostly because
* stack . c really can ' t deal with anything else . I guess we ' ll fix
* that if a client turns up that really requires it . Only a very
* few clients even require the raise / lower ( and in fact all client
* attempts to deal with stacking order are essentially broken ,
* since they have no idea what other clients are involved or how
* the stack looks ) .
*
* I ' m pretty sure no interesting client uses TopIf , BottomIf , or
* Opposite anyway , so the only possible missing thing is
* Above / Below with a sibling set . For now we just pretend there ' s
* never a sibling set and always do the full raise / lower instead of
* the raise - just - above / below - sibling .
*/
if ( event - > xconfigurerequest . value_mask & CWStackMode )
{
2005-02-06 12:01:41 -05:00
MetaWindow * active_window ;
active_window = window - > display - > expected_focus_window ;
2009-11-17 17:24:53 -05:00
if ( meta_prefs_get_disable_workarounds ( ) )
2002-05-28 22:22:04 -04:00
{
2005-02-06 12:01:41 -05:00
meta_topic ( META_DEBUG_STACK ,
" %s sent an xconfigure stacking request; this is "
" broken behavior and the request is being ignored. \n " ,
window - > desc ) ;
}
else if ( active_window & &
! meta_window_same_application ( window , active_window ) & &
2009-10-19 19:41:54 -04:00
! meta_window_same_client ( window , active_window ) & &
2005-02-06 12:01:41 -05:00
XSERVER_TIME_IS_BEFORE ( window - > net_wm_user_time ,
active_window - > net_wm_user_time ) )
{
meta_topic ( META_DEBUG_STACK ,
" Ignoring xconfigure stacking request from %s (with "
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
" user_time %u); currently active application is %s (with "
" user_time %u). \n " ,
2005-02-06 12:01:41 -05:00
window - > desc ,
window - > net_wm_user_time ,
active_window - > desc ,
active_window - > net_wm_user_time ) ;
2005-06-02 11:47:37 -04:00
if ( event - > xconfigurerequest . detail = = Above )
2006-03-29 13:43:22 -05:00
meta_window_set_demands_attention ( window ) ;
2005-02-06 12:01:41 -05:00
}
else
{
switch ( event - > xconfigurerequest . detail )
{
case Above :
meta_window_raise ( window ) ;
break ;
case Below :
meta_window_lower ( window ) ;
break ;
case TopIf :
case BottomIf :
case Opposite :
break ;
}
2002-05-28 22:22:04 -04:00
}
2008-12-18 07:41:56 -05:00
}
2001-07-07 12:50:01 -04:00
return TRUE ;
2001-06-02 21:33:27 -04:00
}
gboolean
meta_window_property_notify ( MetaWindow * window ,
XEvent * event )
{
2008-12-18 07:41:56 -05:00
return process_property_notify ( window , & event - > xproperty ) ;
2001-06-02 21:33:27 -04:00
}
2008-11-20 04:14:58 -05:00
/*
* Move window to the requested workspace ; append controls whether new WS
* should be created if one does not exist .
*/
void
meta_window_change_workspace_by_index ( MetaWindow * window ,
gint space_index ,
2008-11-25 10:34:07 -05:00
gboolean append ,
guint32 timestamp )
2008-11-20 04:14:58 -05:00
{
MetaWorkspace * workspace ;
MetaScreen * screen ;
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2008-11-20 04:14:58 -05:00
if ( space_index = = - 1 )
{
meta_window_stick ( window ) ;
return ;
}
screen = window - > screen ;
workspace =
meta_screen_get_workspace_by_index ( screen , space_index ) ;
if ( ! workspace & & append )
{
2008-11-25 10:34:07 -05:00
if ( timestamp = = CurrentTime )
timestamp = meta_display_get_current_time_roundtrip ( window - > display ) ;
2008-11-20 04:14:58 -05:00
workspace = meta_screen_append_new_workspace ( screen , FALSE , timestamp ) ;
}
if ( workspace )
{
2011-02-28 05:41:23 -05:00
if ( window - > on_all_workspaces_requested )
2008-11-20 04:14:58 -05:00
meta_window_unstick ( window ) ;
meta_window_change_workspace ( window , workspace ) ;
}
}
2001-06-02 21:33:27 -04:00
2001-08-29 00:16:30 -04:00
# define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
# define _NET_WM_MOVERESIZE_SIZE_TOP 1
# define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2
# define _NET_WM_MOVERESIZE_SIZE_RIGHT 3
# define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4
# define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5
# define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6
# define _NET_WM_MOVERESIZE_SIZE_LEFT 7
# define _NET_WM_MOVERESIZE_MOVE 8
2002-08-07 01:26:20 -04:00
# define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9
# define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10
2009-01-25 17:59:50 -05:00
# define _NET_WM_MOVERESIZE_CANCEL 11
2001-08-29 00:16:30 -04:00
2001-06-09 02:08:44 -04:00
gboolean
meta_window_client_message ( MetaWindow * window ,
XEvent * event )
{
MetaDisplay * display ;
display = window - > display ;
2006-03-29 11:05:23 -05:00
2009-06-15 16:11:15 -04:00
if ( window - > override_redirect )
{
/* Don't warn here: we could warn on any of the messages below,
* but we might also receive other client messages that are
* part of protocols we don ' t know anything about . So , silently
* ignoring is simplest .
*/
return FALSE ;
}
2001-06-09 02:08:44 -04:00
if ( event - > xclient . message_type = =
2008-05-02 14:49:01 -04:00
display - > atom__NET_CLOSE_WINDOW )
2001-06-09 02:08:44 -04:00
{
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
guint32 timestamp ;
2004-06-21 05:53:23 -04:00
if ( event - > xclient . data . l [ 0 ] ! = 0 )
timestamp = event - > xclient . data . l [ 0 ] ;
else
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
{
meta_warning ( " Receiving a NET_CLOSE_WINDOW message for %s without "
" a timestamp! This means some buggy (outdated) "
" application is on the loose! \n " ,
window - > desc ) ;
timestamp = meta_display_get_current_time ( window - > display ) ;
}
2008-12-18 07:41:56 -05:00
2004-06-21 05:53:23 -04:00
meta_window_delete ( window , timestamp ) ;
2001-06-09 02:08:44 -04:00
return TRUE ;
}
else if ( event - > xclient . message_type = =
2008-05-02 14:49:01 -04:00
display - > atom__NET_WM_DESKTOP )
2001-06-09 02:08:44 -04:00
{
int space ;
MetaWorkspace * workspace ;
2008-12-18 07:41:56 -05:00
2001-06-09 02:08:44 -04:00
space = event - > xclient . data . l [ 0 ] ;
2008-12-18 07:41:56 -05:00
2002-11-19 23:37:55 -05:00
meta_verbose ( " Request to move %s to workspace %d \n " ,
2001-06-09 02:08:44 -04:00
window - > desc , space ) ;
workspace =
2002-10-16 16:12:24 -04:00
meta_screen_get_workspace_by_index ( window - > screen ,
space ) ;
2001-06-09 02:08:44 -04:00
if ( workspace )
2001-06-09 23:17:15 -04:00
{
2011-02-28 05:41:23 -05:00
if ( window - > on_all_workspaces_requested )
2001-06-09 23:17:15 -04:00
meta_window_unstick ( window ) ;
meta_window_change_workspace ( window , workspace ) ;
}
2002-02-06 22:07:56 -05:00
else if ( space = = ( int ) 0xFFFFFFFF )
2001-06-09 23:17:15 -04:00
{
meta_window_stick ( window ) ;
}
2001-06-09 02:08:44 -04:00
else
2001-06-09 23:17:15 -04:00
{
meta_verbose ( " No such workspace %d for screen \n " , space ) ;
}
2001-06-09 02:08:44 -04:00
2002-11-19 23:37:55 -05:00
meta_verbose ( " Window %s now on_all_workspaces = %d \n " ,
window - > desc , window - > on_all_workspaces ) ;
2008-12-18 07:41:56 -05:00
2001-06-09 02:08:44 -04:00
return TRUE ;
}
else if ( event - > xclient . message_type = =
2008-05-02 14:49:01 -04:00
display - > atom__NET_WM_STATE )
2001-06-09 02:08:44 -04:00
{
gulong action ;
Atom first ;
Atom second ;
action = event - > xclient . data . l [ 0 ] ;
first = event - > xclient . data . l [ 1 ] ;
second = event - > xclient . data . l [ 2 ] ;
2008-12-18 07:41:56 -05:00
2001-06-09 02:08:44 -04:00
if ( meta_is_verbose ( ) )
{
char * str1 ;
char * str2 ;
2002-10-21 17:44:35 -04:00
meta_error_trap_push_with_return ( display ) ;
2001-06-09 02:08:44 -04:00
str1 = XGetAtomName ( display - > xdisplay , first ) ;
2010-10-25 14:44:30 -04:00
if ( meta_error_trap_pop_with_return ( display ) ! = Success )
2001-06-09 02:08:44 -04:00
str1 = NULL ;
2002-10-21 17:44:35 -04:00
meta_error_trap_push_with_return ( display ) ;
2008-12-18 07:41:56 -05:00
str2 = XGetAtomName ( display - > xdisplay , second ) ;
2010-10-25 14:44:30 -04:00
if ( meta_error_trap_pop_with_return ( display ) ! = Success )
2001-06-09 02:08:44 -04:00
str2 = NULL ;
2008-12-18 07:41:56 -05:00
2006-01-20 17:03:56 -05:00
meta_verbose ( " Request to change _NET_WM_STATE action %lu atom1: %s atom2: %s \n " ,
2001-06-09 02:08:44 -04:00
action ,
str1 ? str1 : " (unknown) " ,
str2 ? str2 : " (unknown) " ) ;
2002-01-03 22:25:53 -05:00
meta_XFree ( str1 ) ;
meta_XFree ( str2 ) ;
2001-06-09 02:08:44 -04:00
}
2008-05-02 14:49:01 -04:00
if ( first = = display - > atom__NET_WM_STATE_SHADED | |
second = = display - > atom__NET_WM_STATE_SHADED )
2001-06-09 02:08:44 -04:00
{
gboolean shade ;
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
guint32 timestamp ;
/* Stupid protocol has no timestamp; of course, shading
* sucks anyway so who really cares that we ' re forced to do
2008-12-18 07:41:56 -05:00
* a roundtrip here ?
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
*/
timestamp = meta_display_get_current_time_roundtrip ( window - > display ) ;
2001-06-09 02:08:44 -04:00
shade = ( action = = _NET_WM_STATE_ADD | |
( action = = _NET_WM_STATE_TOGGLE & & ! window - > shaded ) ) ;
2001-10-07 18:11:13 -04:00
if ( shade & & window - > has_shade_func )
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_window_shade ( window , timestamp ) ;
2001-06-09 02:08:44 -04:00
else
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_window_unshade ( window , timestamp ) ;
2001-06-09 02:08:44 -04:00
}
2008-05-02 14:49:01 -04:00
if ( first = = display - > atom__NET_WM_STATE_FULLSCREEN | |
second = = display - > atom__NET_WM_STATE_FULLSCREEN )
2002-02-23 17:58:02 -05:00
{
gboolean make_fullscreen ;
make_fullscreen = ( action = = _NET_WM_STATE_ADD | |
( action = = _NET_WM_STATE_TOGGLE & & ! window - > fullscreen ) ) ;
if ( make_fullscreen & & window - > has_fullscreen_func )
meta_window_make_fullscreen ( window ) ;
else
meta_window_unmake_fullscreen ( window ) ;
}
2008-12-18 07:41:56 -05:00
2008-05-02 14:49:01 -04:00
if ( first = = display - > atom__NET_WM_STATE_MAXIMIZED_HORZ | |
second = = display - > atom__NET_WM_STATE_MAXIMIZED_HORZ )
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
{
gboolean max ;
max = ( action = = _NET_WM_STATE_ADD | |
2008-12-18 07:41:56 -05:00
( action = = _NET_WM_STATE_TOGGLE & &
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
! window - > maximized_horizontally ) ) ;
if ( max & & window - > has_maximize_func )
2006-04-15 22:20:41 -04:00
{
if ( meta_prefs_get_raise_on_click ( ) )
meta_window_raise ( window ) ;
meta_window_maximize ( window , META_MAXIMIZE_HORIZONTAL ) ;
}
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
else
2006-04-15 22:20:41 -04:00
{
if ( meta_prefs_get_raise_on_click ( ) )
meta_window_raise ( window ) ;
meta_window_unmaximize ( window , META_MAXIMIZE_HORIZONTAL ) ;
}
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
}
2008-05-02 14:49:01 -04:00
if ( first = = display - > atom__NET_WM_STATE_MAXIMIZED_VERT | |
second = = display - > atom__NET_WM_STATE_MAXIMIZED_VERT )
2001-06-09 02:08:44 -04:00
{
gboolean max ;
max = ( action = = _NET_WM_STATE_ADD | |
2008-12-18 07:41:56 -05:00
( action = = _NET_WM_STATE_TOGGLE & &
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
! window - > maximized_vertically ) ) ;
2001-10-07 18:11:13 -04:00
if ( max & & window - > has_maximize_func )
2006-04-15 22:20:41 -04:00
{
if ( meta_prefs_get_raise_on_click ( ) )
meta_window_raise ( window ) ;
meta_window_maximize ( window , META_MAXIMIZE_VERTICAL ) ;
}
2001-06-09 02:08:44 -04:00
else
2006-04-15 22:20:41 -04:00
{
if ( meta_prefs_get_raise_on_click ( ) )
meta_window_raise ( window ) ;
meta_window_unmaximize ( window , META_MAXIMIZE_VERTICAL ) ;
}
2001-06-09 02:08:44 -04:00
}
2008-05-02 14:49:01 -04:00
if ( first = = display - > atom__NET_WM_STATE_MODAL | |
second = = display - > atom__NET_WM_STATE_MODAL )
2001-06-10 23:24:20 -04:00
{
window - > wm_state_modal =
( action = = _NET_WM_STATE_ADD ) | |
( action = = _NET_WM_STATE_TOGGLE & & ! window - > wm_state_modal ) ;
2008-12-18 07:41:56 -05:00
2001-06-10 23:24:20 -04:00
recalc_window_type ( window ) ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
meta_window_queue ( window , META_QUEUE_MOVE_RESIZE ) ;
2001-06-11 01:47:51 -04:00
}
2008-05-02 14:49:01 -04:00
if ( first = = display - > atom__NET_WM_STATE_SKIP_PAGER | |
second = = display - > atom__NET_WM_STATE_SKIP_PAGER )
2001-06-11 01:47:51 -04:00
{
2008-12-18 07:41:56 -05:00
window - > wm_state_skip_pager =
2001-06-11 01:47:51 -04:00
( action = = _NET_WM_STATE_ADD ) | |
2002-07-06 15:05:37 -04:00
( action = = _NET_WM_STATE_TOGGLE & & ! window - > skip_pager ) ;
2001-06-11 01:47:51 -04:00
2002-11-19 23:37:55 -05:00
recalc_window_features ( window ) ;
2001-06-10 23:24:20 -04:00
set_net_wm_state ( window ) ;
}
2008-05-02 14:49:01 -04:00
if ( first = = display - > atom__NET_WM_STATE_SKIP_TASKBAR | |
second = = display - > atom__NET_WM_STATE_SKIP_TASKBAR )
2001-06-11 01:47:51 -04:00
{
2002-08-05 11:32:08 -04:00
window - > wm_state_skip_taskbar =
2001-06-11 01:47:51 -04:00
( action = = _NET_WM_STATE_ADD ) | |
2002-07-06 15:05:37 -04:00
( action = = _NET_WM_STATE_TOGGLE & & ! window - > skip_taskbar ) ;
2001-06-11 01:47:51 -04:00
2002-11-19 23:37:55 -05:00
recalc_window_features ( window ) ;
2001-06-11 01:47:51 -04:00
set_net_wm_state ( window ) ;
}
2002-10-01 20:47:29 -04:00
2008-05-02 14:49:01 -04:00
if ( first = = display - > atom__NET_WM_STATE_ABOVE | |
second = = display - > atom__NET_WM_STATE_ABOVE )
2002-10-01 20:47:29 -04:00
{
2011-07-02 07:08:17 -04:00
meta_window_set_above ( window ,
2002-10-01 20:47:29 -04:00
( action = = _NET_WM_STATE_ADD ) | |
2011-07-02 07:08:17 -04:00
( action = = _NET_WM_STATE_TOGGLE & & ! window - > wm_state_above ) ) ;
2002-10-01 20:47:29 -04:00
}
2008-05-02 14:49:01 -04:00
if ( first = = display - > atom__NET_WM_STATE_BELOW | |
second = = display - > atom__NET_WM_STATE_BELOW )
2002-10-01 20:47:29 -04:00
{
2008-12-18 07:41:56 -05:00
window - > wm_state_below =
2002-10-01 20:47:29 -04:00
( action = = _NET_WM_STATE_ADD ) | |
( action = = _NET_WM_STATE_TOGGLE & & ! window - > wm_state_below ) ;
2002-10-16 10:53:19 -04:00
meta_window_update_layer ( window ) ;
2002-10-01 20:47:29 -04:00
set_net_wm_state ( window ) ;
}
Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 15:56:10 -04:00
2008-05-02 14:49:01 -04:00
if ( first = = display - > atom__NET_WM_STATE_DEMANDS_ATTENTION | |
second = = display - > atom__NET_WM_STATE_DEMANDS_ATTENTION )
Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 15:56:10 -04:00
{
2006-03-29 13:43:22 -05:00
if ( ( action = = _NET_WM_STATE_ADD ) | |
( action = = _NET_WM_STATE_TOGGLE & & ! window - > wm_state_demands_attention ) )
2008-10-23 00:09:14 -04:00
meta_window_set_demands_attention ( window ) ;
2006-03-29 13:43:22 -05:00
else
2008-10-23 00:09:14 -04:00
meta_window_unset_demands_attention ( window ) ;
}
2008-12-18 07:41:56 -05:00
2008-10-23 00:09:14 -04:00
if ( first = = display - > atom__NET_WM_STATE_STICKY | |
second = = display - > atom__NET_WM_STATE_STICKY )
{
if ( ( action = = _NET_WM_STATE_ADD ) | |
2011-02-28 05:41:23 -05:00
( action = = _NET_WM_STATE_TOGGLE & & ! window - > on_all_workspaces_requested ) )
2008-10-23 00:09:14 -04:00
meta_window_stick ( window ) ;
2006-03-29 13:43:22 -05:00
else
2008-10-23 00:09:14 -04:00
meta_window_unstick ( window ) ;
Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 15:56:10 -04:00
}
2008-12-18 07:41:56 -05:00
2001-06-09 02:08:44 -04:00
return TRUE ;
}
2001-06-09 17:58:30 -04:00
else if ( event - > xclient . message_type = =
2008-05-02 14:49:01 -04:00
display - > atom_WM_CHANGE_STATE )
2001-06-09 17:58:30 -04:00
{
meta_verbose ( " WM_CHANGE_STATE client message, state: %ld \n " ,
event - > xclient . data . l [ 0 ] ) ;
2001-10-07 18:11:13 -04:00
if ( event - > xclient . data . l [ 0 ] = = IconicState & &
window - > has_minimize_func )
2005-01-09 19:27:00 -05:00
meta_window_minimize ( window ) ;
2001-06-09 02:08:44 -04:00
2001-06-09 17:58:30 -04:00
return TRUE ;
}
2001-08-29 00:16:30 -04:00
else if ( event - > xclient . message_type = =
2008-05-02 14:49:01 -04:00
display - > atom__NET_WM_MOVERESIZE )
2001-08-29 00:16:30 -04:00
{
int x_root ;
int y_root ;
int action ;
MetaGrabOp op ;
2002-08-07 01:26:20 -04:00
int button ;
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
guint32 timestamp ;
2006-10-12 20:28:34 -04:00
/* _NET_WM_MOVERESIZE messages are almost certainly going to come from
* clients when users click on the fake " frame " that the client has ,
* thus we should also treat such messages as though it were a
* " frame action " .
*/
gboolean const frame_action = TRUE ;
2008-12-18 07:41:56 -05:00
2001-08-29 00:16:30 -04:00
x_root = event - > xclient . data . l [ 0 ] ;
y_root = event - > xclient . data . l [ 1 ] ;
action = event - > xclient . data . l [ 2 ] ;
2002-08-07 01:26:20 -04:00
button = event - > xclient . data . l [ 3 ] ;
2001-08-29 00:16:30 -04:00
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
/* FIXME: What a braindead protocol; no timestamp?!? */
timestamp = meta_display_get_current_time_roundtrip ( display ) ;
2002-02-24 14:58:27 -05:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
2002-08-07 01:26:20 -04:00
" Received _NET_WM_MOVERESIZE message on %s, %d,%d action = %d, button %d \n " ,
2002-02-24 14:58:27 -05:00
window - > desc ,
2002-08-07 01:26:20 -04:00
x_root , y_root , action , button ) ;
2008-12-18 07:41:56 -05:00
2001-08-29 00:16:30 -04:00
op = META_GRAB_OP_NONE ;
switch ( action )
{
case _NET_WM_MOVERESIZE_SIZE_TOPLEFT :
op = META_GRAB_OP_RESIZING_NW ;
break ;
case _NET_WM_MOVERESIZE_SIZE_TOP :
op = META_GRAB_OP_RESIZING_N ;
break ;
case _NET_WM_MOVERESIZE_SIZE_TOPRIGHT :
op = META_GRAB_OP_RESIZING_NE ;
break ;
case _NET_WM_MOVERESIZE_SIZE_RIGHT :
op = META_GRAB_OP_RESIZING_E ;
break ;
case _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT :
op = META_GRAB_OP_RESIZING_SE ;
break ;
2008-12-18 07:41:56 -05:00
case _NET_WM_MOVERESIZE_SIZE_BOTTOM :
2001-08-29 00:16:30 -04:00
op = META_GRAB_OP_RESIZING_S ;
break ;
case _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT :
op = META_GRAB_OP_RESIZING_SW ;
break ;
case _NET_WM_MOVERESIZE_SIZE_LEFT :
op = META_GRAB_OP_RESIZING_W ;
break ;
case _NET_WM_MOVERESIZE_MOVE :
op = META_GRAB_OP_MOVING ;
break ;
2002-08-07 01:26:20 -04:00
case _NET_WM_MOVERESIZE_SIZE_KEYBOARD :
op = META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN ;
break ;
case _NET_WM_MOVERESIZE_MOVE_KEYBOARD :
op = META_GRAB_OP_KEYBOARD_MOVING ;
break ;
2009-01-25 17:59:50 -05:00
case _NET_WM_MOVERESIZE_CANCEL :
/* handled below */
break ;
2001-08-29 00:16:30 -04:00
default :
break ;
}
2009-01-25 17:59:50 -05:00
if ( action = = _NET_WM_MOVERESIZE_CANCEL )
{
meta_display_end_grab_op ( window - > display , timestamp ) ;
}
else if ( op ! = META_GRAB_OP_NONE & &
2002-08-07 01:26:20 -04:00
( ( window - > has_move_func & & op = = META_GRAB_OP_KEYBOARD_MOVING ) | |
( window - > has_resize_func & & op = = META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN ) ) )
2001-08-29 00:16:30 -04:00
{
2006-10-12 20:28:34 -04:00
meta_window_begin_grab_op ( window , op , frame_action , timestamp ) ;
2002-08-07 01:26:20 -04:00
}
else if ( op ! = META_GRAB_OP_NONE & &
( ( window - > has_move_func & & op = = META_GRAB_OP_MOVING ) | |
2008-12-18 07:41:56 -05:00
( window - > has_resize_func & &
( op ! = META_GRAB_OP_MOVING & &
2002-08-07 01:26:20 -04:00
op ! = META_GRAB_OP_KEYBOARD_MOVING ) ) ) )
{
/*
* the button SHOULD already be included in the message
2001-08-29 00:16:30 -04:00
*/
2002-08-07 01:26:20 -04:00
if ( button = = 0 )
{
int x , y , query_root_x , query_root_y ;
Window root , child ;
guint mask ;
/* The race conditions in this _NET_WM_MOVERESIZE thing
* are mind - boggling
*/
mask = 0 ;
meta_error_trap_push ( window - > display ) ;
XQueryPointer ( window - > display - > xdisplay ,
window - > xwindow ,
& root , & child ,
& query_root_x , & query_root_y ,
& x , & y ,
& mask ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2002-08-07 01:26:20 -04:00
if ( mask & Button1Mask )
button = 1 ;
else if ( mask & Button2Mask )
button = 2 ;
else if ( mask & Button3Mask )
button = 3 ;
else
button = 0 ;
}
2001-08-29 00:16:30 -04:00
if ( button ! = 0 )
{
2002-02-24 14:58:27 -05:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
" Beginning move/resize with button = %d \n " , button ) ;
2001-08-29 00:16:30 -04:00
meta_display_begin_grab_op ( window - > display ,
2002-06-27 01:08:32 -04:00
window - > screen ,
2001-08-29 00:16:30 -04:00
window ,
op ,
2006-10-12 20:28:34 -04:00
FALSE ,
frame_action ,
2001-08-29 00:16:30 -04:00
button , 0 ,
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
timestamp ,
2001-08-29 00:16:30 -04:00
x_root ,
y_root ) ;
}
}
return TRUE ;
}
2007-04-09 19:00:55 -04:00
else if ( event - > xclient . message_type = =
2008-05-02 14:49:01 -04:00
display - > atom__NET_MOVERESIZE_WINDOW )
2007-04-09 19:00:55 -04:00
{
2011-01-24 15:44:12 -05:00
int gravity ;
2007-04-09 19:00:55 -04:00
guint value_mask ;
gravity = ( event - > xclient . data . l [ 0 ] & 0xff ) ;
value_mask = ( event - > xclient . data . l [ 0 ] & 0xf00 ) > > 8 ;
2011-01-24 15:44:12 -05:00
/* source = (event->xclient.data.l[0] & 0xf000) >> 12; */
2007-04-09 19:00:55 -04:00
if ( gravity = = 0 )
gravity = window - > size_hints . win_gravity ;
meta_window_move_resize_request ( window ,
value_mask ,
gravity ,
2008-02-26 23:39:10 -05:00
event - > xclient . data . l [ 1 ] , /* x */
event - > xclient . data . l [ 2 ] , /* y */
event - > xclient . data . l [ 3 ] , /* width */
event - > xclient . data . l [ 4 ] ) ; /* height */
2007-04-09 19:00:55 -04:00
}
2001-10-07 19:06:19 -04:00
else if ( event - > xclient . message_type = =
2008-05-02 14:49:01 -04:00
display - > atom__NET_ACTIVE_WINDOW )
2001-10-07 19:06:19 -04:00
{
2006-01-10 00:44:40 -05:00
MetaClientType source_indication ;
guint32 timestamp ;
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
meta_verbose ( " _NET_ACTIVE_WINDOW request for window '%s', activating \n " ,
2002-01-03 18:28:19 -05:00
window - > desc ) ;
2001-10-07 19:06:19 -04:00
2006-01-10 00:44:40 -05:00
source_indication = event - > xclient . data . l [ 0 ] ;
timestamp = event - > xclient . data . l [ 1 ] ;
if ( source_indication > META_CLIENT_TYPE_MAX_RECOGNIZED )
source_indication = META_CLIENT_TYPE_UNKNOWN ;
if ( timestamp = = 0 )
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
{
/* Client using older EWMH _NET_ACTIVE_WINDOW without a timestamp */
meta_warning ( " Buggy client sent a _NET_ACTIVE_WINDOW message with a "
" timestamp of 0 for %s \n " ,
window - > desc ) ;
timestamp = meta_display_get_current_time ( display ) ;
}
2006-01-10 00:44:40 -05:00
2006-08-07 14:08:27 -04:00
window_activate ( window , timestamp , source_indication , NULL ) ;
2001-10-07 19:06:19 -04:00
return TRUE ;
}
2008-11-16 21:57:20 -05:00
else if ( event - > xclient . message_type = =
display - > atom__NET_WM_FULLSCREEN_MONITORS )
{
gulong top , bottom , left , right ;
meta_verbose ( " _NET_WM_FULLSCREEN_MONITORS request for window '%s' \n " ,
window - > desc ) ;
top = event - > xclient . data . l [ 0 ] ;
bottom = event - > xclient . data . l [ 1 ] ;
left = event - > xclient . data . l [ 2 ] ;
right = event - > xclient . data . l [ 3 ] ;
2011-01-24 15:44:12 -05:00
/* source_indication = event->xclient.data.l[4]; */
2008-11-16 21:57:20 -05:00
meta_window_update_fullscreen_monitors ( window , top , bottom , left , right ) ;
}
2008-12-18 07:41:56 -05:00
2001-06-09 02:08:44 -04:00
return FALSE ;
}
2011-10-26 14:00:18 -04:00
static void
meta_window_appears_focused_changed ( MetaWindow * window )
{
set_net_wm_state ( window ) ;
g_object_notify ( G_OBJECT ( window ) , " appears-focused " ) ;
if ( window - > frame )
meta_frame_queue_draw ( window - > frame ) ;
}
2011-04-13 17:08:12 -04:00
/**
* meta_window_propagate_focus_appearance :
* @ window : the window to start propagating from
* @ focused : % TRUE if @ window ' s ancestors should appear focused ,
* % FALSE if they should not .
*
* Adjusts the value of # MetaWindow : appears - focused on @ window ' s
* ancestors ( but not @ window itself ) . If @ focused is % TRUE , each of
* @ window ' s ancestors will have its % attached_focus_window field set
* to the current % focus_window . If @ focused if % FALSE , each of
* @ window ' s ancestors will have its % attached_focus_window field
* cleared if it is currently % focus_window .
*/
2011-03-24 21:36:47 -04:00
void
meta_window_propagate_focus_appearance ( MetaWindow * window ,
gboolean focused )
2010-09-10 05:55:20 -04:00
{
2011-04-13 17:08:12 -04:00
MetaWindow * child , * parent , * focus_window ;
2010-09-10 05:55:20 -04:00
2011-04-13 17:08:12 -04:00
focus_window = window - > display - > focus_window ;
2011-03-24 21:36:47 -04:00
child = window ;
parent = meta_window_get_transient_for ( child ) ;
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
while ( parent & & ( ! focused | | meta_window_is_attached_dialog ( child ) ) )
2011-03-24 21:36:47 -04:00
{
gboolean child_focus_state_changed ;
2010-09-10 05:55:20 -04:00
2011-03-24 21:36:47 -04:00
if ( focused )
{
2011-04-13 17:08:12 -04:00
if ( parent - > attached_focus_window = = focus_window )
2011-03-24 21:36:47 -04:00
break ;
child_focus_state_changed = ( parent - > attached_focus_window = = NULL ) ;
2011-04-13 17:08:12 -04:00
parent - > attached_focus_window = focus_window ;
2011-03-24 21:36:47 -04:00
}
else
{
2011-04-13 17:08:12 -04:00
if ( parent - > attached_focus_window ! = focus_window )
2011-03-24 21:36:47 -04:00
break ;
child_focus_state_changed = ( parent - > attached_focus_window ! = NULL ) ;
parent - > attached_focus_window = NULL ;
}
2011-04-13 14:19:40 -04:00
if ( child_focus_state_changed & & ! parent - > has_focus & &
parent ! = window - > display - > expected_focus_window )
2011-03-24 21:36:47 -04:00
{
2011-10-26 14:00:18 -04:00
meta_window_appears_focused_changed ( parent ) ;
2011-03-24 21:36:47 -04:00
}
child = parent ;
parent = meta_window_get_transient_for ( child ) ;
}
2010-09-10 05:55:20 -04:00
}
2012-11-15 16:35:42 -05:00
void
meta_window_lost_focus ( MetaWindow * window )
{
if ( window = = window - > display - > focus_window )
{
meta_topic ( META_DEBUG_FOCUS ,
" %s is now the previous focus window due to being focused out or unmapped \n " ,
window - > desc ) ;
meta_topic ( META_DEBUG_FOCUS ,
" * Focus --> NULL (was %s) \n " , window - > desc ) ;
meta_window_propagate_focus_appearance ( window , FALSE ) ;
window - > display - > focus_window = NULL ;
g_object_notify ( G_OBJECT ( window - > display ) , " focus-window " ) ;
window - > has_focus = FALSE ;
if ( ! window - > attached_focus_window )
meta_window_appears_focused_changed ( window ) ;
meta_error_trap_push ( window - > display ) ;
XUninstallColormap ( window - > display - > xdisplay ,
window - > colormap ) ;
meta_error_trap_pop ( window - > display ) ;
/* move out of FOCUSED_WINDOW layer */
meta_window_update_layer ( window ) ;
/* Re-grab for click to focus and raise-on-click, if necessary */
if ( meta_prefs_get_focus_mode ( ) = = G_DESKTOP_FOCUS_MODE_CLICK | |
! meta_prefs_get_raise_on_click ( ) )
meta_display_grab_focus_window_button ( window - > display , window ) ;
}
}
2001-06-23 01:49:35 -04:00
gboolean
2012-11-15 16:35:42 -05:00
meta_window_notify_focus ( MetaWindow * window ,
XIEnterEvent * event )
2001-06-23 01:49:35 -04:00
{
/* note the event can be on either the window or the frame,
* we focus the frame for shaded windows
*/
2008-12-18 07:41:56 -05:00
2001-07-25 22:55:35 -04:00
/* The event can be FocusIn, FocusOut, or UnmapNotify.
* On UnmapNotify we have to pretend it ' s focus out ,
* because we won ' t get a focus out if it occurs , apparently .
*/
2001-06-23 01:49:35 -04:00
2001-06-23 23:18:10 -04:00
/* We ignore grabs, though this is questionable.
* It may be better to increase the intelligence of
* the focus window tracking .
*
2002-03-11 23:34:17 -05:00
* The problem is that keybindings for windows are done with
* XGrabKey , which means focus_window disappears and the front of
* the MRU list gets confused from what the user expects once a
* keybinding is used .
2008-12-18 07:41:56 -05:00
*/
2002-01-03 18:28:19 -05:00
meta_topic ( META_DEBUG_FOCUS ,
2002-01-05 22:15:49 -05:00
" Focus %s event received on %s 0x%lx (%s) "
" mode %s detail %s \n " ,
2012-11-15 16:35:42 -05:00
event - > evtype = = XI_FocusIn ? " in " :
event - > evtype = = XI_FocusOut ? " out " :
2002-01-05 22:15:49 -05:00
" ??? " ,
2012-11-15 16:35:42 -05:00
window - > desc , event - > event ,
event - > event = = window - > xwindow ?
2002-01-05 22:15:49 -05:00
" client window " :
2012-11-15 16:35:42 -05:00
( window - > frame & & event - > event = = window - > frame - > xwindow ) ?
2002-01-05 22:15:49 -05:00
" frame window " :
" unknown window " ,
2012-11-15 16:35:42 -05:00
meta_event_mode_to_string ( event - > mode ) ,
meta_event_detail_to_string ( event - > detail ) ) ;
2002-08-10 00:29:57 -04:00
/* FIXME our pointer tracking is broken; see how
* gtk + / gdk / x11 / gdkevents - x11 . c or XFree86 / xc / programs / xterm / misc . c
* handle it for the correct way . In brief you need to track
* pointer focus and regular focus , and handle EnterNotify in
* PointerRoot mode with no window manager . However as noted above ,
* accurate focus tracking will break things because we want to keep
* windows " focused " when using keybindings on them , and also we
* sometimes " focus " a window by focusing its frame or
* no_focus_window ; so this all needs rethinking massively .
*
* My suggestion is to change it so that we clearly separate
* actual keyboard focus tracking using the xterm algorithm ,
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
* and mutter ' s " pretend " focus window , and go through all
2002-08-10 00:29:57 -04:00
* the code and decide which one should be used in each place ;
* a hard bit is deciding on a policy for that .
*
* http : //bugzilla.gnome.org/show_bug.cgi?id=90382
*/
2008-12-18 07:41:56 -05:00
2012-11-15 16:35:42 -05:00
if ( ( event - > evtype = = XI_FocusIn | |
event - > evtype = = XI_FocusOut ) & &
( event - > mode = = NotifyGrab | |
event - > mode = = NotifyUngrab | |
2002-01-06 22:26:09 -05:00
/* From WindowMaker, ignore all funky pointer root events */
2012-11-15 16:35:42 -05:00
event - > detail > NotifyNonlinearVirtual ) )
2001-06-23 23:41:44 -04:00
{
2002-01-03 18:28:19 -05:00
meta_topic ( META_DEBUG_FOCUS ,
2002-03-11 23:34:17 -05:00
" Ignoring focus event generated by a grab or other weirdness \n " ) ;
2001-06-23 23:41:44 -04:00
return TRUE ;
}
2008-12-18 07:41:56 -05:00
2012-11-15 16:35:42 -05:00
if ( event - > evtype = = XI_FocusIn )
2001-06-23 01:49:35 -04:00
{
2009-08-04 04:01:32 -04:00
if ( window - > override_redirect )
{
window - > display - > focus_window = NULL ;
g_object_notify ( G_OBJECT ( window - > display ) , " focus-window " ) ;
return FALSE ;
}
2001-06-23 01:49:35 -04:00
if ( window ! = window - > display - > focus_window )
2001-06-23 23:18:10 -04:00
{
2002-01-03 18:28:19 -05:00
meta_topic ( META_DEBUG_FOCUS ,
2002-01-10 22:31:14 -05:00
" * Focus --> %s \n " , window - > desc ) ;
2001-06-23 23:18:10 -04:00
window - > display - > focus_window = window ;
2002-01-08 02:23:35 -05:00
window - > has_focus = TRUE ;
2003-08-15 18:09:55 -04:00
2004-02-27 21:53:56 -05:00
/* Move to the front of the focusing workspace's MRU list.
* We should only be " removing " it from the MRU list if it ' s
* not already there . Note that it ' s possible that we might
* be processing this FocusIn after we ' ve changed to a
* different workspace ; we should therefore update the MRU
* list only if the window is actually on the active
* workspace .
2003-08-15 18:09:55 -04:00
*/
2004-02-27 21:53:56 -05:00
if ( window - > screen - > active_workspace & &
2008-12-18 07:41:56 -05:00
meta_window_located_on_workspace ( window ,
2004-02-27 21:53:56 -05:00
window - > screen - > active_workspace ) )
2003-08-15 18:09:55 -04:00
{
2004-02-27 21:53:56 -05:00
GList * link ;
2008-12-18 07:41:56 -05:00
link = g_list_find ( window - > screen - > active_workspace - > mru_list ,
2004-02-27 21:53:56 -05:00
window ) ;
g_assert ( link ) ;
2008-12-18 07:41:56 -05:00
window - > screen - > active_workspace - > mru_list =
2004-02-27 21:53:56 -05:00
g_list_remove_link ( window - > screen - > active_workspace - > mru_list ,
link ) ;
g_list_free ( link ) ;
2004-02-22 20:48:29 -05:00
2008-12-18 07:41:56 -05:00
window - > screen - > active_workspace - > mru_list =
g_list_prepend ( window - > screen - > active_workspace - > mru_list ,
2003-08-15 18:09:55 -04:00
window ) ;
}
2002-01-08 02:23:35 -05:00
if ( window - > frame )
meta_frame_queue_draw ( window - > frame ) ;
2008-12-18 07:41:56 -05:00
2002-05-09 18:34:00 -04:00
meta_error_trap_push ( window - > display ) ;
XInstallColormap ( window - > display - > xdisplay ,
window - > colormap ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2002-09-24 17:22:06 -04:00
/* move into FOCUSED_WINDOW layer */
meta_window_update_layer ( window ) ;
2003-06-07 01:07:08 -04:00
2003-10-13 16:15:40 -04:00
/* Ungrab click to focus button since the sync grab can interfere
* with some things you might do inside the focused window , by
* causing the client to get funky enter / leave events .
2007-08-07 13:27:09 -04:00
*
* The reason we usually have a passive grab on the window is
* so that we can intercept clicks and raise the window in
* response . For click - to - focus we don ' t need that since the
* focused window is already raised . When raise_on_click is
* FALSE we also don ' t need that since we don ' t do anything
* when the window is clicked .
*
* There is dicussion in bugs 102209 , 115072 , and 461577
2003-10-13 16:15:40 -04:00
*/
2011-06-24 12:14:15 -04:00
if ( meta_prefs_get_focus_mode ( ) = = G_DESKTOP_FOCUS_MODE_CLICK | |
2007-08-07 13:27:09 -04:00
! meta_prefs_get_raise_on_click ( ) )
2004-01-05 02:24:32 -05:00
meta_display_ungrab_focus_window_button ( window - > display , window ) ;
2009-02-02 06:00:13 -05:00
g_signal_emit ( window , window_signals [ FOCUS ] , 0 ) ;
2009-08-01 06:11:11 -04:00
g_object_notify ( G_OBJECT ( window - > display ) , " focus-window " ) ;
2011-03-24 21:36:47 -04:00
if ( ! window - > attached_focus_window )
2011-10-26 14:00:18 -04:00
meta_window_appears_focused_changed ( window ) ;
2011-03-24 21:36:47 -04:00
meta_window_propagate_focus_appearance ( window , TRUE ) ;
2001-06-23 23:18:10 -04:00
}
2001-06-23 01:49:35 -04:00
}
2012-11-15 16:35:42 -05:00
else if ( event - > evtype = = XI_FocusOut )
2001-06-23 01:49:35 -04:00
{
2012-11-15 16:35:42 -05:00
if ( event - > detail = = NotifyInferior )
2002-01-06 22:26:09 -05:00
{
/* This event means the client moved focus to a subwindow */
meta_topic ( META_DEBUG_FOCUS ,
" Ignoring focus out on %s with NotifyInferior \n " ,
window - > desc ) ;
return TRUE ;
}
2012-11-15 16:35:42 -05:00
else
2001-06-23 23:18:10 -04:00
{
2012-11-15 16:35:42 -05:00
meta_window_lost_focus ( window ) ;
}
2001-06-23 01:49:35 -04:00
}
2001-10-07 19:06:19 -04:00
/* Now set _NET_ACTIVE_WINDOW hint */
meta_display_update_active_window_hint ( window - > display ) ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
return FALSE ;
}
2001-06-02 00:14:18 -04:00
static gboolean
process_property_notify ( MetaWindow * window ,
XPropertyEvent * event )
{
2009-01-27 00:03:06 -05:00
Window xid = window - > xwindow ;
2008-08-30 17:37:13 -04:00
if ( meta_is_verbose ( ) ) /* avoid looking up the name if we don't have to */
2002-11-03 19:19:08 -05:00
{
2008-08-30 17:37:13 -04:00
char * property_name = XGetAtomName ( window - > display - > xdisplay ,
event - > atom ) ;
2002-11-03 19:19:08 -05:00
2008-08-30 17:37:13 -04:00
meta_verbose ( " Property notify on %s for %s \n " ,
window - > desc , property_name ) ;
XFree ( property_name ) ;
}
2008-12-18 07:41:56 -05:00
2009-01-27 00:03:06 -05:00
if ( event - > atom = = window - > display - > atom__NET_WM_USER_TIME & &
window - > user_time_window )
2001-06-02 00:14:18 -04:00
{
2007-03-31 01:19:41 -04:00
xid = window - > user_time_window ;
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
}
2003-12-13 18:00:06 -05:00
2009-06-15 23:50:13 -04:00
meta_window_reload_property_from_xwindow ( window , xid , event - > atom , FALSE ) ;
2003-12-13 18:00:06 -05:00
2001-06-02 00:14:18 -04:00
return TRUE ;
}
2001-06-02 21:33:27 -04:00
static void
send_configure_notify ( MetaWindow * window )
{
XEvent event ;
/* from twm */
2008-12-18 07:41:56 -05:00
2001-06-02 21:33:27 -04:00
event . type = ConfigureNotify ;
event . xconfigure . display = window - > display - > xdisplay ;
event . xconfigure . event = window - > xwindow ;
event . xconfigure . window = window - > xwindow ;
event . xconfigure . x = window - > rect . x - window - > border_width ;
event . xconfigure . y = window - > rect . y - window - > border_width ;
if ( window - > frame )
{
2007-04-12 00:02:57 -04:00
if ( window - > withdrawn )
{
2011-10-17 21:15:48 -04:00
MetaFrameBorders borders ;
/* We reparent the client window and put it to the position
* where the visible top - left of the frame window currently is .
2007-04-12 00:02:57 -04:00
*/
2011-10-17 21:15:48 -04:00
meta_frame_calc_borders ( window - > frame , & borders ) ;
event . xconfigure . x = window - > frame - > rect . x + borders . invisible . left ;
event . xconfigure . y = window - > frame - > rect . y + borders . invisible . top ;
2007-04-12 00:02:57 -04:00
}
else
{
/* Need to be in root window coordinates */
event . xconfigure . x + = window - > frame - > rect . x ;
event . xconfigure . y + = window - > frame - > rect . y ;
}
2001-06-02 21:33:27 -04:00
}
event . xconfigure . width = window - > rect . width ;
event . xconfigure . height = window - > rect . height ;
event . xconfigure . border_width = window - > border_width ; /* requested not actual */
event . xconfigure . above = None ; /* FIXME */
event . xconfigure . override_redirect = False ;
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_GEOMETRY ,
" Sending synthetic configure notify to %s with x: %d y: %d w: %d h: %d \n " ,
window - > desc ,
event . xconfigure . x , event . xconfigure . y ,
event . xconfigure . width , event . xconfigure . height ) ;
2008-12-18 07:41:56 -05:00
2001-06-02 21:33:27 -04:00
meta_error_trap_push ( window - > display ) ;
2001-06-12 20:56:08 -04:00
XSendEvent ( window - > display - > xdisplay ,
window - > xwindow ,
False , StructureNotifyMask , & event ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2001-06-02 21:33:27 -04:00
}
2009-03-31 17:29:48 -04:00
/* FIXME: @rect should be marked (out), but gjs doesn't currently support
* this . See also http : //bugzilla.gnome.org/show_bug.cgi?id=573314
*/
/**
* meta_window_get_icon_geometry :
* @ window : a # MetaWindow
* @ rect : rectangle into which to store the returned geometry .
*
* Gets the location of the icon corresponding to the window . The location
* will be provided set by the task bar or other user interface element
* displaying the icon , and is relative to the root window . This currently
* retrieves the icon geometry from the X server as a round trip on every
* call .
*
* Return value : % TRUE if the icon geometry was succesfully retrieved .
*/
2002-10-24 01:21:51 -04:00
gboolean
2001-08-05 12:04:52 -04:00
meta_window_get_icon_geometry ( MetaWindow * window ,
MetaRectangle * rect )
{
2002-01-03 19:58:39 -05:00
gulong * geometry = NULL ;
int nitems ;
2001-08-19 21:42:44 -04:00
2009-06-14 08:37:57 -04:00
g_return_val_if_fail ( ! window - > override_redirect , FALSE ) ;
2002-01-03 19:58:39 -05:00
if ( meta_prop_get_cardinal_list ( window - > display ,
window - > xwindow ,
2008-05-02 14:49:01 -04:00
window - > display - > atom__NET_WM_ICON_GEOMETRY ,
2002-01-03 19:58:39 -05:00
& geometry , & nitems ) )
2001-08-19 21:42:44 -04:00
{
2002-01-03 19:58:39 -05:00
if ( nitems ! = 4 )
{
meta_verbose ( " _NET_WM_ICON_GEOMETRY on %s has %d values instead of 4 \n " ,
window - > desc , nitems ) ;
2002-01-03 22:25:53 -05:00
meta_XFree ( geometry ) ;
2002-01-03 19:58:39 -05:00
return FALSE ;
}
2008-12-18 07:41:56 -05:00
2002-01-03 19:58:39 -05:00
if ( rect )
{
rect - > x = geometry [ 0 ] ;
rect - > y = geometry [ 1 ] ;
rect - > width = geometry [ 2 ] ;
rect - > height = geometry [ 3 ] ;
}
2001-08-05 12:04:52 -04:00
2002-01-03 22:25:53 -05:00
meta_XFree ( geometry ) ;
2001-08-05 12:04:52 -04:00
2002-01-03 19:58:39 -05:00
return TRUE ;
}
return FALSE ;
2001-08-05 12:04:52 -04:00
}
2001-06-09 17:58:30 -04:00
static Window
read_client_leader ( MetaDisplay * display ,
Window xwindow )
{
2002-01-03 22:25:53 -05:00
Window retval = None ;
2008-12-18 07:41:56 -05:00
2002-01-03 22:25:53 -05:00
meta_prop_get_window ( display , xwindow ,
2008-05-02 14:49:01 -04:00
display - > atom_WM_CLIENT_LEADER ,
2002-01-03 22:25:53 -05:00
& retval ) ;
2001-06-09 17:58:30 -04:00
return retval ;
}
2003-03-17 01:36:39 -05:00
typedef struct
{
2008-12-18 07:41:56 -05:00
Window leader ;
2003-03-17 01:36:39 -05:00
} ClientLeaderData ;
static gboolean
find_client_leader_func ( MetaWindow * ancestor ,
void * data )
{
ClientLeaderData * d ;
d = data ;
d - > leader = read_client_leader ( ancestor - > display ,
ancestor - > xwindow ) ;
/* keep going if no client leader found */
return d - > leader = = None ;
}
2001-06-09 17:58:30 -04:00
static void
update_sm_hints ( MetaWindow * window )
{
Window leader ;
2008-12-18 07:41:56 -05:00
2001-06-09 17:58:30 -04:00
window - > xclient_leader = None ;
window - > sm_client_id = NULL ;
/* If not on the current window, we can get the client
* leader from transient parents . If we find a client
* leader , we read the SM_CLIENT_ID from it .
*/
2003-03-17 01:36:39 -05:00
leader = read_client_leader ( window - > display , window - > xwindow ) ;
if ( leader = = None )
2001-06-09 17:58:30 -04:00
{
2003-03-17 01:36:39 -05:00
ClientLeaderData d ;
d . leader = None ;
meta_window_foreach_ancestor ( window , find_client_leader_func ,
& d ) ;
leader = d . leader ;
2001-06-09 17:58:30 -04:00
}
2008-12-18 07:41:56 -05:00
2003-03-17 01:36:39 -05:00
if ( leader ! = None )
2001-06-09 17:58:30 -04:00
{
2002-01-03 22:25:53 -05:00
char * str ;
2008-12-18 07:41:56 -05:00
2001-06-09 17:58:30 -04:00
window - > xclient_leader = leader ;
2002-01-03 22:25:53 -05:00
if ( meta_prop_get_latin1_string ( window - > display , leader ,
2008-05-02 14:49:01 -04:00
window - > display - > atom_SM_CLIENT_ID ,
2002-01-03 22:25:53 -05:00
& str ) )
{
window - > sm_client_id = g_strdup ( str ) ;
meta_XFree ( str ) ;
}
2001-06-09 17:58:30 -04:00
}
else
2002-08-24 17:28:02 -04:00
{
meta_verbose ( " Didn't find a client leader for %s \n " , window - > desc ) ;
if ( ! meta_prefs_get_disable_workarounds ( ) )
{
/* Some broken apps (kdelibs fault?) set SM_CLIENT_ID on the app
* instead of the client leader
*/
char * str ;
str = NULL ;
if ( meta_prop_get_latin1_string ( window - > display , window - > xwindow ,
2008-05-02 14:49:01 -04:00
window - > display - > atom_SM_CLIENT_ID ,
2002-08-24 17:28:02 -04:00
& str ) )
{
if ( window - > sm_client_id = = NULL ) /* first time through */
meta_warning ( _ ( " Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER window as specified in the ICCCM. \n " ) ,
window - > desc ) ;
2008-12-18 07:41:56 -05:00
2002-08-24 17:28:02 -04:00
window - > sm_client_id = g_strdup ( str ) ;
meta_XFree ( str ) ;
}
}
}
meta_verbose ( " Window %s client leader: 0x%lx SM_CLIENT_ID: '%s' \n " ,
window - > desc , window - > xclient_leader ,
2002-12-19 15:18:54 -05:00
window - > sm_client_id ? window - > sm_client_id : " none " ) ;
2001-06-09 17:58:30 -04:00
}
2009-01-27 00:03:06 -05:00
void
meta_window_update_role ( MetaWindow * window )
2001-06-09 17:58:30 -04:00
{
2002-01-03 22:25:53 -05:00
char * str ;
2008-12-18 07:41:56 -05:00
2009-06-14 08:37:57 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2001-06-09 17:58:30 -04:00
if ( window - > role )
g_free ( window - > role ) ;
window - > role = NULL ;
2002-01-03 22:25:53 -05:00
if ( meta_prop_get_latin1_string ( window - > display , window - > xwindow ,
2008-05-02 14:49:01 -04:00
window - > display - > atom_WM_WINDOW_ROLE ,
2002-01-03 22:25:53 -05:00
& str ) )
{
window - > role = g_strdup ( str ) ;
meta_XFree ( str ) ;
}
2001-06-09 17:58:30 -04:00
meta_verbose ( " Updated role of %s to '%s' \n " ,
2002-05-04 18:53:13 -04:00
window - > desc , window - > role ? window - > role : " null " ) ;
2001-06-09 17:58:30 -04:00
}
2009-01-27 00:03:06 -05:00
void
meta_window_update_net_wm_type ( MetaWindow * window )
2001-06-09 23:17:15 -04:00
{
2002-01-03 22:25:53 -05:00
int n_atoms ;
2001-06-09 23:17:15 -04:00
Atom * atoms ;
int i ;
window - > type_atom = None ;
2002-01-03 22:25:53 -05:00
n_atoms = 0 ;
atoms = NULL ;
2008-12-18 07:41:56 -05:00
meta_prop_get_atom_list ( window - > display , window - > xwindow ,
2008-05-02 14:49:01 -04:00
window - > display - > atom__NET_WM_WINDOW_TYPE ,
2003-06-12 03:03:04 -04:00
& atoms , & n_atoms ) ;
2001-06-21 02:08:35 -04:00
2001-06-09 23:17:15 -04:00
i = 0 ;
while ( i < n_atoms )
{
/* We break as soon as we find one we recognize,
* supposed to prefer those near the front of the list
*/
2008-05-02 14:49:01 -04:00
if ( atoms [ i ] = = window - > display - > atom__NET_WM_WINDOW_TYPE_DESKTOP | |
atoms [ i ] = = window - > display - > atom__NET_WM_WINDOW_TYPE_DOCK | |
atoms [ i ] = = window - > display - > atom__NET_WM_WINDOW_TYPE_TOOLBAR | |
atoms [ i ] = = window - > display - > atom__NET_WM_WINDOW_TYPE_MENU | |
atoms [ i ] = = window - > display - > atom__NET_WM_WINDOW_TYPE_UTILITY | |
2008-11-23 14:28:40 -05:00
atoms [ i ] = = window - > display - > atom__NET_WM_WINDOW_TYPE_SPLASH | |
atoms [ i ] = = window - > display - > atom__NET_WM_WINDOW_TYPE_DIALOG | |
atoms [ i ] = =
window - > display - > atom__NET_WM_WINDOW_TYPE_DROPDOWN_MENU | |
atoms [ i ] = = window - > display - > atom__NET_WM_WINDOW_TYPE_POPUP_MENU | |
atoms [ i ] = = window - > display - > atom__NET_WM_WINDOW_TYPE_TOOLTIP | |
atoms [ i ] = =
window - > display - > atom__NET_WM_WINDOW_TYPE_NOTIFICATION | |
atoms [ i ] = = window - > display - > atom__NET_WM_WINDOW_TYPE_COMBO | |
atoms [ i ] = = window - > display - > atom__NET_WM_WINDOW_TYPE_DND | |
atoms [ i ] = = window - > display - > atom__NET_WM_WINDOW_TYPE_NORMAL )
2001-06-09 23:17:15 -04:00
{
window - > type_atom = atoms [ i ] ;
break ;
}
2008-12-18 07:41:56 -05:00
2001-06-09 23:17:15 -04:00
+ + i ;
}
2008-12-18 07:41:56 -05:00
2002-01-03 22:25:53 -05:00
meta_XFree ( atoms ) ;
2001-06-09 23:17:15 -04:00
if ( meta_is_verbose ( ) )
{
char * str ;
2002-05-04 18:53:13 -04:00
str = NULL ;
if ( window - > type_atom ! = None )
{
meta_error_trap_push ( window - > display ) ;
str = XGetAtomName ( window - > display - > xdisplay , window - > type_atom ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2002-05-04 18:53:13 -04:00
}
2001-06-09 23:17:15 -04:00
meta_verbose ( " Window %s type atom %s \n " , window - > desc ,
str ? str : " (none) " ) ;
if ( str )
2002-01-03 22:25:53 -05:00
meta_XFree ( str ) ;
2001-06-09 23:17:15 -04:00
}
2008-12-18 07:41:56 -05:00
2009-01-27 00:03:06 -05:00
meta_window_recalc_window_type ( window ) ;
2001-06-09 23:17:15 -04:00
}
2002-10-21 17:44:35 -04:00
static void
2003-02-27 20:24:44 -05:00
redraw_icon ( MetaWindow * window )
{
/* We could probably be smart and just redraw the icon here,
* instead of the whole frame .
*/
2003-09-30 15:45:56 -04:00
if ( window - > frame & & ( window - > mapped | | window - > frame - > mapped ) )
2003-02-27 20:24:44 -05:00
meta_ui_queue_frame_draw ( window - > screen - > ui , window - > frame - > xwindow ) ;
}
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
void
2003-02-27 20:24:44 -05:00
meta_window_update_icon_now ( MetaWindow * window )
2001-08-19 21:42:44 -04:00
{
2002-02-09 18:03:52 -05:00
GdkPixbuf * icon ;
GdkPixbuf * mini_icon ;
2001-08-19 21:42:44 -04:00
2009-06-14 08:37:57 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2002-02-09 18:03:52 -05:00
icon = NULL ;
mini_icon = NULL ;
2008-12-18 07:41:56 -05:00
2002-02-09 18:03:52 -05:00
if ( meta_read_icons ( window - > screen ,
window - > xwindow ,
& window - > icon_cache ,
window - > wm_hints_pixmap ,
window - > wm_hints_mask ,
& icon ,
META_ICON_WIDTH , META_ICON_HEIGHT ,
& mini_icon ,
META_MINI_ICON_WIDTH ,
META_MINI_ICON_HEIGHT ) )
{
if ( window - > icon )
g_object_unref ( G_OBJECT ( window - > icon ) ) ;
2008-12-18 07:41:56 -05:00
2002-02-09 18:03:52 -05:00
if ( window - > mini_icon )
g_object_unref ( G_OBJECT ( window - > mini_icon ) ) ;
2008-12-18 07:41:56 -05:00
2002-02-09 18:03:52 -05:00
window - > icon = icon ;
window - > mini_icon = mini_icon ;
2003-02-27 20:24:44 -05:00
2008-12-05 20:03:27 -05:00
g_object_freeze_notify ( G_OBJECT ( window ) ) ;
g_object_notify ( G_OBJECT ( window ) , " icon " ) ;
g_object_notify ( G_OBJECT ( window ) , " mini-icon " ) ;
g_object_thaw_notify ( G_OBJECT ( window ) ) ;
2003-02-27 20:24:44 -05:00
redraw_icon ( window ) ;
2001-08-23 20:32:17 -04:00
}
2008-12-18 07:41:56 -05:00
2001-09-17 01:50:02 -04:00
g_assert ( window - > icon ) ;
g_assert ( window - > mini_icon ) ;
2001-06-23 22:22:10 -04:00
}
2003-02-27 20:24:44 -05:00
static gboolean
idle_update_icon ( gpointer data )
2002-05-24 04:16:59 -04:00
{
2003-02-27 20:24:44 -05:00
GSList * tmp ;
GSList * copy ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
guint queue_index = GPOINTER_TO_INT ( data ) ;
2003-02-27 20:24:44 -05:00
meta_topic ( META_DEBUG_GEOMETRY , " Clearing the update_icon queue \n " ) ;
/* Work with a copy, for reentrancy. The allowed reentrancy isn't
* complete ; destroying a window while we ' re in here would result in
* badness . But it ' s OK to queue / unqueue update_icons .
*/
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
copy = g_slist_copy ( queue_pending [ queue_index ] ) ;
g_slist_free ( queue_pending [ queue_index ] ) ;
queue_pending [ queue_index ] = NULL ;
2009-09-25 15:47:22 -04:00
queue_later [ queue_index ] = 0 ;
2003-02-27 20:24:44 -05:00
destroying_windows_disallowed + = 1 ;
2008-12-18 07:41:56 -05:00
2003-02-27 20:24:44 -05:00
tmp = copy ;
while ( tmp ! = NULL )
{
MetaWindow * window ;
window = tmp - > data ;
2008-12-18 07:41:56 -05:00
meta_window_update_icon_now ( window ) ;
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-10 21:15:33 -04:00
window - > is_in_queues & = ~ META_QUEUE_UPDATE_ICON ;
2008-12-18 07:41:56 -05:00
2003-02-27 20:24:44 -05:00
tmp = tmp - > next ;
}
g_slist_free ( copy ) ;
destroying_windows_disallowed - = 1 ;
2008-12-18 07:41:56 -05:00
2003-02-27 20:24:44 -05:00
return FALSE ;
}
2003-06-25 23:09:38 -04:00
GList *
2002-01-10 01:31:31 -05:00
meta_window_get_workspaces ( MetaWindow * window )
{
if ( window - > on_all_workspaces )
2002-10-16 16:12:24 -04:00
return window - > screen - > workspaces ;
2012-03-13 00:37:31 -04:00
else if ( window - > workspace ! = NULL )
2006-02-11 00:06:08 -05:00
return window - > workspace - > list_containing_self ;
2012-03-13 00:37:31 -04:00
else
return NULL ;
2002-01-10 01:31:31 -05:00
}
static void
invalidate_work_areas ( MetaWindow * window )
{
GList * tmp ;
tmp = meta_window_get_workspaces ( window ) ;
2008-12-18 07:41:56 -05:00
2002-01-10 01:31:31 -05:00
while ( tmp ! = NULL )
{
meta_workspace_invalidate_work_area ( tmp - > data ) ;
tmp = tmp - > next ;
}
}
2003-06-25 23:09:38 -04:00
void
meta_window_update_struts ( MetaWindow * window )
2002-01-10 01:31:31 -05:00
{
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
GSList * old_struts ;
GSList * new_struts ;
GSList * old_iter , * new_iter ;
2002-01-10 01:31:31 -05:00
gulong * struts = NULL ;
int nitems ;
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
gboolean changed ;
2003-06-28 12:12:32 -04:00
2009-06-14 08:37:57 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2002-01-10 01:31:31 -05:00
meta_verbose ( " Updating struts for %s \n " , window - > desc ) ;
2003-06-25 23:09:38 -04:00
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
old_struts = window - > struts ;
2008-12-18 07:41:56 -05:00
new_struts = NULL ;
2003-06-25 23:09:38 -04:00
2002-01-10 01:31:31 -05:00
if ( meta_prop_get_cardinal_list ( window - > display ,
window - > xwindow ,
2008-05-02 14:49:01 -04:00
window - > display - > atom__NET_WM_STRUT_PARTIAL ,
2002-01-10 01:31:31 -05:00
& struts , & nitems ) )
{
2003-06-25 23:09:38 -04:00
if ( nitems ! = 12 )
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
meta_verbose ( " _NET_WM_STRUT_PARTIAL on %s has %d values instead "
" of 12 \n " ,
window - > desc , nitems ) ;
2003-06-25 23:09:38 -04:00
else
{
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
/* Pull out the strut info for each side in the hint */
int i ;
for ( i = 0 ; i < 4 ; i + + )
{
MetaStrut * temp ;
int thickness , strut_begin , strut_end ;
thickness = struts [ i ] ;
if ( thickness = = 0 )
continue ;
strut_begin = struts [ 4 + ( i * 2 ) ] ;
strut_end = struts [ 4 + ( i * 2 ) + 1 ] ;
temp = g_new ( MetaStrut , 1 ) ;
2009-03-17 16:53:01 -04:00
temp - > side = 1 < < i ; /* See MetaSide def. Matches nicely, eh? */
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
temp - > rect = window - > screen - > rect ;
switch ( temp - > side )
{
case META_SIDE_RIGHT :
temp - > rect . x = BOX_RIGHT ( temp - > rect ) - thickness ;
/* Intentionally fall through without breaking */
case META_SIDE_LEFT :
temp - > rect . width = thickness ;
temp - > rect . y = strut_begin ;
temp - > rect . height = strut_end - strut_begin + 1 ;
break ;
case META_SIDE_BOTTOM :
temp - > rect . y = BOX_BOTTOM ( temp - > rect ) - thickness ;
/* Intentionally fall through without breaking */
case META_SIDE_TOP :
temp - > rect . height = thickness ;
temp - > rect . x = strut_begin ;
temp - > rect . width = strut_end - strut_begin + 1 ;
break ;
default :
g_assert_not_reached ( ) ;
}
new_struts = g_slist_prepend ( new_struts , temp ) ;
}
meta_verbose ( " _NET_WM_STRUT_PARTIAL struts %lu %lu %lu %lu for "
" window %s \n " ,
2008-12-18 07:41:56 -05:00
struts [ 0 ] , struts [ 1 ] , struts [ 2 ] , struts [ 3 ] ,
2003-06-25 23:09:38 -04:00
window - > desc ) ;
}
2002-01-10 01:31:31 -05:00
meta_XFree ( struts ) ;
}
else
{
meta_verbose ( " No _NET_WM_STRUT property for %s \n " ,
window - > desc ) ;
}
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
if ( ! new_struts & &
meta_prop_get_cardinal_list ( window - > display ,
window - > xwindow ,
2008-05-02 14:49:01 -04:00
window - > display - > atom__NET_WM_STRUT ,
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
& struts , & nitems ) )
2003-06-25 23:09:38 -04:00
{
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
if ( nitems ! = 4 )
meta_verbose ( " _NET_WM_STRUT on %s has %d values instead of 4 \n " ,
window - > desc , nitems ) ;
else
2003-06-25 23:09:38 -04:00
{
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
/* Pull out the strut info for each side in the hint */
int i ;
for ( i = 0 ; i < 4 ; i + + )
2003-06-25 23:09:38 -04:00
{
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
MetaStrut * temp ;
int thickness ;
thickness = struts [ i ] ;
if ( thickness = = 0 )
continue ;
temp = g_new ( MetaStrut , 1 ) ;
temp - > side = 1 < < i ;
temp - > rect = window - > screen - > rect ;
switch ( temp - > side )
{
case META_SIDE_RIGHT :
temp - > rect . x = BOX_RIGHT ( temp - > rect ) - thickness ;
/* Intentionally fall through without breaking */
case META_SIDE_LEFT :
temp - > rect . width = thickness ;
break ;
case META_SIDE_BOTTOM :
temp - > rect . y = BOX_BOTTOM ( temp - > rect ) - thickness ;
/* Intentionally fall through without breaking */
case META_SIDE_TOP :
temp - > rect . height = thickness ;
break ;
default :
g_assert_not_reached ( ) ;
}
new_struts = g_slist_prepend ( new_struts , temp ) ;
2003-06-25 23:09:38 -04:00
}
2008-12-18 07:41:56 -05:00
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
meta_verbose ( " _NET_WM_STRUT struts %lu %lu %lu %lu for window %s \n " ,
2008-12-18 07:41:56 -05:00
struts [ 0 ] , struts [ 1 ] , struts [ 2 ] , struts [ 3 ] ,
2003-06-25 23:09:38 -04:00
window - > desc ) ;
}
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
meta_XFree ( struts ) ;
}
else if ( ! new_struts )
{
meta_verbose ( " No _NET_WM_STRUT property for %s \n " ,
window - > desc ) ;
2003-06-25 23:09:38 -04:00
}
2008-12-18 07:41:56 -05:00
Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02 Elijah Newren <newren gmail com>
Patch from Carlo Wood to fix handling of unidirectional
maximization and partial struts. #358311.
* src/constraints.c (constrain_maximization):
determine target size for unidirectionally maximized windows by
determining how far they can be maximized without hitting
orthogonal struts. Avoids weird "empty spaces".
* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
new function
2007-04-02 Elijah Newren <newren gmail com>
Make the strut lists (stored in workspaces) record both the
rectangle and the side that the strut is on. Lots of code
cleanups relating to struts.
* src/boxes.h (struct MetaStrut):
new struct for struts
* src/window.[ch] (struct MetaStruts, struct MetaWindow,
meta_window_update_struts):
overhaul to make window's struts remember their side as well as
their rectangular location, and just use a list instead of several
copies of near-identical code for left/right/top/bottom (allowing
us to nuke MetaStruts struct as well)
* src/testboxes.c (new_meta_strut, get_strut_list):
* src/workspace.c (ensure_work_areas_validated):
* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
meta_rectangle_expand_to_avoiding_struts,
get_disjoint_strut_rect_list_in_region, fix_up_edges,
meta_rectangle_find_onscreen_edges,
meta_rectangle_find_nonintersected_xinerama_edges):
modify to handle struts being rectangle + side instead of just rectangle
* src/workspace.c (ensure_work_areas_validated):
simplify strut list creation considerably given MetaWindow change,
modify work_area computations to take advantage of region
computations being done (makes the code shorter as well as more
robust against pathological cases).
* src/util.[ch] (meta_free_gslist_and_elements):
new convenience function
* src/common.h (enum MetaDirection):
* src/edge-resistance.c (movement_towards_edge):
* src/boxes.c (meta_rectangle_edge_aligns,
rectangle_and_edge_intersection, split_edge):
Add more MetaDirection fields for convenience
* src/boxes.h (enum FixedDirections):
* src/constraints.c (setup_constraint_info, place_window_if_needed):
add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
code more clear
svn path=/trunk/; revision=3144
2007-04-02 23:41:10 -04:00
/* Determine whether old_struts and new_struts are the same */
old_iter = old_struts ;
new_iter = new_struts ;
while ( old_iter & & new_iter )
{
MetaStrut * old_strut = ( MetaStrut * ) old_iter - > data ;
MetaStrut * new_strut = ( MetaStrut * ) new_iter - > data ;
if ( old_strut - > side ! = new_strut - > side | |
! meta_rectangle_equal ( & old_strut - > rect , & new_strut - > rect ) )
break ;
old_iter = old_iter - > next ;
new_iter = new_iter - > next ;
}
changed = ( old_iter ! = NULL | | new_iter ! = NULL ) ;
/* Update appropriately */
meta_free_gslist_and_elements ( old_struts ) ;
window - > struts = new_struts ;
if ( changed )
{
2002-06-08 01:13:55 -04:00
meta_topic ( META_DEBUG_WORKAREA ,
" Invalidating work areas of window %s due to struts update \n " ,
window - > desc ) ;
invalidate_work_areas ( window ) ;
}
else
{
meta_topic ( META_DEBUG_WORKAREA ,
" Struts on %s were unchanged \n " , window - > desc ) ;
}
2002-01-10 01:31:31 -05:00
}
deleted and moved into window-props.c (meta_window_new_with_attrs): added
2006-03-25 Thomas Thurman <thomas@thurman.org.uk>
* src/window.c, src/window.h (update_net_wm_state,
update_mwm_hints, update_wm_class, update_transient_for):
deleted and moved into window-props.c
(meta_window_new_with_attrs): added constructing field
and four new initial properties (as above)
(meta_window_recalc_features,
meta_window_recalc_window_type): new functions
* src/window-props.c (init_net_wm_state, reload_net_wm_state
init_mwm_hints, reload_mwm_hints, init_wm_class,
reload_mwm_class, init_transient_for, reload_transient_for):
new functions, moved in from window.c
(meta_display_init_window_prop_hooks): initialise new properties
2006-03-25 17:57:22 -05:00
void
meta_window_recalc_window_type ( MetaWindow * window )
{
recalc_window_type ( window ) ;
}
2001-06-09 23:17:15 -04:00
static void
recalc_window_type ( MetaWindow * window )
{
2002-02-06 22:07:56 -05:00
MetaWindowType old_type ;
2001-06-11 01:47:51 -04:00
old_type = window - > type ;
2008-12-18 07:41:56 -05:00
2009-07-31 14:11:54 -04:00
if ( window - > type_atom ! = None )
2001-06-09 23:17:15 -04:00
{
2008-05-02 14:49:01 -04:00
if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_DESKTOP )
2001-06-09 23:17:15 -04:00
window - > type = META_WINDOW_DESKTOP ;
2008-05-02 14:49:01 -04:00
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_DOCK )
2001-06-09 23:17:15 -04:00
window - > type = META_WINDOW_DOCK ;
2008-05-02 14:49:01 -04:00
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_TOOLBAR )
2001-06-09 23:17:15 -04:00
window - > type = META_WINDOW_TOOLBAR ;
2008-05-02 14:49:01 -04:00
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_MENU )
2001-06-09 23:17:15 -04:00
window - > type = META_WINDOW_MENU ;
2008-05-02 14:49:01 -04:00
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_UTILITY )
2002-02-09 01:54:44 -05:00
window - > type = META_WINDOW_UTILITY ;
2008-05-02 14:49:01 -04:00
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_SPLASH )
2002-02-09 01:54:44 -05:00
window - > type = META_WINDOW_SPLASHSCREEN ;
2008-11-23 14:28:40 -05:00
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_DIALOG )
window - > type = META_WINDOW_DIALOG ;
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_NORMAL )
window - > type = META_WINDOW_NORMAL ;
2009-07-31 14:11:54 -04:00
/* The below are *typically* override-redirect windows, but the spec does
* not disallow using them for managed windows .
*/
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_DROPDOWN_MENU )
window - > type = META_WINDOW_DROPDOWN_MENU ;
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_POPUP_MENU )
window - > type = META_WINDOW_POPUP_MENU ;
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_TOOLTIP )
window - > type = META_WINDOW_TOOLTIP ;
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_NOTIFICATION )
window - > type = META_WINDOW_NOTIFICATION ;
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_COMBO )
window - > type = META_WINDOW_COMBO ;
else if ( window - > type_atom = = window - > display - > atom__NET_WM_WINDOW_TYPE_DND )
window - > type = META_WINDOW_DND ;
2002-02-08 23:15:41 -05:00
else
2009-07-31 14:11:54 -04:00
{
char * atom_name ;
/*
* Fallback on a normal type , and print warning . Don ' t abort .
*/
window - > type = META_WINDOW_NORMAL ;
meta_error_trap_push ( window - > display ) ;
atom_name = XGetAtomName ( window - > display - > xdisplay ,
window - > type_atom ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2009-07-31 14:11:54 -04:00
meta_warning ( " Unrecognized type atom [%s] set for %s \n " ,
atom_name ? atom_name : " unknown " ,
window - > desc ) ;
if ( atom_name )
XFree ( atom_name ) ;
}
2001-06-09 23:17:15 -04:00
}
else if ( window - > xtransient_for ! = None )
{
window - > type = META_WINDOW_DIALOG ;
}
else
{
window - > type = META_WINDOW_NORMAL ;
}
if ( window - > type = = META_WINDOW_DIALOG & &
window - > wm_state_modal )
window - > type = META_WINDOW_MODAL_DIALOG ;
2008-12-18 07:41:56 -05:00
2009-08-06 12:08:45 -04:00
/* We don't want to allow override-redirect windows to have decorated-window
* types since that ' s just confusing .
*/
if ( window - > override_redirect )
{
switch ( window - > type )
{
/* Decorated types */
case META_WINDOW_NORMAL :
case META_WINDOW_DIALOG :
case META_WINDOW_MODAL_DIALOG :
case META_WINDOW_MENU :
case META_WINDOW_UTILITY :
window - > type = META_WINDOW_OVERRIDE_OTHER ;
break ;
/* Undecorated types, normally not override-redirect */
case META_WINDOW_DESKTOP :
case META_WINDOW_DOCK :
case META_WINDOW_TOOLBAR :
case META_WINDOW_SPLASHSCREEN :
/* Undecorated types, normally override-redirect types */
case META_WINDOW_DROPDOWN_MENU :
case META_WINDOW_POPUP_MENU :
case META_WINDOW_TOOLTIP :
case META_WINDOW_NOTIFICATION :
case META_WINDOW_COMBO :
case META_WINDOW_DND :
/* To complete enum */
case META_WINDOW_OVERRIDE_OTHER :
break ;
}
}
2006-01-20 17:03:56 -05:00
meta_verbose ( " Calculated type %u for %s, old type %u \n " ,
2001-07-30 23:59:55 -04:00
window - > type , window - > desc , old_type ) ;
2001-06-10 14:46:46 -04:00
2001-06-11 01:47:51 -04:00
if ( old_type ! = window - > type )
{
2009-02-11 07:16:41 -05:00
gboolean old_decorated = window - > decorated ;
2009-08-04 03:06:30 -04:00
GObject * object = G_OBJECT ( window ) ;
2009-02-11 07:16:41 -05:00
2001-06-23 14:30:27 -04:00
recalc_window_features ( window ) ;
2008-12-18 07:41:56 -05:00
2008-11-23 14:28:40 -05:00
if ( ! window - > override_redirect )
set_net_wm_state ( window ) ;
2008-12-18 07:41:56 -05:00
2001-06-23 14:30:27 -04:00
/* Update frame */
if ( window - > decorated )
meta_window_ensure_frame ( window ) ;
else
meta_window_destroy_frame ( window ) ;
2008-12-18 07:41:56 -05:00
2001-06-11 01:47:51 -04:00
/* update stacking constraints */
2002-09-24 17:22:06 -04:00
meta_window_update_layer ( window ) ;
2003-02-27 17:44:36 -05:00
meta_window_grab_keys ( window ) ;
2009-02-11 07:16:41 -05:00
2009-08-04 03:06:30 -04:00
g_object_freeze_notify ( object ) ;
2009-02-11 07:16:41 -05:00
if ( old_decorated ! = window - > decorated )
2009-08-04 03:06:30 -04:00
g_object_notify ( object , " decorated " ) ;
g_object_notify ( object , " window-type " ) ;
g_object_thaw_notify ( object ) ;
2001-06-11 01:47:51 -04:00
}
2001-06-09 23:17:15 -04:00
}
2002-10-21 17:44:35 -04:00
static void
2002-08-01 19:52:47 -04:00
set_allowed_actions_hint ( MetaWindow * window )
{
2007-04-11 13:15:54 -04:00
# define MAX_N_ACTIONS 12
2002-08-01 19:52:47 -04:00
unsigned long data [ MAX_N_ACTIONS ] ;
int i ;
i = 0 ;
if ( window - > has_move_func )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_ACTION_MOVE ;
2002-08-01 19:52:47 -04:00
+ + i ;
}
if ( window - > has_resize_func )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_ACTION_RESIZE ;
2003-11-17 11:46:01 -05:00
+ + i ;
2007-07-22 20:46:03 -04:00
}
if ( window - > has_fullscreen_func )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_ACTION_FULLSCREEN ;
2003-11-16 19:06:58 -05:00
+ + i ;
}
if ( window - > has_minimize_func )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_ACTION_MINIMIZE ;
2002-08-01 19:52:47 -04:00
+ + i ;
}
if ( window - > has_shade_func )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_ACTION_SHADE ;
2002-08-01 19:52:47 -04:00
+ + i ;
}
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
/* sticky according to EWMH is different from mutter's sticky;
* mutter doesn ' t support EWMH sticky
2003-11-16 19:06:58 -05:00
*/
if ( window - > has_maximize_func )
2002-08-01 19:52:47 -04:00
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_ACTION_MAXIMIZE_HORZ ;
2003-11-16 19:06:58 -05:00
+ + i ;
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_ACTION_MAXIMIZE_VERT ;
2002-08-01 19:52:47 -04:00
+ + i ;
}
/* We always allow this */
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_ACTION_CHANGE_DESKTOP ;
2002-08-01 19:52:47 -04:00
+ + i ;
2003-11-16 19:06:58 -05:00
if ( window - > has_close_func )
{
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_ACTION_CLOSE ;
2003-11-16 19:06:58 -05:00
+ + i ;
}
2002-08-01 19:52:47 -04:00
2007-04-11 13:15:54 -04:00
/* I guess we always allow above/below operations */
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_ACTION_ABOVE ;
2007-04-11 13:15:54 -04:00
+ + i ;
2008-05-02 14:49:01 -04:00
data [ i ] = window - > display - > atom__NET_WM_ACTION_BELOW ;
2007-04-11 13:15:54 -04:00
+ + i ;
2002-08-01 19:52:47 -04:00
g_assert ( i < = MAX_N_ACTIONS ) ;
meta_verbose ( " Setting _NET_WM_ALLOWED_ACTIONS with %d atoms \n " , i ) ;
2008-12-18 07:41:56 -05:00
2002-08-01 19:52:47 -04:00
meta_error_trap_push ( window - > display ) ;
XChangeProperty ( window - > display - > xdisplay , window - > xwindow ,
2008-05-02 14:49:01 -04:00
window - > display - > atom__NET_WM_ALLOWED_ACTIONS ,
2002-08-01 19:52:47 -04:00
XA_ATOM ,
32 , PropModeReplace , ( guchar * ) data , i ) ;
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2002-08-01 19:52:47 -04:00
# undef MAX_N_ACTIONS
}
2003-02-27 20:24:44 -05:00
void
meta_window_recalc_features ( MetaWindow * window )
{
recalc_window_features ( window ) ;
}
2001-06-23 14:30:27 -04:00
static void
recalc_window_features ( MetaWindow * window )
{
2002-08-01 19:52:47 -04:00
gboolean old_has_close_func ;
gboolean old_has_minimize_func ;
gboolean old_has_move_func ;
gboolean old_has_resize_func ;
gboolean old_has_shade_func ;
gboolean old_always_sticky ;
old_has_close_func = window - > has_close_func ;
old_has_minimize_func = window - > has_minimize_func ;
old_has_move_func = window - > has_move_func ;
old_has_resize_func = window - > has_resize_func ;
old_has_shade_func = window - > has_shade_func ;
old_always_sticky = window - > always_sticky ;
2001-06-23 14:30:27 -04:00
/* Use MWM hints initially */
window - > decorated = window - > mwm_decorated ;
2002-06-21 23:23:02 -04:00
window - > border_only = window - > mwm_border_only ;
2001-06-23 14:30:27 -04:00
window - > has_close_func = window - > mwm_has_close_func ;
window - > has_minimize_func = window - > mwm_has_minimize_func ;
window - > has_maximize_func = window - > mwm_has_maximize_func ;
window - > has_move_func = window - > mwm_has_move_func ;
2008-12-18 07:41:56 -05:00
window - > has_resize_func = TRUE ;
2002-08-24 16:54:23 -04:00
/* If min_size == max_size, then don't allow resize */
if ( window - > size_hints . min_width = = window - > size_hints . max_width & &
window - > size_hints . min_height = = window - > size_hints . max_height )
window - > has_resize_func = FALSE ;
else if ( ! window - > mwm_has_resize_func )
{
/* We ignore mwm_has_resize_func because WM_NORMAL_HINTS is the
* authoritative source for that info . Some apps such as mplayer or
* xine disable resize via MWM but not WM_NORMAL_HINTS , but that
* leads to e . g . us not fullscreening their windows . Apps that set
* MWM but not WM_NORMAL_HINTS are basically broken . We complain
* about these apps but make them work .
*/
2008-12-18 07:41:56 -05:00
2002-08-24 16:54:23 -04:00
meta_warning ( _ ( " Window %s sets an MWM hint indicating it isn't resizable, but sets min size %d x %d and max size %d x %d; this doesn't make much sense. \n " ) ,
window - > desc ,
window - > size_hints . min_width ,
window - > size_hints . min_height ,
window - > size_hints . max_width ,
window - > size_hints . max_height ) ;
}
2001-06-23 14:30:27 -04:00
window - > has_shade_func = TRUE ;
2002-02-23 17:58:02 -05:00
window - > has_fullscreen_func = TRUE ;
2002-05-26 11:54:38 -04:00
window - > always_sticky = FALSE ;
2008-12-18 07:41:56 -05:00
2001-06-23 14:30:27 -04:00
/* Semantic category overrides the MWM hints */
2002-04-30 23:23:46 -04:00
if ( window - > type = = META_WINDOW_TOOLBAR )
window - > decorated = FALSE ;
2002-05-26 11:54:38 -04:00
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
if ( meta_window_is_attached_dialog ( window ) )
window - > border_only = TRUE ;
2010-09-10 05:55:20 -04:00
2002-05-26 11:54:38 -04:00
if ( window - > type = = META_WINDOW_DESKTOP | |
2008-11-23 14:28:40 -05:00
window - > type = = META_WINDOW_DOCK | |
window - > override_redirect )
2002-05-26 11:54:38 -04:00
window - > always_sticky = TRUE ;
2008-12-18 07:41:56 -05:00
2011-10-17 11:42:35 -04:00
if ( window - > override_redirect | |
meta_window_get_frame_type ( window ) = = META_FRAME_TYPE_LAST )
2001-06-23 14:30:27 -04:00
{
2001-07-30 23:59:55 -04:00
window - > decorated = FALSE ;
2001-06-23 14:30:27 -04:00
window - > has_close_func = FALSE ;
window - > has_shade_func = FALSE ;
2002-04-30 23:23:46 -04:00
/* FIXME this keeps panels and things from using
* NET_WM_MOVERESIZE ; the problem is that some
* panels ( edge panels ) have fixed possible locations ,
* and others ( " floating panels " ) do not .
*
* Perhaps we should require edge panels to explicitly
* disable movement ?
*/
2001-06-23 14:30:27 -04:00
window - > has_move_func = FALSE ;
window - > has_resize_func = FALSE ;
}
2008-12-18 07:41:56 -05:00
2001-06-23 14:30:27 -04:00
if ( window - > type ! = META_WINDOW_NORMAL )
{
window - > has_minimize_func = FALSE ;
window - > has_maximize_func = FALSE ;
2002-02-23 17:58:02 -05:00
window - > has_fullscreen_func = FALSE ;
2001-06-23 14:30:27 -04:00
}
2001-08-03 00:20:27 -04:00
if ( ! window - > has_resize_func )
2008-12-18 07:41:56 -05:00
{
2002-02-23 17:58:02 -05:00
window - > has_maximize_func = FALSE ;
2008-12-18 07:41:56 -05:00
2002-08-24 16:54:23 -04:00
/* don't allow fullscreen if we can't resize, unless the size
* is entire screen size ( kind of broken , because we
2009-08-31 09:52:16 -04:00
* actually fullscreen to monitor size not screen size )
2002-08-24 16:54:23 -04:00
*/
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
if ( window - > size_hints . min_width = = window - > screen - > rect . width & &
2006-08-04 18:33:20 -04:00
window - > size_hints . min_height = = window - > screen - > rect . height )
2002-08-15 01:14:49 -04:00
; /* leave fullscreen available */
else
window - > has_fullscreen_func = FALSE ;
2002-09-22 21:43:20 -04:00
}
2002-08-24 16:54:23 -04:00
2002-09-22 21:43:20 -04:00
/* We leave fullscreen windows decorated, just push the frame outside
* the screen . This avoids flickering to unparent them .
*
* Note that setting has_resize_func = FALSE here must come after the
* above code that may disable fullscreen , because if the window
* is not resizable purely due to fullscreen , we don ' t want to
* disable fullscreen mode .
*/
if ( window - > fullscreen )
{
window - > has_shade_func = FALSE ;
window - > has_move_func = FALSE ;
window - > has_resize_func = FALSE ;
window - > has_maximize_func = FALSE ;
2002-02-23 17:58:02 -05:00
}
2001-08-03 00:20:27 -04:00
2012-03-12 23:18:03 -04:00
if ( window - > has_maximize_func )
{
MetaRectangle work_area ;
MetaFrameBorders borders ;
int min_frame_width , min_frame_height ;
meta_window_get_work_area_current_monitor ( window , & work_area ) ;
meta_frame_calc_borders ( window - > frame , & borders ) ;
min_frame_width = window - > size_hints . min_width + borders . visible . left + borders . visible . right ;
min_frame_height = window - > size_hints . min_height + borders . visible . top + borders . visible . bottom ;
if ( min_frame_width > = work_area . width | |
min_frame_height > = work_area . height )
window - > has_maximize_func = FALSE ;
}
2002-09-22 21:43:20 -04:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
" Window %s fullscreen = %d not resizable, maximizable = %d fullscreenable = %d min size %dx%d max size %dx%d \n " ,
window - > desc ,
window - > fullscreen ,
window - > has_maximize_func , window - > has_fullscreen_func ,
window - > size_hints . min_width ,
window - > size_hints . min_height ,
window - > size_hints . max_width ,
window - > size_hints . max_height ) ;
2008-12-18 07:41:56 -05:00
2001-08-03 00:20:27 -04:00
/* no shading if not decorated */
2002-07-24 22:45:38 -04:00
if ( ! window - > decorated | | window - > border_only )
2001-08-03 00:20:27 -04:00
window - > has_shade_func = FALSE ;
2002-07-06 15:05:37 -04:00
window - > skip_taskbar = FALSE ;
window - > skip_pager = FALSE ;
if ( window - > wm_state_skip_taskbar )
window - > skip_taskbar = TRUE ;
2008-12-18 07:41:56 -05:00
2002-07-06 15:05:37 -04:00
if ( window - > wm_state_skip_pager )
window - > skip_pager = TRUE ;
2008-12-18 07:41:56 -05:00
2002-07-06 15:05:37 -04:00
switch ( window - > type )
{
/* Force skip taskbar/pager on these window types */
case META_WINDOW_DESKTOP :
case META_WINDOW_DOCK :
case META_WINDOW_TOOLBAR :
case META_WINDOW_MENU :
case META_WINDOW_UTILITY :
case META_WINDOW_SPLASHSCREEN :
2008-11-23 14:28:40 -05:00
case META_WINDOW_DROPDOWN_MENU :
case META_WINDOW_POPUP_MENU :
case META_WINDOW_TOOLTIP :
case META_WINDOW_NOTIFICATION :
case META_WINDOW_COMBO :
case META_WINDOW_DND :
case META_WINDOW_OVERRIDE_OTHER :
2002-07-06 15:05:37 -04:00
window - > skip_taskbar = TRUE ;
window - > skip_pager = TRUE ;
break ;
case META_WINDOW_DIALOG :
case META_WINDOW_MODAL_DIALOG :
2003-01-09 18:28:01 -05:00
/* only skip taskbar if we have a real transient parent */
if ( window - > xtransient_for ! = None & &
window - > xtransient_for ! = window - > screen - > xroot )
window - > skip_taskbar = TRUE ;
2002-07-06 15:05:37 -04:00
break ;
2008-12-18 07:41:56 -05:00
2002-07-06 15:05:37 -04:00
case META_WINDOW_NORMAL :
break ;
}
2002-08-01 19:52:47 -04:00
2002-09-22 21:43:20 -04:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
" Window %s decorated = %d border_only = %d has_close = %d has_minimize = %d has_maximize = %d has_move = %d has_shade = %d skip_taskbar = %d skip_pager = %d \n " ,
window - > desc ,
window - > decorated ,
window - > border_only ,
window - > has_close_func ,
window - > has_minimize_func ,
window - > has_maximize_func ,
window - > has_move_func ,
window - > has_shade_func ,
window - > skip_taskbar ,
window - > skip_pager ) ;
2008-12-18 07:41:56 -05:00
2002-08-01 19:52:47 -04:00
/* FIXME:
* Lame workaround for recalc_window_features
* being used overzealously . The fix is to
* only recalc_window_features when something
* has actually changed .
*/
2007-04-10 22:37:30 -04:00
if ( window - > constructing | |
old_has_close_func ! = window - > has_close_func | |
2002-08-01 19:52:47 -04:00
old_has_minimize_func ! = window - > has_minimize_func | |
old_has_move_func ! = window - > has_move_func | |
old_has_resize_func ! = window - > has_resize_func | |
old_has_shade_func ! = window - > has_shade_func | |
old_always_sticky ! = window - > always_sticky )
set_allowed_actions_hint ( window ) ;
2008-12-18 07:41:56 -05:00
2011-07-02 07:08:17 -04:00
if ( window - > has_resize_func ! = old_has_resize_func )
g_object_notify ( G_OBJECT ( window ) , " resizeable " ) ;
2001-06-23 14:30:27 -04:00
/* FIXME perhaps should ensure if we don't have a shade func,
* we aren ' t shaded , etc .
*/
}
2001-06-23 01:49:35 -04:00
static void
menu_callback ( MetaWindowMenu * menu ,
Display * xdisplay ,
Window client_xwindow ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
guint32 timestamp ,
2001-06-23 01:49:35 -04:00
MetaMenuOp op ,
int workspace_index ,
gpointer data )
{
MetaDisplay * display ;
MetaWindow * window ;
2003-12-21 01:31:40 -05:00
MetaWorkspace * workspace ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
display = meta_display_for_x_display ( xdisplay ) ;
window = meta_display_lookup_x_window ( display , client_xwindow ) ;
2003-12-21 01:31:40 -05:00
workspace = NULL ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
if ( window ! = NULL ) /* window can be NULL */
{
2006-01-20 17:03:56 -05:00
meta_verbose ( " Menu op %u on %s \n " , op , window - > desc ) ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
switch ( op )
{
2010-03-31 16:34:02 -04:00
case META_MENU_OP_NONE :
/* nothing */
break ;
2001-06-23 01:49:35 -04:00
case META_MENU_OP_DELETE :
2004-06-21 12:47:27 -04:00
meta_window_delete ( window , timestamp ) ;
2001-06-23 01:49:35 -04:00
break ;
case META_MENU_OP_MINIMIZE :
meta_window_minimize ( window ) ;
break ;
case META_MENU_OP_UNMAXIMIZE :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
meta_window_unmaximize ( window ,
META_MAXIMIZE_HORIZONTAL |
META_MAXIMIZE_VERTICAL ) ;
2001-06-23 01:49:35 -04:00
break ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
case META_MENU_OP_MAXIMIZE :
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
meta_window_maximize ( window ,
META_MAXIMIZE_HORIZONTAL |
META_MAXIMIZE_VERTICAL ) ;
2001-06-23 01:49:35 -04:00
break ;
case META_MENU_OP_UNSHADE :
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_window_unshade ( window , timestamp ) ;
2001-06-23 01:49:35 -04:00
break ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
case META_MENU_OP_SHADE :
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
meta_window_shade ( window , timestamp ) ;
2001-06-23 01:49:35 -04:00
break ;
2008-12-18 07:41:56 -05:00
2003-12-21 01:31:40 -05:00
case META_MENU_OP_MOVE_LEFT :
workspace = meta_workspace_get_neighbor ( window - > screen - > active_workspace ,
META_MOTION_LEFT ) ;
break ;
2001-06-23 01:49:35 -04:00
2003-12-21 01:31:40 -05:00
case META_MENU_OP_MOVE_RIGHT :
workspace = meta_workspace_get_neighbor ( window - > screen - > active_workspace ,
META_MOTION_RIGHT ) ;
break ;
2001-06-23 01:49:35 -04:00
2003-12-21 01:31:40 -05:00
case META_MENU_OP_MOVE_UP :
workspace = meta_workspace_get_neighbor ( window - > screen - > active_workspace ,
META_MOTION_UP ) ;
break ;
case META_MENU_OP_MOVE_DOWN :
workspace = meta_workspace_get_neighbor ( window - > screen - > active_workspace ,
META_MOTION_DOWN ) ;
break ;
case META_MENU_OP_WORKSPACES :
workspace = meta_screen_get_workspace_by_index ( window - > screen ,
workspace_index ) ;
2001-06-23 01:49:35 -04:00
break ;
case META_MENU_OP_STICK :
meta_window_stick ( window ) ;
break ;
case META_MENU_OP_UNSTICK :
meta_window_unstick ( window ) ;
break ;
2003-12-21 01:31:40 -05:00
case META_MENU_OP_ABOVE :
2007-04-16 00:48:14 -04:00
case META_MENU_OP_UNABOVE :
2006-12-27 10:51:49 -05:00
if ( window - > wm_state_above = = FALSE )
meta_window_make_above ( window ) ;
else
meta_window_unmake_above ( window ) ;
2003-12-21 01:31:40 -05:00
break ;
2001-07-11 02:22:00 -04:00
case META_MENU_OP_MOVE :
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
meta_window_begin_grab_op ( window ,
META_GRAB_OP_KEYBOARD_MOVING ,
2006-10-12 20:28:34 -04:00
TRUE ,
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
timestamp ) ;
2001-07-11 02:22:00 -04:00
break ;
case META_MENU_OP_RESIZE :
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
meta_window_begin_grab_op ( window ,
META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN ,
2006-10-12 20:28:34 -04:00
TRUE ,
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
timestamp ) ;
2001-07-11 02:22:00 -04:00
break ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
case META_MENU_OP_RECOVER :
meta_window_shove_titlebar_onscreen ( window ) ;
break ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
default :
meta_warning ( G_STRLOC " : Unknown window op \n " ) ;
break ;
}
2003-12-21 01:31:40 -05:00
if ( workspace )
{
meta_window_change_workspace ( window ,
workspace ) ;
}
2001-06-23 01:49:35 -04:00
}
else
{
meta_verbose ( " Menu callback on nonexistent window \n " ) ;
}
2002-10-28 00:35:30 -05:00
if ( display - > window_menu = = menu )
{
display - > window_menu = NULL ;
display - > window_with_menu = NULL ;
}
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
meta_ui_window_menu_free ( menu ) ;
}
void
meta_window_show_menu ( MetaWindow * window ,
int root_x ,
int root_y ,
int button ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
guint32 timestamp )
2001-06-23 01:49:35 -04:00
{
MetaMenuOp ops ;
MetaMenuOp insensitive ;
MetaWindowMenu * menu ;
2003-12-21 01:31:40 -05:00
MetaWorkspaceLayout layout ;
2004-08-07 13:50:40 -04:00
int n_workspaces ;
2007-05-25 10:36:12 -04:00
gboolean ltr ;
2008-12-18 07:41:56 -05:00
2009-06-14 08:11:29 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
2003-03-16 20:19:07 -05:00
if ( window - > display - > window_menu )
{
meta_ui_window_menu_free ( window - > display - > window_menu ) ;
window - > display - > window_menu = NULL ;
window - > display - > window_with_menu = NULL ;
}
2010-03-31 16:34:02 -04:00
ops = META_MENU_OP_NONE ;
insensitive = META_MENU_OP_NONE ;
2001-06-23 01:49:35 -04:00
2004-08-07 13:50:40 -04:00
ops | = ( META_MENU_OP_DELETE | META_MENU_OP_MINIMIZE | META_MENU_OP_MOVE | META_MENU_OP_RESIZE ) ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
if ( ! meta_window_titlebar_is_onscreen ( window ) & &
window - > type ! = META_WINDOW_DOCK & &
window - > type ! = META_WINDOW_DESKTOP )
ops | = META_MENU_OP_RECOVER ;
2011-03-09 07:06:21 -05:00
if ( ! meta_prefs_get_workspaces_only_on_primary ( ) | |
meta_window_is_on_primary_monitor ( window ) )
{
n_workspaces = meta_screen_get_n_workspaces ( window - > screen ) ;
2004-08-07 13:50:40 -04:00
2011-03-09 07:06:21 -05:00
if ( n_workspaces > 1 )
ops | = META_MENU_OP_WORKSPACES ;
2003-12-21 01:31:40 -05:00
2011-03-09 07:06:21 -05:00
meta_screen_calc_workspace_layout ( window - > screen ,
n_workspaces ,
meta_workspace_index ( window - > screen - > active_workspace ) ,
& layout ) ;
2003-12-21 01:31:40 -05:00
2011-03-09 07:06:21 -05:00
if ( ! window - > on_all_workspaces )
{
ltr = meta_ui_get_direction ( ) = = META_UI_DIRECTION_LTR ;
if ( layout . current_col > 0 )
ops | = ltr ? META_MENU_OP_MOVE_LEFT : META_MENU_OP_MOVE_RIGHT ;
if ( ( layout . current_col < layout . cols - 1 ) & &
( layout . current_row * layout . cols + ( layout . current_col + 1 ) < n_workspaces ) )
ops | = ltr ? META_MENU_OP_MOVE_RIGHT : META_MENU_OP_MOVE_LEFT ;
if ( layout . current_row > 0 )
ops | = META_MENU_OP_MOVE_UP ;
if ( ( layout . current_row < layout . rows - 1 ) & &
( ( layout . current_row + 1 ) * layout . cols + layout . current_col < n_workspaces ) )
ops | = META_MENU_OP_MOVE_DOWN ;
}
2004-08-07 13:50:40 -04:00
2011-03-09 07:06:21 -05:00
meta_screen_free_workspace_layout ( & layout ) ;
2004-01-17 13:57:26 -05:00
2011-03-09 07:06:21 -05:00
ops | = META_MENU_OP_UNSTICK ;
ops | = META_MENU_OP_STICK ;
}
2005-10-03 15:22:40 -04:00
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
if ( META_WINDOW_MAXIMIZED ( window ) )
2001-06-23 01:49:35 -04:00
ops | = META_MENU_OP_UNMAXIMIZE ;
else
ops | = META_MENU_OP_MAXIMIZE ;
2008-12-18 07:41:56 -05:00
2007-04-16 00:48:14 -04:00
if ( window - > wm_state_above )
ops | = META_MENU_OP_UNABOVE ;
else
ops | = META_MENU_OP_ABOVE ;
2008-12-18 07:41:56 -05:00
2001-06-23 02:54:28 -04:00
if ( ! window - > has_maximize_func )
insensitive | = META_MENU_OP_UNMAXIMIZE | META_MENU_OP_MAXIMIZE ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
if ( ! window - > has_minimize_func )
insensitive | = META_MENU_OP_MINIMIZE ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
if ( ! window - > has_close_func )
insensitive | = META_MENU_OP_DELETE ;
2001-06-23 02:54:28 -04:00
if ( ! window - > has_shade_func )
insensitive | = META_MENU_OP_SHADE | META_MENU_OP_UNSHADE ;
2001-07-11 02:22:00 -04:00
2002-07-02 22:32:40 -04:00
if ( ! META_WINDOW_ALLOWS_MOVE ( window ) )
2001-07-11 02:22:00 -04:00
insensitive | = META_MENU_OP_MOVE ;
2002-07-02 22:32:40 -04:00
if ( ! META_WINDOW_ALLOWS_RESIZE ( window ) )
2001-07-11 02:22:00 -04:00
insensitive | = META_MENU_OP_RESIZE ;
2002-05-26 11:54:38 -04:00
if ( window - > always_sticky )
2007-07-31 08:20:14 -04:00
insensitive | = META_MENU_OP_STICK | META_MENU_OP_UNSTICK | META_MENU_OP_WORKSPACES ;
2004-01-17 13:57:26 -05:00
if ( ( window - > type = = META_WINDOW_DESKTOP ) | |
( window - > type = = META_WINDOW_DOCK ) | |
2012-05-30 07:57:04 -04:00
( window - > type = = META_WINDOW_SPLASHSCREEN | |
META_WINDOW_MAXIMIZED ( window ) ) )
2007-04-16 00:48:14 -04:00
insensitive | = META_MENU_OP_ABOVE | META_MENU_OP_UNABOVE ;
2004-12-24 14:40:09 -05:00
/* If all operations are disabled, just quit without showing the menu.
* This is the case , for example , with META_WINDOW_DESKTOP windows .
*/
if ( ( ops & ~ insensitive ) = = 0 )
return ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
menu =
meta_ui_window_menu_new ( window - > screen - > ui ,
window - > xwindow ,
ops ,
insensitive ,
meta_window_get_net_wm_desktop ( window ) ,
meta_screen_get_n_workspaces ( window - > screen ) ,
menu_callback ,
2008-12-18 07:41:56 -05:00
NULL ) ;
2001-06-23 01:49:35 -04:00
2002-10-28 00:35:30 -05:00
window - > display - > window_menu = menu ;
window - > display - > window_with_menu = window ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
meta_verbose ( " Popping up window menu for %s \n " , window - > desc ) ;
2008-12-18 07:41:56 -05:00
2001-06-23 01:49:35 -04:00
meta_ui_window_menu_popup ( menu , root_x , root_y , button , timestamp ) ;
}
2001-06-24 04:09:10 -04:00
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
void
meta_window_shove_titlebar_onscreen ( MetaWindow * window )
{
MetaRectangle outer_rect ;
GList * onscreen_region ;
int horiz_amount , vert_amount ;
int newx , newy ;
2009-06-15 18:25:07 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* If there's no titlebar, don't bother */
if ( ! window - > frame )
return ;
/* Get the basic info we need */
meta_window_get_outer_rect ( window , & outer_rect ) ;
onscreen_region = window - > screen - > active_workspace - > screen_region ;
/* Extend the region (just in case the window is too big to fit on the
* screen ) , then shove the window on screen , then return the region to
* normal .
*/
horiz_amount = outer_rect . width ;
vert_amount = outer_rect . height ;
meta_rectangle_expand_region ( onscreen_region ,
horiz_amount ,
2008-12-18 07:41:56 -05:00
horiz_amount ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
0 ,
vert_amount ) ;
meta_rectangle_shove_into_region ( onscreen_region ,
FIXED_DIRECTION_X ,
& outer_rect ) ;
meta_rectangle_expand_region ( onscreen_region ,
- horiz_amount ,
2008-12-18 07:41:56 -05:00
- horiz_amount ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
0 ,
- vert_amount ) ;
newx = outer_rect . x + window - > frame - > child_x ;
newy = outer_rect . y + window - > frame - > child_y ;
meta_window_move_resize ( window ,
2005-11-22 10:48:30 -05:00
FALSE ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
newx ,
newy ,
2008-12-18 07:41:56 -05:00
window - > rect . width ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
window - > rect . height ) ;
}
gboolean
meta_window_titlebar_is_onscreen ( MetaWindow * window )
{
MetaRectangle titlebar_rect ;
GList * onscreen_region ;
gboolean is_onscreen ;
const int min_height_needed = 8 ;
const int min_width_percent = 0.5 ;
const int min_width_absolute = 50 ;
/* Titlebar can't be offscreen if there is no titlebar... */
if ( ! window - > frame )
return FALSE ;
2008-12-18 07:41:56 -05:00
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* Get the rectangle corresponding to the titlebar */
meta_window_get_outer_rect ( window , & titlebar_rect ) ;
titlebar_rect . height = window - > frame - > child_y ;
/* Run through the spanning rectangles for the screen and see if one of
* them overlaps with the titlebar sufficiently to consider it onscreen .
*/
is_onscreen = FALSE ;
onscreen_region = window - > screen - > active_workspace - > screen_region ;
while ( onscreen_region )
{
MetaRectangle * spanning_rect = onscreen_region - > data ;
MetaRectangle overlap ;
2008-12-18 07:41:56 -05:00
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
meta_rectangle_intersect ( & titlebar_rect , spanning_rect , & overlap ) ;
if ( overlap . height > MIN ( titlebar_rect . height , min_height_needed ) & &
2008-12-18 07:41:56 -05:00
overlap . width > MIN ( titlebar_rect . width * min_width_percent ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
min_width_absolute ) )
{
is_onscreen = TRUE ;
break ;
}
2008-12-18 07:41:56 -05:00
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
onscreen_region = onscreen_region - > next ;
}
return is_onscreen ;
}
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
static double
timeval_to_ms ( const GTimeVal * timeval )
2002-10-03 17:49:13 -04:00
{
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
return ( timeval - > tv_sec * G_USEC_PER_SEC + timeval - > tv_usec ) / 1000.0 ;
}
static double
time_diff ( const GTimeVal * first ,
const GTimeVal * second )
{
double first_ms = timeval_to_ms ( first ) ;
double second_ms = timeval_to_ms ( second ) ;
return first_ms - second_ms ;
2002-10-03 17:49:13 -04:00
}
2002-08-10 01:27:17 -04:00
static gboolean
2008-12-18 07:41:56 -05:00
check_moveresize_frequency ( MetaWindow * window ,
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
gdouble * remaining )
2002-08-10 01:27:17 -04:00
{
GTimeVal current_time ;
2008-12-18 07:41:56 -05:00
2002-08-10 01:27:17 -04:00
g_get_current_time ( & current_time ) ;
2002-12-09 22:23:04 -05:00
# ifdef HAVE_XSYNC
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
if ( ! window - > disable_sync & &
window - > display - > grab_sync_request_alarm ! = None )
{
if ( window - > sync_request_time . tv_sec ! = 0 | |
window - > sync_request_time . tv_usec ! = 0 )
{
double elapsed =
time_diff ( & current_time , & window - > sync_request_time ) ;
if ( elapsed < 1000.0 )
{
/* We want to be sure that the timeout happens at
* a time where elapsed will definitely be
* greater than 1000 , so we can disable sync
*/
if ( remaining )
* remaining = 1000.0 - elapsed + 100 ;
2008-12-18 07:41:56 -05:00
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
return FALSE ;
}
else
{
/* We have now waited for more than a second for the
* application to respond to the sync request
*/
window - > disable_sync = TRUE ;
return TRUE ;
}
}
else
{
/* No outstanding sync requests. Go ahead and resize
*/
return TRUE ;
}
}
2002-12-09 22:23:04 -05:00
else
# endif /* HAVE_XSYNC */
2002-12-08 21:53:16 -05:00
{
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
const double max_resizes_per_second = 25.0 ;
const double ms_between_resizes = 1000.0 / max_resizes_per_second ;
double elapsed ;
elapsed = time_diff ( & current_time , & window - > display - > grab_last_moveresize_time ) ;
if ( elapsed > = 0.0 & & elapsed < ms_between_resizes )
{
meta_topic ( META_DEBUG_RESIZING ,
" Delaying move/resize as only %g of %g ms elapsed \n " ,
elapsed , ms_between_resizes ) ;
2008-12-18 07:41:56 -05:00
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
if ( remaining )
* remaining = ( ms_between_resizes - elapsed ) ;
return FALSE ;
}
2008-12-18 07:41:56 -05:00
2002-12-09 22:23:04 -05:00
meta_topic ( META_DEBUG_RESIZING ,
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
" Checked moveresize freq, allowing move/resize now (%g of %g seconds elapsed) \n " ,
elapsed / 1000.0 , 1.0 / max_resizes_per_second ) ;
2008-12-18 07:41:56 -05:00
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
return TRUE ;
2002-12-08 21:53:16 -05:00
}
2002-08-10 01:27:17 -04:00
}
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
static gboolean
update_move_timeout ( gpointer data )
{
MetaWindow * window = data ;
2008-12-18 07:41:56 -05:00
update_move ( window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
window - > display - > grab_last_user_action_was_snap ,
window - > display - > grab_latest_motion_x ,
window - > display - > grab_latest_motion_y ) ;
return FALSE ;
}
2002-08-10 01:27:17 -04:00
static void
2001-07-25 22:55:35 -04:00
update_move ( MetaWindow * window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
gboolean snap ,
2001-07-25 22:55:35 -04:00
int x ,
int y )
{
int dx , dy ;
2001-07-25 23:58:24 -04:00
int new_x , new_y ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
MetaRectangle old ;
2003-06-12 01:55:06 -04:00
int shake_threshold ;
2006-02-25 11:54:39 -05:00
MetaDisplay * display = window - > display ;
2008-12-18 07:41:56 -05:00
2006-02-25 11:54:39 -05:00
display - > grab_latest_motion_x = x ;
display - > grab_latest_motion_y = y ;
2008-12-18 07:41:56 -05:00
2006-02-25 11:54:39 -05:00
dx = x - display - > grab_anchor_root_x ;
dy = y - display - > grab_anchor_root_y ;
2003-06-12 01:55:06 -04:00
2006-02-25 11:54:39 -05:00
new_x = display - > grab_anchor_window_pos . x + dx ;
new_y = display - > grab_anchor_window_pos . y + dy ;
2003-06-12 01:55:06 -04:00
2003-10-12 02:25:38 -04:00
meta_verbose ( " x,y = %d,%d anchor ptr %d,%d anchor pos %d,%d dx,dy %d,%d \n " ,
x , y ,
2006-02-25 11:54:39 -05:00
display - > grab_anchor_root_x ,
display - > grab_anchor_root_y ,
display - > grab_anchor_window_pos . x ,
display - > grab_anchor_window_pos . y ,
2003-10-12 02:25:38 -04:00
dx , dy ) ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* Don't bother doing anything if no move has been specified. (This
* happens often , even in keyboard moving , due to the warping of the
* pointer .
*/
if ( dx = = 0 & & dy = = 0 )
return ;
2010-06-24 14:41:28 -04:00
/* Originally for detaching maximized windows, but we use this
* for the zones at the sides of the monitor where trigger tiling
* because it ' s about the right size
2003-06-12 01:55:06 -04:00
*/
# define DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR 6
shake_threshold = meta_ui_get_drag_threshold ( window - > screen - > ui ) *
DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR ;
2008-12-18 07:41:56 -05:00
2011-10-20 10:41:52 -04:00
if ( snap )
{
/* We don't want to tile while snapping. Also, clear any previous tile
request . */
window - > tile_mode = META_TILE_NONE ;
window - > tile_monitor_number = - 1 ;
}
else if ( meta_prefs_get_edge_tiling ( ) & &
! META_WINDOW_MAXIMIZED ( window ) & &
! META_WINDOW_TILED_SIDE_BY_SIDE ( window ) )
2010-06-24 14:41:28 -04:00
{
const MetaMonitorInfo * monitor ;
MetaRectangle work_area ;
2010-09-24 15:35:00 -04:00
/* For side-by-side tiling we are interested in the inside vertical
2011-03-29 14:11:07 -04:00
* edges of the work area of the monitor where the pointer is located ,
* and in the outside top edge for maximized tiling .
*
* For maximized tiling we use the outside edge instead of the
* inside edge , because we don ' t want to force users to maximize
* windows they are placing near the top of their screens .
2011-10-08 11:00:16 -04:00
*
* The " current " idea of meta_window_get_work_area_current_monitor ( ) and
* meta_screen_get_current_monitor ( ) is slightly different : the former
* refers to the monitor which contains the largest part of the window ,
* the latter to the one where the pointer is located .
2010-06-24 14:41:28 -04:00
*/
2012-06-08 04:21:10 -04:00
monitor = meta_screen_get_current_monitor_info ( window - > screen ) ;
2010-06-24 14:41:28 -04:00
meta_window_get_work_area_for_monitor ( window ,
monitor - > number ,
& work_area ) ;
2011-03-29 14:11:07 -04:00
/* Check if the cursor is in a position which triggers tiling
* and set tile_mode accordingly .
2010-09-24 15:35:00 -04:00
*/
2011-03-29 14:11:07 -04:00
if ( meta_window_can_tile_side_by_side ( window ) & &
x > = monitor - > rect . x & & x < ( work_area . x + shake_threshold ) )
window - > tile_mode = META_TILE_LEFT ;
else if ( meta_window_can_tile_side_by_side ( window ) & &
x > = work_area . x + work_area . width - shake_threshold & &
x < ( monitor - > rect . x + monitor - > rect . width ) )
window - > tile_mode = META_TILE_RIGHT ;
else if ( meta_window_can_tile_maximized ( window ) & &
y > = monitor - > rect . y & & y < = work_area . y )
window - > tile_mode = META_TILE_MAXIMIZED ;
else
window - > tile_mode = META_TILE_NONE ;
2011-10-08 11:00:16 -04:00
if ( window - > tile_mode ! = META_TILE_NONE )
window - > tile_monitor_number = monitor - > number ;
2010-06-24 14:41:28 -04:00
}
/* shake loose (unmaximize) maximized or tiled window if dragged beyond
* the threshold in the Y direction . Tiled windows can also be pulled
* loose via X motion .
*/
if ( ( META_WINDOW_MAXIMIZED ( window ) & & ABS ( dy ) > = shake_threshold ) | |
2010-09-24 14:31:36 -04:00
( META_WINDOW_TILED_SIDE_BY_SIDE ( window ) & & ( MAX ( ABS ( dx ) , ABS ( dy ) ) > = shake_threshold ) ) )
2003-06-12 01:55:06 -04:00
{
2003-07-27 22:09:20 -04:00
double prop ;
2010-12-02 16:43:21 -05:00
/* Shake loose, so that the window snaps back to maximized
* when dragged near the top ; do not snap back if tiling
* is enabled , as top edge tiling can be used in that case
*/
window - > shaken_loose = ! meta_prefs_get_edge_tiling ( ) ;
2010-06-24 14:41:28 -04:00
window - > tile_mode = META_TILE_NONE ;
2008-12-18 07:41:56 -05:00
2003-07-27 22:09:20 -04:00
/* move the unmaximized window to the cursor */
2008-12-18 07:41:56 -05:00
prop =
( ( double ) ( x - display - > grab_initial_window_pos . x ) ) /
2006-02-25 11:54:39 -05:00
( ( double ) display - > grab_initial_window_pos . width ) ;
2003-06-12 01:55:06 -04:00
2008-12-18 07:41:56 -05:00
display - > grab_initial_window_pos . x =
2004-02-16 14:01:25 -05:00
x - window - > saved_rect . width * prop ;
2006-02-25 11:54:39 -05:00
display - > grab_initial_window_pos . y = y ;
2003-07-27 22:09:20 -04:00
if ( window - > frame )
2004-02-16 14:01:25 -05:00
{
2006-02-25 11:54:39 -05:00
display - > grab_initial_window_pos . y + = window - > frame - > child_y / 2 ;
2004-02-16 14:01:25 -05:00
}
2006-02-25 11:54:39 -05:00
window - > saved_rect . x = display - > grab_initial_window_pos . x ;
window - > saved_rect . y = display - > grab_initial_window_pos . y ;
display - > grab_anchor_root_x = x ;
display - > grab_anchor_root_y = y ;
2003-07-27 22:09:20 -04:00
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
meta_window_unmaximize ( window ,
META_MAXIMIZE_HORIZONTAL |
META_MAXIMIZE_VERTICAL ) ;
2003-06-12 01:55:06 -04:00
return ;
}
2010-06-24 14:41:28 -04:00
2009-08-31 09:52:16 -04:00
/* remaximize window on another monitor if window has been shaken
* loose or it is still maximized ( then move straight )
2003-06-12 01:55:06 -04:00
*/
2010-06-24 14:41:28 -04:00
else if ( ( window - > shaken_loose | | META_WINDOW_MAXIMIZED ( window ) ) & &
2010-09-24 15:35:00 -04:00
window - > tile_mode ! = META_TILE_LEFT & & window - > tile_mode ! = META_TILE_RIGHT )
2003-06-12 01:55:06 -04:00
{
2009-08-31 09:52:16 -04:00
const MetaMonitorInfo * wmonitor ;
2003-07-27 22:09:20 -04:00
MetaRectangle work_area ;
2003-06-12 01:55:06 -04:00
int monitor ;
2010-09-24 15:35:00 -04:00
window - > tile_mode = META_TILE_NONE ;
2009-08-31 09:52:16 -04:00
wmonitor = meta_screen_get_monitor_for_window ( window - > screen , window ) ;
2003-06-12 01:55:06 -04:00
2009-08-31 09:52:16 -04:00
for ( monitor = 0 ; monitor < window - > screen - > n_monitor_infos ; monitor + + )
2003-06-12 01:55:06 -04:00
{
2009-08-31 09:52:16 -04:00
meta_window_get_work_area_for_monitor ( window , monitor , & work_area ) ;
2003-07-27 22:09:20 -04:00
2009-08-31 09:52:16 -04:00
/* check if cursor is near the top of a monitor work area */
2003-07-27 22:09:20 -04:00
if ( x > = work_area . x & &
x < ( work_area . x + work_area . width ) & &
2004-02-16 14:01:25 -05:00
y > = work_area . y & &
y < ( work_area . y + shake_threshold ) )
2003-06-12 01:55:06 -04:00
{
/* move the saved rect if window will become maximized on an
* other monitor so user isn ' t surprised on a later unmaximize
*/
2009-08-31 09:52:16 -04:00
if ( wmonitor - > number ! = monitor )
2003-06-12 01:55:06 -04:00
{
2003-07-27 22:09:20 -04:00
window - > saved_rect . x = work_area . x ;
2004-02-16 14:01:25 -05:00
window - > saved_rect . y = work_area . y ;
2008-12-18 07:41:56 -05:00
if ( window - > frame )
2003-06-12 01:55:06 -04:00
{
window - > saved_rect . x + = window - > frame - > child_x ;
window - > saved_rect . y + = window - > frame - > child_y ;
}
2006-12-05 20:26:30 -05:00
window - > user_rect . x = window - > saved_rect . x ;
window - > user_rect . y = window - > saved_rect . y ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
meta_window_unmaximize ( window ,
META_MAXIMIZE_HORIZONTAL |
META_MAXIMIZE_VERTICAL ) ;
2003-06-12 01:55:06 -04:00
}
2001-07-25 22:55:35 -04:00
2006-02-25 11:54:39 -05:00
display - > grab_initial_window_pos = work_area ;
display - > grab_anchor_root_x = x ;
display - > grab_anchor_root_y = y ;
2004-02-16 14:01:25 -05:00
window - > shaken_loose = FALSE ;
2008-12-18 07:41:56 -05:00
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
meta_window_maximize ( window ,
META_MAXIMIZE_HORIZONTAL |
META_MAXIMIZE_VERTICAL ) ;
2003-06-12 01:55:06 -04:00
2004-02-16 14:01:25 -05:00
return ;
2003-06-12 01:55:06 -04:00
}
}
}
2010-06-24 14:41:28 -04:00
/* Delay showing the tile preview slightly to make it more unlikely to
* trigger it unwittingly , e . g . when shaking loose the window or moving
* it to another monitor .
*/
meta_screen_tile_preview_update ( window - > screen ,
window - > tile_mode ! = META_TILE_NONE ) ;
2009-05-07 13:53:47 -04:00
meta_window_get_client_root_coords ( window , & old ) ;
2005-08-02 22:22:00 -04:00
2010-06-24 14:41:28 -04:00
/* Don't allow movement in the maximized directions or while tiled */
2010-09-24 14:31:36 -04:00
if ( window - > maximized_horizontally | | META_WINDOW_TILED_SIDE_BY_SIDE ( window ) )
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
new_x = old . x ;
if ( window - > maximized_vertically )
new_y = old . y ;
/* Do any edge resistance/snapping */
2008-12-18 07:41:56 -05:00
meta_window_edge_resistance_for_move ( window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
old . x ,
old . y ,
& new_x ,
& new_y ,
update_move_timeout ,
snap ,
FALSE ) ;
2009-05-07 13:53:47 -04:00
meta_window_move ( window , TRUE , new_x , new_y ) ;
2001-07-25 22:55:35 -04:00
}
2010-09-18 16:28:30 -04:00
/* When resizing a maximized window by using alt-middle-drag (resizing
* with the grips or the menu for a maximized window is not enabled ) ,
* the user can " break " out of the maximized state . This checks for
* that possibility . During such a break - out resize the user can also
* return to the previous maximization state by resizing back to near
* the original size .
*/
static MetaMaximizeFlags
check_resize_unmaximize ( MetaWindow * window ,
int dx ,
int dy )
{
int threshold ;
MetaMaximizeFlags new_unmaximize ;
# define DRAG_THRESHOLD_TO_RESIZE_THRESHOLD_FACTOR 3
threshold = meta_ui_get_drag_threshold ( window - > screen - > ui ) *
DRAG_THRESHOLD_TO_RESIZE_THRESHOLD_FACTOR ;
new_unmaximize = 0 ;
if ( window - > maximized_horizontally | |
2010-09-19 10:54:08 -04:00
window - > tile_mode ! = META_TILE_NONE | |
2010-09-18 16:28:30 -04:00
( window - > display - > grab_resize_unmaximize & META_MAXIMIZE_HORIZONTAL ) ! = 0 )
{
int x_amount ;
/* We allow breaking out of maximization in either direction, to make
* the window larger than the monitor as well as smaller than the
* monitor . If we wanted to only allow resizing smaller than the
* monitor , we ' d use - dx for NE / E / SE and dx for SW / W / NW .
*/
switch ( window - > display - > grab_op )
{
case META_GRAB_OP_RESIZING_NE :
case META_GRAB_OP_KEYBOARD_RESIZING_NE :
case META_GRAB_OP_RESIZING_E :
case META_GRAB_OP_KEYBOARD_RESIZING_E :
case META_GRAB_OP_RESIZING_SE :
case META_GRAB_OP_KEYBOARD_RESIZING_SE :
case META_GRAB_OP_RESIZING_SW :
case META_GRAB_OP_KEYBOARD_RESIZING_SW :
case META_GRAB_OP_RESIZING_W :
case META_GRAB_OP_KEYBOARD_RESIZING_W :
case META_GRAB_OP_RESIZING_NW :
case META_GRAB_OP_KEYBOARD_RESIZING_NW :
x_amount = dx < 0 ? - dx : dx ;
break ;
default :
x_amount = 0 ;
break ;
}
if ( x_amount > threshold )
new_unmaximize | = META_MAXIMIZE_HORIZONTAL ;
}
if ( window - > maximized_vertically | |
( window - > display - > grab_resize_unmaximize & META_MAXIMIZE_VERTICAL ) ! = 0 )
{
int y_amount ;
switch ( window - > display - > grab_op )
{
case META_GRAB_OP_RESIZING_N :
case META_GRAB_OP_KEYBOARD_RESIZING_N :
case META_GRAB_OP_RESIZING_NE :
case META_GRAB_OP_KEYBOARD_RESIZING_NE :
case META_GRAB_OP_RESIZING_NW :
case META_GRAB_OP_KEYBOARD_RESIZING_NW :
case META_GRAB_OP_RESIZING_SE :
case META_GRAB_OP_KEYBOARD_RESIZING_SE :
case META_GRAB_OP_RESIZING_S :
case META_GRAB_OP_KEYBOARD_RESIZING_S :
case META_GRAB_OP_RESIZING_SW :
case META_GRAB_OP_KEYBOARD_RESIZING_SW :
y_amount = dy < 0 ? - dy : dy ;
break ;
default :
y_amount = 0 ;
break ;
}
if ( y_amount > threshold )
new_unmaximize | = META_MAXIMIZE_VERTICAL ;
}
/* Metacity doesn't have a full user interface for only horizontally or
* vertically maximized , so while only unmaximizing in the direction drags
* has some advantages , it will also confuse the user . So , we always
* unmaximize both ways if possible .
*/
if ( new_unmaximize ! = 0 )
{
new_unmaximize = 0 ;
if ( window - > maximized_horizontally | |
( window - > display - > grab_resize_unmaximize & META_MAXIMIZE_HORIZONTAL ) ! = 0 )
new_unmaximize | = META_MAXIMIZE_HORIZONTAL ;
if ( window - > maximized_vertically | |
( window - > display - > grab_resize_unmaximize & META_MAXIMIZE_VERTICAL ) ! = 0 )
new_unmaximize | = META_MAXIMIZE_VERTICAL ;
}
return new_unmaximize ;
}
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
static gboolean
update_resize_timeout ( gpointer data )
{
MetaWindow * window = data ;
2008-12-18 07:41:56 -05:00
update_resize ( window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
window - > display - > grab_last_user_action_was_snap ,
window - > display - > grab_latest_motion_x ,
window - > display - > grab_latest_motion_y ,
TRUE ) ;
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
return FALSE ;
}
2001-07-25 22:55:35 -04:00
static void
update_resize ( MetaWindow * window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
gboolean snap ,
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
int x , int y ,
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
gboolean force )
2001-07-25 22:55:35 -04:00
{
int dx , dy ;
int new_w , new_h ;
int gravity ;
2002-12-09 22:23:04 -05:00
MetaRectangle old ;
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
double remaining ;
2010-09-18 16:28:30 -04:00
MetaMaximizeFlags new_unmaximize ;
2008-12-18 07:41:56 -05:00
2002-12-09 22:23:04 -05:00
window - > display - > grab_latest_motion_x = x ;
window - > display - > grab_latest_motion_y = y ;
2008-12-18 07:41:56 -05:00
2003-10-12 02:25:38 -04:00
dx = x - window - > display - > grab_anchor_root_x ;
dy = y - window - > display - > grab_anchor_root_y ;
2001-07-25 22:55:35 -04:00
2012-07-03 16:30:02 -04:00
/* Attached modal dialogs are special in that size
* changes apply to both sides , so that the dialog
2011-03-21 13:23:53 -04:00
* remains centered to the parent .
*/
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
if ( meta_window_is_attached_dialog ( window ) )
2012-07-03 16:30:02 -04:00
{
dx * = 2 ;
dy * = 2 ;
}
2011-03-21 13:23:53 -04:00
2003-10-12 02:25:38 -04:00
new_w = window - > display - > grab_anchor_window_pos . width ;
new_h = window - > display - > grab_anchor_window_pos . height ;
2001-07-25 22:55:35 -04:00
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* Don't bother doing anything if no move has been specified. (This
* happens often , even in keyboard resizing , due to the warping of the
* pointer .
*/
if ( dx = = 0 & & dy = = 0 )
return ;
2008-12-18 07:41:56 -05:00
2005-08-02 22:22:00 -04:00
if ( window - > display - > grab_op = = META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN )
{
if ( ( dx > 0 ) & & ( dy > 0 ) )
{
window - > display - > grab_op = META_GRAB_OP_KEYBOARD_RESIZING_SE ;
meta_window_update_keyboard_resize ( window , TRUE ) ;
}
else if ( ( dx < 0 ) & & ( dy > 0 ) )
{
window - > display - > grab_op = META_GRAB_OP_KEYBOARD_RESIZING_SW ;
meta_window_update_keyboard_resize ( window , TRUE ) ;
}
else if ( ( dx > 0 ) & & ( dy < 0 ) )
{
window - > display - > grab_op = META_GRAB_OP_KEYBOARD_RESIZING_NE ;
meta_window_update_keyboard_resize ( window , TRUE ) ;
}
else if ( ( dx < 0 ) & & ( dy < 0 ) )
{
window - > display - > grab_op = META_GRAB_OP_KEYBOARD_RESIZING_NW ;
meta_window_update_keyboard_resize ( window , TRUE ) ;
}
else if ( dx < 0 )
{
window - > display - > grab_op = META_GRAB_OP_KEYBOARD_RESIZING_W ;
meta_window_update_keyboard_resize ( window , TRUE ) ;
}
else if ( dx > 0 )
{
window - > display - > grab_op = META_GRAB_OP_KEYBOARD_RESIZING_E ;
meta_window_update_keyboard_resize ( window , TRUE ) ;
}
else if ( dy > 0 )
{
window - > display - > grab_op = META_GRAB_OP_KEYBOARD_RESIZING_S ;
meta_window_update_keyboard_resize ( window , TRUE ) ;
}
else if ( dy < 0 )
{
window - > display - > grab_op = META_GRAB_OP_KEYBOARD_RESIZING_N ;
meta_window_update_keyboard_resize ( window , TRUE ) ;
}
}
2008-12-18 07:41:56 -05:00
2010-09-18 16:28:30 -04:00
new_unmaximize = check_resize_unmaximize ( window , dx , dy ) ;
2001-07-25 22:55:35 -04:00
switch ( window - > display - > grab_op )
{
case META_GRAB_OP_RESIZING_SE :
case META_GRAB_OP_RESIZING_NE :
case META_GRAB_OP_RESIZING_E :
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
case META_GRAB_OP_KEYBOARD_RESIZING_SE :
case META_GRAB_OP_KEYBOARD_RESIZING_NE :
case META_GRAB_OP_KEYBOARD_RESIZING_E :
2001-07-25 22:55:35 -04:00
new_w + = dx ;
break ;
case META_GRAB_OP_RESIZING_NW :
case META_GRAB_OP_RESIZING_SW :
case META_GRAB_OP_RESIZING_W :
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
case META_GRAB_OP_KEYBOARD_RESIZING_NW :
case META_GRAB_OP_KEYBOARD_RESIZING_SW :
case META_GRAB_OP_KEYBOARD_RESIZING_W :
2001-07-25 22:55:35 -04:00
new_w - = dx ;
break ;
2009-05-07 13:53:47 -04:00
default :
break ;
}
2008-12-18 07:41:56 -05:00
2001-07-25 22:55:35 -04:00
switch ( window - > display - > grab_op )
{
case META_GRAB_OP_RESIZING_SE :
case META_GRAB_OP_RESIZING_S :
case META_GRAB_OP_RESIZING_SW :
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
case META_GRAB_OP_KEYBOARD_RESIZING_SE :
case META_GRAB_OP_KEYBOARD_RESIZING_S :
case META_GRAB_OP_KEYBOARD_RESIZING_SW :
2001-07-25 22:55:35 -04:00
new_h + = dy ;
break ;
2008-12-18 07:41:56 -05:00
2001-07-25 22:55:35 -04:00
case META_GRAB_OP_RESIZING_N :
case META_GRAB_OP_RESIZING_NE :
case META_GRAB_OP_RESIZING_NW :
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
case META_GRAB_OP_KEYBOARD_RESIZING_N :
case META_GRAB_OP_KEYBOARD_RESIZING_NE :
case META_GRAB_OP_KEYBOARD_RESIZING_NW :
2001-07-25 22:55:35 -04:00
new_h - = dy ;
break ;
default :
break ;
}
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
if ( ! check_moveresize_frequency ( window , & remaining ) & & ! force )
{
/* we are ignoring an event here, so we schedule a
* compensation event when we would otherwise not ignore
* an event . Otherwise we can become stuck if the user never
* generates another event .
*/
if ( ! window - > display - > grab_resize_timeout_id )
{
2008-12-18 07:41:56 -05:00
window - > display - > grab_resize_timeout_id =
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
g_timeout_add ( ( int ) remaining , update_resize_timeout , window ) ;
}
return ;
}
2006-02-15 14:50:12 -05:00
/* If we get here, it means the client should have redrawn itself */
if ( window - > display - > compositor )
meta_compositor_set_updates ( window - > display - > compositor , window , TRUE ) ;
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
/* Remove any scheduled compensation events */
if ( window - > display - > grab_resize_timeout_id )
{
g_source_remove ( window - > display - > grab_resize_timeout_id ) ;
window - > display - > grab_resize_timeout_id = 0 ;
}
2008-12-18 07:41:56 -05:00
2009-05-07 13:53:47 -04:00
old = window - > rect ; /* Don't actually care about x,y */
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* One sided resizing ought to actually be one-sided, despite the fact that
* aspect ratio windows don ' t interact nicely with the above stuff . So ,
* to avoid some nasty flicker , we enforce that .
*/
switch ( window - > display - > grab_op )
{
case META_GRAB_OP_RESIZING_S :
case META_GRAB_OP_RESIZING_N :
new_w = old . width ;
break ;
2008-12-18 07:41:56 -05:00
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
case META_GRAB_OP_RESIZING_E :
case META_GRAB_OP_RESIZING_W :
new_h = old . height ;
break ;
default :
break ;
}
2003-10-12 02:25:38 -04:00
2001-07-25 22:55:35 -04:00
/* compute gravity of client during operation */
2002-03-17 12:22:23 -05:00
gravity = meta_resize_gravity_from_grab_op ( window - > display - > grab_op ) ;
g_assert ( gravity > = 0 ) ;
2008-12-18 07:41:56 -05:00
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* Do any edge resistance/snapping */
meta_window_edge_resistance_for_resize ( window ,
old . width ,
old . height ,
& new_w ,
& new_h ,
gravity ,
update_resize_timeout ,
snap ,
FALSE ) ;
2010-09-18 16:28:30 -04:00
if ( new_unmaximize = = window - > display - > grab_resize_unmaximize )
{
/* We don't need to update unless the specified width and height
* are actually different from what we had before .
*/
if ( old . width ! = new_w | | old . height ! = new_h )
{
2011-07-26 20:13:53 -04:00
meta_window_resize_with_gravity ( window , TRUE , new_w , new_h , gravity ) ;
2010-09-18 16:28:30 -04:00
}
}
else
{
if ( ( new_unmaximize & ~ window - > display - > grab_resize_unmaximize ) ! = 0 )
{
meta_window_unmaximize_with_gravity ( window ,
( new_unmaximize & ~ window - > display - > grab_resize_unmaximize ) ,
new_w , new_h , gravity ) ;
}
if ( ( window - > display - > grab_resize_unmaximize & ~ new_unmaximize ) )
{
MetaRectangle saved_rect = window - > saved_rect ;
meta_window_maximize ( window ,
( window - > display - > grab_resize_unmaximize & ~ new_unmaximize ) ) ;
window - > saved_rect = saved_rect ;
}
}
window - > display - > grab_resize_unmaximize = new_unmaximize ;
2002-12-09 22:23:04 -05:00
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
/* Store the latest resize time, if we actually resized. */
2006-01-02 13:48:30 -05:00
if ( window - > rect . width ! = old . width | | window - > rect . height ! = old . height )
g_get_current_time ( & window - > display - > grab_last_moveresize_time ) ;
2001-07-25 22:55:35 -04:00
}
2003-01-11 14:32:12 -05:00
typedef struct
{
2012-11-15 16:35:42 -05:00
Window window ;
int count ;
guint32 last_time ;
2003-01-21 23:54:04 -05:00
} EventScannerData ;
2003-01-11 14:32:12 -05:00
static Bool
2003-01-21 23:54:04 -05:00
find_last_time_predicate ( Display * display ,
2012-11-15 16:35:42 -05:00
XEvent * ev ,
2003-01-11 14:32:12 -05:00
XPointer arg )
{
2003-01-21 23:54:04 -05:00
EventScannerData * esd = ( void * ) arg ;
2012-11-15 16:35:42 -05:00
XIEvent * xev ;
2003-01-21 23:54:04 -05:00
2012-11-15 16:35:42 -05:00
if ( ev - > type ! = GenericEvent )
return False ;
/* We are peeking into events not yet handled by GDK,
* Allocate cookie events here so we can handle XI2 .
*
* GDK will handle later these events , and eventually
* free the cookie data itself .
*/
XGetEventData ( display , & ev - > xcookie ) ;
xev = ( XIEvent * ) ev - > xcookie . data ;
if ( xev - > evtype ! = XI_Motion )
return False ;
if ( esd - > window ! = ( ( XIDeviceEvent * ) xev ) - > event )
return False ;
esd - > count + = 1 ;
esd - > last_time = xev - > time ;
2003-01-21 23:54:04 -05:00
return False ;
2003-01-11 14:32:12 -05:00
}
2003-01-21 23:54:04 -05:00
static gboolean
check_use_this_motion_notify ( MetaWindow * window ,
2012-11-15 16:35:42 -05:00
XIDeviceEvent * xev )
2003-01-11 14:32:12 -05:00
{
2003-01-21 23:54:04 -05:00
EventScannerData esd ;
XEvent useless ;
/* This code is copied from Owen's GDK code. */
2008-12-18 07:41:56 -05:00
2003-01-21 23:54:04 -05:00
if ( window - > display - > grab_motion_notify_time ! = 0 )
{
/* == is really the right test, but I'm all for paranoia */
if ( window - > display - > grab_motion_notify_time < =
2012-11-15 16:35:42 -05:00
xev - > time )
2003-01-21 23:54:04 -05:00
{
meta_topic ( META_DEBUG_RESIZING ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
" Arrived at event with time %u (waiting for %u), using it \n " ,
2012-11-15 16:35:42 -05:00
( unsigned int ) xev - > time ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
window - > display - > grab_motion_notify_time ) ;
2003-01-21 23:54:04 -05:00
window - > display - > grab_motion_notify_time = 0 ;
return TRUE ;
}
else
return FALSE ; /* haven't reached the saved timestamp yet */
}
2008-12-18 07:41:56 -05:00
2012-11-15 16:35:42 -05:00
esd . window = xev - > event ;
2003-01-21 23:54:04 -05:00
esd . count = 0 ;
esd . last_time = 0 ;
2003-01-11 14:32:12 -05:00
2003-01-21 23:54:04 -05:00
/* "useless" isn't filled in because the predicate never returns True */
XCheckIfEvent ( window - > display - > xdisplay ,
& useless ,
find_last_time_predicate ,
( XPointer ) & esd ) ;
2003-01-11 14:32:12 -05:00
2003-01-21 23:54:04 -05:00
if ( esd . count > 0 )
meta_topic ( META_DEBUG_RESIZING ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
" Will skip %d motion events and use the event with time %u \n " ,
esd . count , ( unsigned int ) esd . last_time ) ;
2008-12-18 07:41:56 -05:00
2003-01-21 23:54:04 -05:00
if ( esd . last_time = = 0 )
return TRUE ;
else
2003-01-11 14:32:12 -05:00
{
2003-01-21 23:54:04 -05:00
/* Save this timestamp, and ignore all motion notify
* until we get to the one with this stamp .
*/
window - > display - > grab_motion_notify_time = esd . last_time ;
return FALSE ;
2003-01-11 14:32:12 -05:00
}
}
2010-09-24 15:35:00 -04:00
static void
update_tile_mode ( MetaWindow * window )
{
switch ( window - > tile_mode )
{
case META_TILE_LEFT :
case META_TILE_RIGHT :
if ( ! META_WINDOW_TILED_SIDE_BY_SIDE ( window ) )
window - > tile_mode = META_TILE_NONE ;
2010-12-04 15:20:11 -05:00
break ;
2010-09-24 15:35:00 -04:00
case META_TILE_MAXIMIZED :
if ( ! META_WINDOW_MAXIMIZED ( window ) )
window - > tile_mode = META_TILE_NONE ;
break ;
}
}
2012-11-15 17:18:06 -05:00
# ifdef HAVE_XSYNC
2001-07-25 22:55:35 -04:00
void
2012-11-15 17:18:06 -05:00
meta_window_update_sync_request_counter ( MetaWindow * window ,
guint64 new_counter_value )
2001-07-25 22:55:35 -04:00
{
2012-11-15 17:18:06 -05:00
if ( window - > display - > grab_op ! = META_GRAB_OP_NONE & &
window = = window - > display - > grab_window & &
meta_grab_op_is_mouse ( window - > display - > grab_op ) )
2001-07-25 22:55:35 -04:00
{
2012-11-15 17:18:06 -05:00
2002-12-09 22:23:04 -05:00
meta_topic ( META_DEBUG_RESIZING ,
" Alarm event received last motion x = %d y = %d \n " ,
window - > display - > grab_latest_motion_x ,
window - > display - > grab_latest_motion_y ) ;
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
/* If sync was previously disabled, turn it back on and hope
* the application has come to its senses ( maybe it was just
* busy with a pagefault or a long computation ) .
*/
window - > disable_sync = FALSE ;
window - > sync_request_time . tv_sec = 0 ;
window - > sync_request_time . tv_usec = 0 ;
2008-12-18 07:41:56 -05:00
2002-12-09 22:23:04 -05:00
/* This means we are ready for another configure. */
2001-07-25 22:55:35 -04:00
switch ( window - > display - > grab_op )
{
case META_GRAB_OP_RESIZING_E :
case META_GRAB_OP_RESIZING_W :
case META_GRAB_OP_RESIZING_S :
case META_GRAB_OP_RESIZING_N :
case META_GRAB_OP_RESIZING_SE :
case META_GRAB_OP_RESIZING_SW :
case META_GRAB_OP_RESIZING_NE :
case META_GRAB_OP_RESIZING_NW :
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
case META_GRAB_OP_KEYBOARD_RESIZING_S :
case META_GRAB_OP_KEYBOARD_RESIZING_N :
case META_GRAB_OP_KEYBOARD_RESIZING_W :
case META_GRAB_OP_KEYBOARD_RESIZING_E :
case META_GRAB_OP_KEYBOARD_RESIZING_SE :
case META_GRAB_OP_KEYBOARD_RESIZING_NE :
case META_GRAB_OP_KEYBOARD_RESIZING_SW :
case META_GRAB_OP_KEYBOARD_RESIZING_NW :
2002-12-09 22:23:04 -05:00
/* no pointer round trip here, to keep in sync */
update_resize ( window ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
window - > display - > grab_last_user_action_was_snap ,
2002-12-09 22:23:04 -05:00
window - > display - > grab_latest_motion_x ,
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-18 20:45:24 -04:00
window - > display - > grab_latest_motion_y ,
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
TRUE ) ;
2002-12-09 22:23:04 -05:00
break ;
2008-12-18 07:41:56 -05:00
2001-07-25 22:55:35 -04:00
default :
break ;
2002-05-11 01:09:54 -04:00
}
2002-12-09 22:23:04 -05:00
}
2012-11-15 17:18:06 -05:00
}
2002-12-09 22:23:04 -05:00
# endif /* HAVE_XSYNC */
2008-12-18 07:41:56 -05:00
2012-11-15 17:18:06 -05:00
void
meta_window_handle_mouse_grab_op_event ( MetaWindow * window ,
2012-11-15 16:35:42 -05:00
XIDeviceEvent * xev )
2012-11-15 17:18:06 -05:00
{
2012-11-15 16:35:42 -05:00
switch ( xev - > evtype )
2002-12-09 22:23:04 -05:00
{
2012-11-15 16:35:42 -05:00
case XI_ButtonRelease :
Add a raise on click option, basically only because all the major distros
2006-01-10 Elijah Newren <newren@gmail.com>
Add a raise on click option, basically only because all the major
distros are patching it in anyway. See #326156.
* src/metacity.schemas.in: add the new gconf key and explanation
* src/prefs.[ch] (#define KEY_RAISE_ON_CLICK, static gboolean
raise_on_click, update_raise_on_click, meta_prefs_init,
change_notify, meta_prefs_get_raise_on_click,
meta_preference_to_string):
Add all the normal preference handling stuff for this new
raise-on-click option.
* src/core.c (meta_core_show_window_menu):
* src/display.c (event_callback, meta_display_begin_grab_op):
* src/window.c (window_activate, meta_window_configure_request, ):
Only raise the window if in raise_on_click mode.
* src/display.c (meta_display_begin_grab_op,
meta_display_end_grab_op, meta_display_check_threshold_reached):
* src/display.h (struct MetaDisplay):
* src/window.c (meta_window_handle_mouse_grab_op_event):
if not in raise-on-click mode only raise on button release if the
click didn't start a move or resize operation; needs a few extra
MetaDisplay fields to handle this
* src/core.c (meta_core_user_lower_and_unfocus):
no need to do the MRU shuffling if not maintaining the stacking
order == MRU order invariant
* src/frames.c (meta_frames_button_press_event):
* src/window.c (meta_window_begin_grab_op):
remove an unneeded window raising that is already handled elsewhere
2006-01-10 14:35:03 -05:00
meta_display_check_threshold_reached ( window - > display ,
2012-11-15 16:35:42 -05:00
xev - > root_x ,
xev - > root_y ) ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* If the user was snap moving then ignore the button release
* because they may have let go of shift before releasing the
* mouse button and they almost certainly do not want a
* non - snapped movement to occur from the button release .
*/
if ( ! window - > display - > grab_last_user_action_was_snap )
2002-12-09 22:23:04 -05:00
{
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
if ( meta_grab_op_is_moving ( window - > display - > grab_op ) )
{
2010-06-24 14:41:28 -04:00
if ( window - > tile_mode ! = META_TILE_NONE )
meta_window_tile ( window ) ;
2012-11-15 16:35:42 -05:00
else if ( xev - > root = = window - > screen - > xroot )
update_move ( window ,
xev - > mods . effective & ShiftMask ,
xev - > root_x ,
xev - > root_y ) ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
}
else if ( meta_grab_op_is_resizing ( window - > display - > grab_op ) )
{
2012-11-15 16:35:42 -05:00
if ( xev - > root = = window - > screen - > xroot )
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
update_resize ( window ,
2012-11-15 16:35:42 -05:00
xev - > mods . effective & ShiftMask ,
xev - > root_x ,
xev - > root_y ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
TRUE ) ;
2006-03-15 16:31:12 -05:00
if ( window - > display - > compositor )
meta_compositor_set_updates ( window - > display - > compositor , window , TRUE ) ;
2010-09-19 10:54:08 -04:00
/* If a tiled window has been dragged free with a
* mouse resize without snapping back to the tiled
* state , it will end up with an inconsistent tile
* mode on mouse release ; cleaning the mode earlier
* would break the ability to snap back to the tiled
* state , so we wait until mouse release .
*/
2010-09-24 15:35:00 -04:00
update_tile_mode ( window ) ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
}
2002-12-09 22:23:04 -05:00
}
2002-05-11 01:09:54 -04:00
2012-11-15 16:35:42 -05:00
meta_display_end_grab_op ( window - > display , xev - > time ) ;
2008-12-18 07:41:56 -05:00
break ;
2002-12-09 22:23:04 -05:00
2012-11-15 16:35:42 -05:00
case XI_Motion :
Add a raise on click option, basically only because all the major distros
2006-01-10 Elijah Newren <newren@gmail.com>
Add a raise on click option, basically only because all the major
distros are patching it in anyway. See #326156.
* src/metacity.schemas.in: add the new gconf key and explanation
* src/prefs.[ch] (#define KEY_RAISE_ON_CLICK, static gboolean
raise_on_click, update_raise_on_click, meta_prefs_init,
change_notify, meta_prefs_get_raise_on_click,
meta_preference_to_string):
Add all the normal preference handling stuff for this new
raise-on-click option.
* src/core.c (meta_core_show_window_menu):
* src/display.c (event_callback, meta_display_begin_grab_op):
* src/window.c (window_activate, meta_window_configure_request, ):
Only raise the window if in raise_on_click mode.
* src/display.c (meta_display_begin_grab_op,
meta_display_end_grab_op, meta_display_check_threshold_reached):
* src/display.h (struct MetaDisplay):
* src/window.c (meta_window_handle_mouse_grab_op_event):
if not in raise-on-click mode only raise on button release if the
click didn't start a move or resize operation; needs a few extra
MetaDisplay fields to handle this
* src/core.c (meta_core_user_lower_and_unfocus):
no need to do the MRU shuffling if not maintaining the stacking
order == MRU order invariant
* src/frames.c (meta_frames_button_press_event):
* src/window.c (meta_window_begin_grab_op):
remove an unneeded window raising that is already handled elsewhere
2006-01-10 14:35:03 -05:00
meta_display_check_threshold_reached ( window - > display ,
2012-11-15 16:35:42 -05:00
xev - > root_x ,
xev - > root_y ) ;
2002-12-09 22:23:04 -05:00
if ( meta_grab_op_is_moving ( window - > display - > grab_op ) )
{
2012-11-15 16:35:42 -05:00
if ( xev - > root = = window - > screen - > xroot )
2003-01-11 14:32:12 -05:00
{
2003-01-21 23:54:04 -05:00
if ( check_use_this_motion_notify ( window ,
2012-11-15 16:35:42 -05:00
xev ) )
2003-01-21 23:54:04 -05:00
update_move ( window ,
2012-11-15 16:35:42 -05:00
xev - > mods . effective & ShiftMask ,
xev - > root_x ,
xev - > root_y ) ;
2003-01-11 14:32:12 -05:00
}
2002-12-09 22:23:04 -05:00
}
else if ( meta_grab_op_is_resizing ( window - > display - > grab_op ) )
{
2012-11-15 16:35:42 -05:00
if ( xev - > root = = window - > screen - > xroot )
2003-01-11 14:32:12 -05:00
{
2003-01-21 23:54:04 -05:00
if ( check_use_this_motion_notify ( window ,
2012-11-15 16:35:42 -05:00
xev ) )
2003-01-21 23:54:04 -05:00
update_resize ( window ,
2012-11-15 16:35:42 -05:00
xev - > mods . effective & ShiftMask ,
xev - > root_x ,
xev - > root_y ,
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
FALSE ) ;
2003-01-11 14:32:12 -05:00
}
2002-12-09 22:23:04 -05:00
}
2001-07-25 22:55:35 -04:00
break ;
2002-12-09 22:23:04 -05:00
2001-07-25 22:55:35 -04:00
default :
break ;
}
}
2001-06-30 19:17:52 -04:00
void
meta_window_set_gravity ( MetaWindow * window ,
int gravity )
{
XSetWindowAttributes attrs ;
meta_verbose ( " Setting gravity of %s to %d \n " , window - > desc , gravity ) ;
attrs . win_gravity = gravity ;
2008-12-18 07:41:56 -05:00
2001-06-30 19:17:52 -04:00
meta_error_trap_push ( window - > display ) ;
XChangeWindowAttributes ( window - > display - > xdisplay ,
window - > xwindow ,
CWWinGravity ,
& attrs ) ;
2008-12-18 07:41:56 -05:00
2010-10-25 14:44:30 -04:00
meta_error_trap_pop ( window - > display ) ;
2001-06-30 19:17:52 -04:00
}
2002-01-10 01:31:31 -05:00
2003-02-23 12:09:46 -05:00
static void
2009-08-31 09:52:16 -04:00
get_work_area_monitor ( MetaWindow * window ,
MetaRectangle * area ,
int which_monitor )
2002-01-10 01:31:31 -05:00
{
2008-12-18 07:41:56 -05:00
GList * tmp ;
2009-08-31 09:52:16 -04:00
g_assert ( which_monitor > = 0 ) ;
2002-01-10 01:31:31 -05:00
2009-08-31 09:52:16 -04:00
/* Initialize to the whole monitor */
* area = window - > screen - > monitor_infos [ which_monitor ] . rect ;
2008-12-18 07:41:56 -05:00
tmp = meta_window_get_workspaces ( window ) ;
2002-01-10 01:31:31 -05:00
while ( tmp ! = NULL )
{
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
MetaRectangle workspace_work_area ;
2009-08-31 09:52:16 -04:00
meta_workspace_get_work_area_for_monitor ( tmp - > data ,
which_monitor ,
& workspace_work_area ) ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
meta_rectangle_intersect ( area ,
& workspace_work_area ,
area ) ;
2002-01-10 01:31:31 -05:00
tmp = tmp - > next ;
}
2008-12-18 07:41:56 -05:00
2002-02-07 22:34:26 -05:00
meta_topic ( META_DEBUG_WORKAREA ,
2009-08-31 09:52:16 -04:00
" Window %s monitor %d has work area %d,%d %d x %d \n " ,
window - > desc , which_monitor ,
2003-03-08 18:43:17 -05:00
area - > x , area - > y , area - > width , area - > height ) ;
2002-01-10 01:31:31 -05:00
}
2002-01-27 00:50:34 -05:00
2003-02-23 12:09:46 -05:00
void
2009-08-31 09:52:16 -04:00
meta_window_get_work_area_current_monitor ( MetaWindow * window ,
MetaRectangle * area )
2003-02-23 12:09:46 -05:00
{
2009-08-31 09:52:16 -04:00
const MetaMonitorInfo * monitor = NULL ;
monitor = meta_screen_get_monitor_for_window ( window - > screen ,
window ) ;
2003-02-23 12:09:46 -05:00
2009-08-31 09:52:16 -04:00
meta_window_get_work_area_for_monitor ( window ,
monitor - > number ,
area ) ;
2003-02-23 12:09:46 -05:00
}
void
2009-08-31 09:52:16 -04:00
meta_window_get_work_area_for_monitor ( MetaWindow * window ,
int which_monitor ,
MetaRectangle * area )
2003-02-23 12:09:46 -05:00
{
2009-08-31 09:52:16 -04:00
g_return_if_fail ( which_monitor > = 0 ) ;
2008-12-18 07:41:56 -05:00
2009-08-31 09:52:16 -04:00
get_work_area_monitor ( window ,
area ,
which_monitor ) ;
2003-03-08 18:43:17 -05:00
}
void
2009-08-31 09:52:16 -04:00
meta_window_get_work_area_all_monitors ( MetaWindow * window ,
MetaRectangle * area )
2003-03-08 18:43:17 -05:00
{
2008-12-18 07:41:56 -05:00
GList * tmp ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* Initialize to the whole screen */
* area = window - > screen - > rect ;
2008-12-18 07:41:56 -05:00
tmp = meta_window_get_workspaces ( window ) ;
2003-03-08 18:43:17 -05:00
while ( tmp ! = NULL )
{
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
MetaRectangle workspace_work_area ;
2009-08-31 09:52:16 -04:00
meta_workspace_get_work_area_all_monitors ( tmp - > data ,
& workspace_work_area ) ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
meta_rectangle_intersect ( area ,
& workspace_work_area ,
area ) ;
2003-03-08 18:43:17 -05:00
tmp = tmp - > next ;
}
meta_topic ( META_DEBUG_WORKAREA ,
" Window %s has whole-screen work area %d,%d %d x %d \n " ,
window - > desc , area - > x , area - > y , area - > width , area - > height ) ;
2003-02-23 12:09:46 -05:00
}
2010-06-24 14:41:28 -04:00
void
meta_window_get_current_tile_area ( MetaWindow * window ,
MetaRectangle * tile_area )
{
2011-10-08 11:00:16 -04:00
int tile_monitor_number ;
2010-06-24 14:41:28 -04:00
g_return_if_fail ( window - > tile_mode ! = META_TILE_NONE ) ;
2011-10-08 11:00:16 -04:00
tile_monitor_number = window - > tile_monitor_number ;
if ( tile_monitor_number < 0 )
{
meta_warning ( " %s called with an invalid monitor number; using 0 instead \n " , G_STRFUNC ) ;
tile_monitor_number = 0 ;
}
meta_window_get_work_area_for_monitor ( window , tile_monitor_number , tile_area ) ;
2010-06-24 14:41:28 -04:00
if ( window - > tile_mode = = META_TILE_LEFT | |
window - > tile_mode = = META_TILE_RIGHT )
tile_area - > width / = 2 ;
if ( window - > tile_mode = = META_TILE_RIGHT )
tile_area - > x + = tile_area - > width ;
}
2003-03-08 18:43:17 -05:00
2002-01-27 00:50:34 -05:00
gboolean
meta_window_same_application ( MetaWindow * window ,
MetaWindow * other_window )
{
2008-07-12 23:26:39 -04:00
MetaGroup * group = meta_window_get_group ( window ) ;
MetaGroup * other_group = meta_window_get_group ( other_window ) ;
2002-11-30 22:58:04 -05:00
return
2008-07-12 23:26:39 -04:00
group ! = NULL & &
other_group ! = NULL & &
group = = other_group ;
2002-01-27 00:50:34 -05:00
}
2002-03-17 12:22:23 -05:00
2009-10-19 19:41:54 -04:00
/* Generally meta_window_same_application() is a better idea
* of " sameness " , since it handles the case where multiple apps
* want to look like the same app or the same app wants to look
* like multiple apps , but in the case of workarounds for legacy
* applications ( which likely aren ' t setting the group properly
* anyways ) , it may be desirable to check this as well .
*/
static gboolean
meta_window_same_client ( MetaWindow * window ,
MetaWindow * other_window )
{
int resource_mask = window - > display - > xdisplay - > resource_mask ;
return ( ( window - > xwindow & ~ resource_mask ) = =
( other_window - > xwindow & ~ resource_mask ) ) ;
}
2002-03-17 12:22:23 -05:00
void
meta_window_refresh_resize_popup ( MetaWindow * window )
{
if ( window - > display - > grab_op = = META_GRAB_OP_NONE )
return ;
if ( window - > display - > grab_window ! = window )
return ;
2010-08-25 16:23:50 -04:00
switch ( window - > display - > grab_op )
{
case META_GRAB_OP_RESIZING_SE :
case META_GRAB_OP_RESIZING_S :
case META_GRAB_OP_RESIZING_SW :
case META_GRAB_OP_RESIZING_N :
case META_GRAB_OP_RESIZING_NE :
case META_GRAB_OP_RESIZING_NW :
case META_GRAB_OP_RESIZING_W :
case META_GRAB_OP_RESIZING_E :
case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN :
case META_GRAB_OP_KEYBOARD_RESIZING_S :
case META_GRAB_OP_KEYBOARD_RESIZING_N :
case META_GRAB_OP_KEYBOARD_RESIZING_W :
case META_GRAB_OP_KEYBOARD_RESIZING_E :
case META_GRAB_OP_KEYBOARD_RESIZING_SE :
case META_GRAB_OP_KEYBOARD_RESIZING_NE :
case META_GRAB_OP_KEYBOARD_RESIZING_SW :
case META_GRAB_OP_KEYBOARD_RESIZING_NW :
break ;
default :
/* Not resizing */
return ;
}
2002-03-17 12:22:23 -05:00
if ( window - > display - > grab_resize_popup = = NULL )
{
2002-10-18 18:37:01 -04:00
if ( window - > size_hints . width_inc > 1 | |
window - > size_hints . height_inc > 1 )
window - > display - > grab_resize_popup =
meta_ui_resize_popup_new ( window - > display - > xdisplay ,
window - > screen - > number ) ;
2002-03-17 12:22:23 -05:00
}
2008-12-18 07:41:56 -05:00
2002-03-17 12:22:23 -05:00
if ( window - > display - > grab_resize_popup ! = NULL )
{
2006-03-29 11:05:23 -05:00
MetaRectangle rect ;
2008-12-18 07:41:56 -05:00
2009-05-07 13:53:47 -04:00
meta_window_get_client_root_coords ( window , & rect ) ;
2008-12-18 07:41:56 -05:00
2002-03-17 12:22:23 -05:00
meta_ui_resize_popup_set ( window - > display - > grab_resize_popup ,
2006-03-29 11:05:23 -05:00
rect ,
2002-03-17 12:22:23 -05:00
window - > size_hints . base_width ,
window - > size_hints . base_height ,
window - > size_hints . width_inc ,
Remove the unused attributes resize_gravity, width_inc, height_inc,
2006-05-18 Björn Lindqvist <bjourne@gmail.com>
* resizepopup.c: Remove the unused attributes resize_gravity,
width_inc, height_inc, min_width, min_height, frame_left,
frame_right, frame_top, frame_bottom, tick_origin_x, tick_origin_y
from the MetaResizePopup struct. Delete all code that references
those attributes.
2006-05-18 04:32:16 -04:00
window - > size_hints . height_inc ) ;
2002-03-17 12:22:23 -05:00
meta_ui_resize_popup_set_showing ( window - > display - > grab_resize_popup ,
TRUE ) ;
}
}
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
2010-04-24 17:19:25 -04:00
/**
* meta_window_foreach_transient :
* @ window : a # MetaWindow
2010-09-24 11:26:36 -04:00
* @ func : ( scope call ) ( closure user_data ) : Called for each window which is a transient of @ window ( transitively )
* @ user_data : User data
2010-04-24 17:19:25 -04:00
*
* Call @ func for every window which is either transient for @ window , or is
* a transient of a window which is in turn transient for @ window .
* The order of window enumeration is not defined .
*
* Iteration will stop if @ func at any point returns % FALSE .
*/
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
void
meta_window_foreach_transient ( MetaWindow * window ,
MetaWindowForeachFunc func ,
2010-04-24 17:19:25 -04:00
void * user_data )
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
{
GSList * windows ;
GSList * tmp ;
2009-06-15 15:32:23 -04:00
windows = meta_display_list_windows ( window - > display , META_LIST_DEFAULT ) ;
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
tmp = windows ;
while ( tmp ! = NULL )
{
MetaWindow * transient = tmp - > data ;
2008-12-18 07:41:56 -05:00
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
if ( meta_window_is_ancestor_of_transient ( window , transient ) )
2003-03-17 01:36:39 -05:00
{
2010-04-24 17:19:25 -04:00
if ( ! ( * func ) ( transient , user_data ) )
2003-03-17 01:36:39 -05:00
break ;
}
2008-12-18 07:41:56 -05:00
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
tmp = tmp - > next ;
}
g_slist_free ( windows ) ;
}
2010-04-24 17:19:25 -04:00
/**
* meta_window_foreach_ancestor :
* @ window : a # MetaWindow
2010-09-24 11:26:36 -04:00
* @ func : ( scope call ) ( closure user_data ) : Called for each window which is a transient parent of @ window
* @ user_data : User data
2010-04-24 17:19:25 -04:00
*
* If @ window is transient , call @ func with the window for which it ' s transient ,
* repeatedly until either we find a non - transient window , or @ func returns % FALSE .
*/
2003-03-17 01:36:39 -05:00
void
meta_window_foreach_ancestor ( MetaWindow * window ,
MetaWindowForeachFunc func ,
2010-04-24 17:19:25 -04:00
void * user_data )
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
{
MetaWindow * w ;
2008-12-18 07:41:56 -05:00
2003-03-17 01:36:39 -05:00
w = window ;
2011-05-06 05:09:04 -04:00
do
2003-03-17 01:36:39 -05:00
{
2002-09-27 15:42:59 -04:00
if ( w - > xtransient_for = = None | |
w - > transient_parent_is_root_window )
2003-03-17 01:36:39 -05:00
break ;
2008-12-18 07:41:56 -05:00
2003-03-17 01:36:39 -05:00
w = meta_display_lookup_x_window ( w - > display , w - > xtransient_for ) ;
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
}
2011-05-06 05:09:04 -04:00
while ( w & & ( * func ) ( w , user_data ) ) ;
2003-03-17 01:36:39 -05:00
}
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
2003-03-17 01:36:39 -05:00
typedef struct
{
MetaWindow * ancestor ;
gboolean found ;
} FindAncestorData ;
static gboolean
find_ancestor_func ( MetaWindow * window ,
void * data )
{
FindAncestorData * d = data ;
if ( window = = d - > ancestor )
{
d - > found = TRUE ;
return FALSE ;
}
return TRUE ;
}
2009-08-04 03:32:36 -04:00
/**
* meta_window_is_ancestor_of_transient :
* @ window : a # MetaWindow
* @ transient : a # MetaWindow
*
* The function determines whether @ window is an ancestor of @ transient ; it does
* so by traversing the @ transient ' s ancestors until it either locates @ window
* or reaches an ancestor that is not transient .
*
* Return Value : ( transfer none ) : % TRUE if window is an ancestor of transient .
*/
2003-03-17 01:36:39 -05:00
gboolean
meta_window_is_ancestor_of_transient ( MetaWindow * window ,
MetaWindow * transient )
{
FindAncestorData d ;
d . ancestor = window ;
d . found = FALSE ;
meta_window_foreach_ancestor ( transient , find_ancestor_func , & d ) ;
return d . found ;
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
}
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
2003-10-12 02:25:38 -04:00
/* Warp pointer to location appropriate for grab,
* return root coordinates where pointer ended up .
*/
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
static gboolean
2003-10-12 02:25:38 -04:00
warp_grab_pointer ( MetaWindow * window ,
MetaGrabOp grab_op ,
int * x ,
int * y )
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
{
2007-04-08 23:43:55 -04:00
MetaRectangle rect ;
MetaDisplay * display ;
display = window - > display ;
2003-10-12 02:25:38 -04:00
/* We may not have done begin_grab_op yet, i.e. may not be in a grab
*/
2008-12-18 07:41:56 -05:00
2009-05-07 13:53:47 -04:00
meta_window_get_outer_rect ( window , & rect ) ;
2008-12-18 07:41:56 -05:00
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
switch ( grab_op )
{
case META_GRAB_OP_KEYBOARD_MOVING :
case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN :
2003-10-12 02:25:38 -04:00
* x = rect . width / 2 ;
* y = rect . height / 2 ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
break ;
case META_GRAB_OP_KEYBOARD_RESIZING_S :
2003-10-12 02:25:38 -04:00
* x = rect . width / 2 ;
2008-02-17 19:21:50 -05:00
* y = rect . height - 1 ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
break ;
case META_GRAB_OP_KEYBOARD_RESIZING_N :
2003-10-12 02:25:38 -04:00
* x = rect . width / 2 ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
* y = 0 ;
break ;
case META_GRAB_OP_KEYBOARD_RESIZING_W :
* x = 0 ;
2003-10-12 02:25:38 -04:00
* y = rect . height / 2 ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
break ;
case META_GRAB_OP_KEYBOARD_RESIZING_E :
2008-02-17 19:21:50 -05:00
* x = rect . width - 1 ;
2003-10-12 02:25:38 -04:00
* y = rect . height / 2 ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
break ;
case META_GRAB_OP_KEYBOARD_RESIZING_SE :
2008-02-17 19:21:50 -05:00
* x = rect . width - 1 ;
* y = rect . height - 1 ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
break ;
case META_GRAB_OP_KEYBOARD_RESIZING_NE :
2008-02-17 19:21:50 -05:00
* x = rect . width - 1 ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
* y = 0 ;
break ;
case META_GRAB_OP_KEYBOARD_RESIZING_SW :
* x = 0 ;
2008-02-17 19:21:50 -05:00
* y = rect . height - 1 ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
break ;
case META_GRAB_OP_KEYBOARD_RESIZING_NW :
* x = 0 ;
* y = 0 ;
break ;
default :
return FALSE ;
}
2003-10-12 02:25:38 -04:00
* x + = rect . x ;
* y + = rect . y ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* Avoid weird bouncing at the screen edge; see bug 154706 */
* x = CLAMP ( * x , 0 , window - > screen - > rect . width - 1 ) ;
* y = CLAMP ( * y , 0 , window - > screen - > rect . height - 1 ) ;
2008-12-18 07:41:56 -05:00
2007-04-08 23:43:55 -04:00
meta_error_trap_push_with_return ( display ) ;
2003-10-12 02:25:38 -04:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
" Warping pointer to %d,%d with window at %d,%d \n " ,
* x , * y , rect . x , rect . y ) ;
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
/* Need to update the grab positions so that the MotionNotify and other
* events generated by the XWarpPointer ( ) call below don ' t cause complete
* funkiness . See bug 124582 and bug 122670.
*/
2007-04-08 23:43:55 -04:00
display - > grab_anchor_root_x = * x ;
display - > grab_anchor_root_y = * y ;
display - > grab_latest_motion_x = * x ;
display - > grab_latest_motion_y = * y ;
2009-05-07 13:53:47 -04:00
meta_window_get_client_root_coords ( window ,
& display - > grab_anchor_window_pos ) ;
2008-12-18 07:41:56 -05:00
2007-04-08 23:43:55 -04:00
XWarpPointer ( display - > xdisplay ,
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
None ,
2003-10-12 02:25:38 -04:00
window - > screen - > xroot ,
2008-12-18 07:41:56 -05:00
0 , 0 , 0 , 0 ,
2003-10-12 02:25:38 -04:00
* x , * y ) ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
2010-10-25 14:44:30 -04:00
if ( meta_error_trap_pop_with_return ( display ) ! = Success )
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
{
2003-10-12 02:25:38 -04:00
meta_verbose ( " Failed to warp pointer for window %s \n " ,
window - > desc ) ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
return FALSE ;
}
2008-12-18 07:41:56 -05:00
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
return TRUE ;
}
void
meta_window_begin_grab_op ( MetaWindow * window ,
MetaGrabOp op ,
2006-10-12 20:28:34 -04:00
gboolean frame_action ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
guint32 timestamp )
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
{
2003-10-12 02:25:38 -04:00
int x , y ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
2003-10-12 02:25:38 -04:00
warp_grab_pointer ( window ,
op , & x , & y ) ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
meta_display_begin_grab_op ( window - > display ,
window - > screen ,
window ,
op ,
2003-11-24 13:09:47 -05:00
FALSE ,
2006-10-12 20:28:34 -04:00
frame_action ,
2003-11-24 13:09:47 -05:00
0 /* button */ ,
0 ,
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
timestamp ,
2003-10-12 02:25:38 -04:00
x , y ) ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
}
2002-09-24 17:22:06 -04:00
void
2003-10-12 02:25:38 -04:00
meta_window_update_keyboard_resize ( MetaWindow * window ,
gboolean update_cursor )
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
{
2003-10-12 02:25:38 -04:00
int x , y ;
2008-12-18 07:41:56 -05:00
2003-10-12 02:25:38 -04:00
warp_grab_pointer ( window ,
window - > display - > grab_op ,
& x , & y ) ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
if ( update_cursor )
{
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
guint32 timestamp ;
/* FIXME: Using CurrentTime is really bad mojo */
timestamp = CurrentTime ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
meta_display_set_grab_op_cursor ( window - > display ,
2002-08-14 12:51:13 -04:00
NULL ,
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
window - > display - > grab_op ,
TRUE ,
window - > display - > grab_xwindow ,
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 13:27:24 -04:00
timestamp ) ;
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 00:27:23 -04:00
}
}
2003-10-12 02:25:38 -04:00
void
meta_window_update_keyboard_move ( MetaWindow * window )
{
int x , y ;
2008-12-18 07:41:56 -05:00
2003-10-12 02:25:38 -04:00
warp_grab_pointer ( window ,
window - > display - > grab_op ,
& x , & y ) ;
}
2002-09-24 17:22:06 -04:00
void
meta_window_update_layer ( MetaWindow * window )
{
MetaGroup * group ;
2008-12-18 07:41:56 -05:00
2002-09-24 17:22:06 -04:00
meta_stack_freeze ( window - > screen - > stack ) ;
group = meta_window_get_group ( window ) ;
2008-11-03 09:50:22 -05:00
if ( group )
2002-09-24 17:22:06 -04:00
meta_group_update_layers ( group ) ;
else
meta_stack_update_layer ( window - > screen - > stack , window ) ;
meta_stack_thaw ( window - > screen - > stack ) ;
}
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
2004-08-05 13:48:39 -04:00
/* ensure_mru_position_after ensures that window appears after
* below_this_one in the active_workspace ' s mru_list ( i . e . it treats
* window as having been less recently used than below_this_one )
*/
static void
ensure_mru_position_after ( MetaWindow * window ,
MetaWindow * after_this_one )
{
/* This is sort of slow since it runs through the entire list more
* than once ( especially considering the fact that we expect the
* windows of interest to be the first two elements in the list ) ,
* but it doesn ' t matter while we ' re only using it on new window
* map .
*/
GList * active_mru_list ;
GList * window_position ;
GList * after_this_one_position ;
active_mru_list = window - > screen - > active_workspace - > mru_list ;
window_position = g_list_find ( active_mru_list , window ) ;
after_this_one_position = g_list_find ( active_mru_list , after_this_one ) ;
/* after_this_one_position is NULL when we switch workspaces, but in
* that case we don ' t need to do any MRU shuffling so we can simply
* return .
*/
if ( after_this_one_position = = NULL )
return ;
if ( g_list_length ( window_position ) > g_list_length ( after_this_one_position ) )
{
window - > screen - > active_workspace - > mru_list =
g_list_delete_link ( window - > screen - > active_workspace - > mru_list ,
window_position ) ;
window - > screen - > active_workspace - > mru_list =
g_list_insert_before ( window - > screen - > active_workspace - > mru_list ,
after_this_one_position - > next ,
window ) ;
}
}
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
void
meta_window_stack_just_below ( MetaWindow * window ,
MetaWindow * below_this_one )
{
g_return_if_fail ( window ! = NULL ) ;
g_return_if_fail ( below_this_one ! = NULL ) ;
if ( window - > stack_position > below_this_one - > stack_position )
{
meta_topic ( META_DEBUG_STACK ,
" Setting stack position of window %s to %d (making it below window %s). \n " ,
2008-12-18 07:41:56 -05:00
window - > desc ,
below_this_one - > stack_position ,
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
below_this_one - > desc ) ;
2004-08-27 13:22:54 -04:00
meta_window_set_stack_position ( window , below_this_one - > stack_position ) ;
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 11:47:05 -04:00
}
else
{
meta_topic ( META_DEBUG_STACK ,
" Window %s was already below window %s. \n " ,
window - > desc , below_this_one - > desc ) ;
}
}
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
2009-08-30 20:04:48 -04:00
/**
* meta_window_get_user_time :
*
* The user time represents a timestamp for the last time the user
* interacted with this window . Note this property is only available
* for non - override - redirect windows .
*
* The property is set by Mutter initially upon window creation ,
* and updated thereafter on input events ( key and button presses ) seen by Mutter ,
* client updates to the _NET_WM_USER_TIME property ( if later than the current time )
* and when focusing the window .
*
* Returns : The last time the user interacted with this window .
*/
guint32
meta_window_get_user_time ( MetaWindow * window )
{
return window - > net_wm_user_time ;
}
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
void
meta_window_set_user_time ( MetaWindow * window ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
guint32 timestamp )
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
{
/* FIXME: If Soeren's suggestion in bug 151984 is implemented, it will allow
* us to sanity check the timestamp here and ensure it doesn ' t correspond to
* a future time .
*/
2009-06-14 08:37:57 -04:00
g_return_if_fail ( ! window - > override_redirect ) ;
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
/* Only update the time if this timestamp is newer... */
if ( window - > net_wm_user_time_set & &
XSERVER_TIME_IS_BEFORE ( timestamp , window - > net_wm_user_time ) )
{
meta_topic ( META_DEBUG_STARTUP ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
" Window %s _NET_WM_USER_TIME not updated to %u, because it "
" is less than %u \n " ,
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
window - > desc , timestamp , window - > net_wm_user_time ) ;
}
else
{
meta_topic ( META_DEBUG_STARTUP ,
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 12:32:33 -04:00
" Window %s has _NET_WM_USER_TIME of %u \n " ,
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
window - > desc , timestamp ) ;
window - > net_wm_user_time_set = TRUE ;
window - > net_wm_user_time = timestamp ;
if ( XSERVER_TIME_IS_BEFORE ( window - > display - > last_user_time , timestamp ) )
window - > display - > last_user_time = timestamp ;
2006-01-15 12:03:57 -05:00
/* If this is a terminal, user interaction with it means the user likely
* doesn ' t want to have focus transferred for now due to new windows .
*/
2006-04-12 14:01:20 -04:00
if ( meta_prefs_get_focus_new_windows ( ) = =
2011-06-24 12:14:15 -04:00
G_DESKTOP_FOCUS_NEW_WINDOWS_STRICT & &
2006-04-12 14:01:20 -04:00
__window_is_terminal ( window ) )
2006-01-15 12:03:57 -05:00
window - > display - > allow_terminal_deactivation = FALSE ;
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
}
2009-08-31 12:06:53 -04:00
g_object_notify ( G_OBJECT ( window ) , " user-time " ) ;
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 12:14:16 -05:00
}
2006-03-29 13:43:22 -05:00
2009-09-18 20:50:11 -04:00
/**
* meta_window_get_stable_sequence :
* @ window : A # MetaWindow
*
* The stable sequence number is a monotonicially increasing
* unique integer assigned to each # MetaWindow upon creation .
*
* This number can be useful for sorting windows in a stable
* fashion .
*
* Returns : Internal sequence number for this window
*/
guint32
meta_window_get_stable_sequence ( MetaWindow * window )
{
g_return_val_if_fail ( META_IS_WINDOW ( window ) , 0 ) ;
return window - > stable_sequence ;
}
2006-03-29 13:43:22 -05:00
/* Sets the demands_attention hint on a window, but only
* if it ' s at least partially obscured ( see # 305882 ) .
*/
void
meta_window_set_demands_attention ( MetaWindow * window )
{
MetaRectangle candidate_rect , other_rect ;
GList * stack = window - > screen - > stack - > sorted ;
MetaWindow * other_window ;
gboolean obscured = FALSE ;
2008-12-18 07:41:56 -05:00
2008-02-01 23:05:16 -05:00
MetaWorkspace * workspace = window - > screen - > active_workspace ;
2009-11-17 05:02:06 -05:00
if ( window - > wm_state_demands_attention )
return ;
2008-02-01 23:05:16 -05:00
if ( workspace ! = window - > workspace )
2006-03-29 13:43:22 -05:00
{
2008-02-01 23:05:16 -05:00
/* windows on other workspaces are necessarily obscured */
obscured = TRUE ;
}
2008-10-21 23:21:23 -04:00
else if ( window - > minimized )
{
obscured = TRUE ;
}
2008-02-01 23:05:16 -05:00
else
{
meta_window_get_outer_rect ( window , & candidate_rect ) ;
2006-03-29 13:43:22 -05:00
2008-02-01 23:05:16 -05:00
/* The stack is sorted with the top windows first. */
2008-12-18 07:41:56 -05:00
2008-02-01 23:05:16 -05:00
while ( stack ! = NULL & & stack - > data ! = window )
{
other_window = stack - > data ;
stack = stack - > next ;
2008-12-18 07:41:56 -05:00
2008-02-01 23:05:16 -05:00
if ( other_window - > on_all_workspaces | |
window - > on_all_workspaces | |
other_window - > workspace = = window - > workspace )
2006-03-29 13:43:22 -05:00
{
2008-02-01 23:05:16 -05:00
meta_window_get_outer_rect ( other_window , & other_rect ) ;
if ( meta_rectangle_overlap ( & candidate_rect , & other_rect ) )
{
obscured = TRUE ;
break ;
}
2006-03-29 13:43:22 -05:00
}
}
2008-10-21 23:21:23 -04:00
}
if ( obscured )
{
2006-03-29 13:43:22 -05:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
2008-10-21 23:21:23 -04:00
" Marking %s as needing attention \n " ,
window - > desc ) ;
window - > wm_state_demands_attention = TRUE ;
set_net_wm_state ( window ) ;
2009-11-17 05:02:06 -05:00
g_object_notify ( G_OBJECT ( window ) , " demands-attention " ) ;
2009-10-28 13:19:24 -04:00
g_signal_emit_by_name ( window - > display , " window-demands-attention " ,
window ) ;
2006-03-29 13:43:22 -05:00
}
2008-10-21 23:21:23 -04:00
else
{
/* If the window's in full view, there's no point setting the flag. */
2006-03-29 13:43:22 -05:00
2008-10-21 23:21:23 -04:00
meta_topic ( META_DEBUG_WINDOW_OPS ,
" Not marking %s as needing attention because "
" it's in full view \n " ,
window - > desc ) ;
}
2006-03-29 13:43:22 -05:00
}
void
meta_window_unset_demands_attention ( MetaWindow * window )
{
meta_topic ( META_DEBUG_WINDOW_OPS ,
" Marking %s as not needing attention \n " , window - > desc ) ;
2008-12-18 07:41:56 -05:00
2009-11-17 05:02:06 -05:00
if ( window - > wm_state_demands_attention )
{
window - > wm_state_demands_attention = FALSE ;
set_net_wm_state ( window ) ;
g_object_notify ( G_OBJECT ( window ) , " demands-attention " ) ;
}
2006-03-29 13:43:22 -05:00
}
2008-05-18 20:00:09 -04:00
2010-09-01 15:39:53 -04:00
/**
* meta_window_get_frame : ( skip )
*
*/
2008-05-18 20:00:09 -04:00
MetaFrame *
meta_window_get_frame ( MetaWindow * window )
{
return window - > frame ;
}
2010-11-11 16:04:31 -05:00
/**
* meta_window_appears_focused :
* @ window : a # MetaWindow
*
* Determines if the window should be drawn with a focused appearance . This is
* true for focused windows but also true for windows with a focused modal
* dialog attached .
*
* Return value : % TRUE if the window should be drawn with a focused frame
*/
2010-09-10 05:55:20 -04:00
gboolean
meta_window_appears_focused ( MetaWindow * window )
{
2011-03-24 21:36:47 -04:00
return window - > has_focus | | ( window - > attached_focus_window ! = NULL ) ;
2010-09-10 05:55:20 -04:00
}
2008-05-18 20:00:09 -04:00
gboolean
meta_window_has_focus ( MetaWindow * window )
{
return window - > has_focus ;
}
gboolean
meta_window_is_shaded ( MetaWindow * window )
{
return window - > shaded ;
}
2009-08-14 05:42:56 -04:00
/**
* meta_window_is_override_redirect :
* @ window : A # MetaWindow
*
* Returns if this window isn ' t managed by mutter ; it will
* control its own positioning and mutter won ' t draw decorations
* among other things . In X terminology this is " override redirect " .
*/
gboolean
meta_window_is_override_redirect ( MetaWindow * window )
{
return window - > override_redirect ;
}
2009-08-28 12:39:55 -04:00
/**
* meta_window_is_skip_taskbar :
* @ window : A # MetaWindow
*
* Gets whether this window should be ignored by task lists .
*
* Return value : % TRUE if the skip bar hint is set .
*/
gboolean
meta_window_is_skip_taskbar ( MetaWindow * window )
{
g_return_val_if_fail ( META_IS_WINDOW ( window ) , FALSE ) ;
return window - > skip_taskbar ;
}
2011-02-26 12:39:57 -05:00
/**
* meta_window_get_rect :
* @ window : a # MetaWindow
*
* Gets the rectangle that bounds @ window , ignoring any window decorations .
*
* Return value : ( transfer none ) : the # MetaRectangle for the window
*/
2008-05-18 20:00:09 -04:00
MetaRectangle *
meta_window_get_rect ( MetaWindow * window )
{
return & window - > rect ;
}
2008-11-17 16:34:28 -05:00
/**
* meta_window_get_screen :
* @ window : a # MetaWindow
*
* Gets the # MetaScreen that the window is on .
*
* Return value : ( transfer none ) : the # MetaScreen for the window
*/
2008-05-18 20:00:09 -04:00
MetaScreen *
meta_window_get_screen ( MetaWindow * window )
{
return window - > screen ;
}
2010-09-01 15:39:53 -04:00
/**
* meta_window_get_display :
* @ window : A # MetaWindow
*
* Returns : ( transfer none ) : The display for @ window
*/
2008-05-18 20:00:09 -04:00
MetaDisplay *
meta_window_get_display ( MetaWindow * window )
{
return window - > display ;
}
2010-09-01 15:39:53 -04:00
/**
* meta_window_get_xwindow : ( skip )
*
*/
2008-05-18 20:00:09 -04:00
Window
meta_window_get_xwindow ( MetaWindow * window )
{
return window - > xwindow ;
}
2008-08-18 10:42:38 -04:00
MetaWindowType
2008-11-07 04:57:00 -05:00
meta_window_get_window_type ( MetaWindow * window )
2008-08-18 10:42:38 -04:00
{
return window - > type ;
}
2010-10-18 14:34:14 -04:00
/**
* meta_window_get_window_type_atom : ( skip )
* @ window : a # MetaWindow
*
* Gets the X atom from the _NET_WM_WINDOW_TYPE property used by the
* application to set the window type . ( Note that this is constrained
* to be some value that Mutter recognizes - a completely unrecognized
* type atom will be returned as None . )
*
* Return value : the raw X atom for the window type , or None
*/
2008-08-18 10:42:38 -04:00
Atom
2008-11-07 04:57:00 -05:00
meta_window_get_window_type_atom ( MetaWindow * window )
2008-08-18 10:42:38 -04:00
{
return window - > type_atom ;
}
2008-09-18 11:09:11 -04:00
2008-11-17 16:34:28 -05:00
/**
* meta_window_get_workspace :
* @ window : a # MetaWindow
*
* Gets the # MetaWorkspace that the window is currently displayed on .
* If the window is on all workspaces , returns the currently active
* workspace .
*
* Return value : ( transfer none ) : the # MetaWorkspace for the window
*/
2008-09-18 11:09:11 -04:00
MetaWorkspace *
meta_window_get_workspace ( MetaWindow * window )
{
if ( window - > on_all_workspaces )
return window - > screen - > active_workspace ;
return window - > workspace ;
}
gboolean
meta_window_is_on_all_workspaces ( MetaWindow * window )
{
return window - > on_all_workspaces ;
}
2008-10-24 05:07:24 -04:00
gboolean
meta_window_is_hidden ( MetaWindow * window )
{
return window - > hidden ;
}
2008-10-30 04:30:42 -04:00
const char *
meta_window_get_description ( MetaWindow * window )
{
if ( ! window )
return NULL ;
return window - > desc ;
}
2008-11-23 14:28:40 -05:00
2009-05-29 13:26:18 -04:00
/**
* meta_window_get_wm_class :
* @ window : a # MetaWindow
2010-03-17 05:20:39 -04:00
*
* Return the current value of the name part of WM_CLASS X property .
2009-05-29 13:26:18 -04:00
*/
const char *
meta_window_get_wm_class ( MetaWindow * window )
{
if ( ! window )
return NULL ;
return window - > res_class ;
}
2010-03-17 05:20:39 -04:00
/**
* meta_window_get_wm_class_instance :
* @ window : a # MetaWindow
*
* Return the current value of the instance part of WM_CLASS X property .
*/
const char *
meta_window_get_wm_class_instance ( MetaWindow * window )
{
if ( ! window )
return NULL ;
return window - > res_name ;
}
2011-11-25 18:42:41 -05:00
/**
2012-01-17 13:27:10 -05:00
* meta_window_get_gtk_application_id :
2011-11-25 18:42:41 -05:00
* @ window : a # MetaWindow
*
* Return value : ( transfer none ) : the application ID
* */
const char *
2012-01-17 13:27:10 -05:00
meta_window_get_gtk_application_id ( MetaWindow * window )
2011-11-25 18:42:41 -05:00
{
2012-01-17 13:27:10 -05:00
return window - > gtk_application_id ;
2011-11-25 18:42:41 -05:00
}
2011-12-05 12:52:35 -05:00
/**
2012-01-17 13:27:10 -05:00
* meta_window_get_gtk_unique_bus_name :
2011-12-05 12:52:35 -05:00
* @ window : a # MetaWindow
*
* Return value : ( transfer none ) : the unique name
* */
const char *
2012-01-17 13:27:10 -05:00
meta_window_get_gtk_unique_bus_name ( MetaWindow * window )
{
return window - > gtk_unique_bus_name ;
}
/**
* meta_window_get_gtk_application_object_path :
* @ window : a # MetaWindow
*
* Return value : ( transfer none ) : the object path
* */
const char *
meta_window_get_gtk_application_object_path ( MetaWindow * window )
{
return window - > gtk_application_object_path ;
}
/**
* meta_window_get_gtk_window_object_path :
* @ window : a # MetaWindow
*
* Return value : ( transfer none ) : the object path
* */
const char *
meta_window_get_gtk_window_object_path ( MetaWindow * window )
{
return window - > gtk_window_object_path ;
}
/**
* meta_window_get_gtk_app_menu_object_path :
* @ window : a # MetaWindow
*
* Return value : ( transfer none ) : the object path
* */
const char *
meta_window_get_gtk_app_menu_object_path ( MetaWindow * window )
2011-12-05 12:52:35 -05:00
{
2012-01-17 13:27:10 -05:00
return window - > gtk_app_menu_object_path ;
2011-12-05 12:52:35 -05:00
}
/**
2012-01-17 13:27:10 -05:00
* meta_window_get_gtk_menubar_object_path :
2011-12-05 12:52:35 -05:00
* @ window : a # MetaWindow
*
* Return value : ( transfer none ) : the object path
* */
const char *
2012-01-17 13:27:10 -05:00
meta_window_get_gtk_menubar_object_path ( MetaWindow * window )
2011-12-05 12:52:35 -05:00
{
2012-01-17 13:27:10 -05:00
return window - > gtk_menubar_object_path ;
2011-12-05 12:52:35 -05:00
}
2009-02-02 15:16:05 -05:00
/**
* meta_window_get_compositor_private :
* @ window : a # MetaWindow
*
* Gets the compositor ' s wrapper object for @ window .
*
* Return value : ( transfer none ) : the wrapper object .
* */
GObject *
2008-11-23 14:28:40 -05:00
meta_window_get_compositor_private ( MetaWindow * window )
{
if ( ! window )
return NULL ;
return window - > compositor_private ;
}
void
2009-02-02 15:16:05 -05:00
meta_window_set_compositor_private ( MetaWindow * window , GObject * priv )
2008-11-23 14:28:40 -05:00
{
if ( ! window )
return ;
window - > compositor_private = priv ;
}
2009-01-12 07:30:31 -05:00
const char *
meta_window_get_role ( MetaWindow * window )
{
if ( ! window )
return NULL ;
return window - > role ;
}
2009-06-09 23:02:14 -04:00
/**
* meta_window_get_title :
* @ window : a # MetaWindow
*
* Returns the current title of the window .
*/
const char *
meta_window_get_title ( MetaWindow * window )
{
g_return_val_if_fail ( META_IS_WINDOW ( window ) , NULL ) ;
return window - > title ;
}
2009-03-12 17:07:27 -04:00
MetaStackLayer
meta_window_get_layer ( MetaWindow * window )
{
return window - > layer ;
}
2009-06-09 23:28:21 -04:00
/**
* meta_window_get_transient_for :
* @ window : a # MetaWindow
*
* Returns the # MetaWindow for the window that is pointed to by the
* WM_TRANSIENT_FOR hint on this window ( see XGetTransientForHint ( )
* or XSetTransientForHint ( ) ) . Metacity keeps transient windows above their
* parents . A typical usage of this hint is for a dialog that wants to stay
* above its associated window .
*
* Return value : ( transfer none ) : the window this window is transient for , or
* % NULL if the WM_TRANSIENT_FOR hint is unset or does not point to a toplevel
* window that Metacity knows about .
*/
MetaWindow *
meta_window_get_transient_for ( MetaWindow * window )
{
g_return_val_if_fail ( META_IS_WINDOW ( window ) , NULL ) ;
if ( window - > xtransient_for )
return meta_display_lookup_x_window ( window - > display ,
window - > xtransient_for ) ;
else
return NULL ;
}
2009-07-31 13:52:25 -04:00
2009-10-07 06:56:49 -04:00
/**
* meta_window_get_transient_for_as_xid :
* @ window : a # MetaWindow
*
* Returns the XID of the window that is pointed to by the
* WM_TRANSIENT_FOR hint on this window ( see XGetTransientForHint ( )
* or XSetTransientForHint ( ) ) . Metacity keeps transient windows above their
* parents . A typical usage of this hint is for a dialog that wants to stay
* above its associated window .
*
* Return value : ( transfer none ) : the window this window is transient for , or
* None if the WM_TRANSIENT_FOR hint is unset .
*/
Window
meta_window_get_transient_for_as_xid ( MetaWindow * window )
{
return window - > xtransient_for ;
}
2009-07-31 13:52:25 -04:00
/**
* meta_window_get_pid :
* @ window : a # MetaWindow
*
* Returns pid of the process that created this window , if known ( obtained from
* the _NET_WM_PID property ) .
*
* Return value : ( transfer none ) : the pid , or - 1 if not known .
*/
int
meta_window_get_pid ( MetaWindow * window )
{
g_return_val_if_fail ( META_IS_WINDOW ( window ) , - 1 ) ;
return window - > net_wm_pid ;
}
/**
* meta_window_get_client_machine :
* @ window : a # MetaWindow
*
* Returns name of the client machine from which this windows was created ,
* if known ( obtained from the WM_CLIENT_MACHINE property ) .
*
* Return value : ( transfer none ) : the machine name , or NULL ; the string is
* owned by the window manager and should not be freed or modified by the
* caller .
*/
const char *
meta_window_get_client_machine ( MetaWindow * window )
{
g_return_val_if_fail ( META_IS_WINDOW ( window ) , NULL ) ;
return window - > wm_client_machine ;
}
2010-06-04 13:57:41 -04:00
/**
* meta_window_is_remote :
* @ window : a # MetaWindow
*
* Returns : % TRUE if this window originates from a host
* different from the one running mutter .
*/
gboolean
meta_window_is_remote ( MetaWindow * window )
{
g_return_val_if_fail ( META_IS_WINDOW ( window ) , FALSE ) ;
2011-04-13 10:18:49 -04:00
if ( window - > wm_client_machine ! = NULL )
return g_strcmp0 ( window - > wm_client_machine , window - > display - > hostname ) ! = 0 ;
return FALSE ;
2010-06-04 13:57:41 -04:00
}
2009-08-06 13:11:11 -04:00
/**
* meta_window_is_modal :
* @ window : a # MetaWindow
*
* Queries whether the window is in a modal state as described by the
* _NET_WM_STATE protocol .
*
* Return value : ( transfer none ) : TRUE if the window is in modal state .
*/
gboolean
meta_window_is_modal ( MetaWindow * window )
{
g_return_val_if_fail ( META_IS_WINDOW ( window ) , FALSE ) ;
return window - > wm_state_modal ;
}
2010-01-18 05:12:17 -05:00
/**
* meta_window_get_mutter_hints :
* @ window : a # MetaWindow
*
* Gets the current value of the _MUTTER_HINTS property .
*
* The purpose of the hints is to allow fine - tuning of the Window Manager and
* Compositor behaviour on per - window basis , and is intended primarily for
* hints that are plugin - specific .
*
* The property is a list of colon - separated key = value pairs . The key names for
* any plugin - specific hints must be suitably namespaced to allow for shared
* use ; ' mutter - ' key prefix is reserved for internal use , and must not be used
* by plugins .
*
* Return value : ( transfer none ) : the _MUTTER_HINTS string , or % NULL if no hints
* are set .
*/
const char *
meta_window_get_mutter_hints ( MetaWindow * window )
{
g_return_val_if_fail ( META_IS_WINDOW ( window ) , NULL ) ;
return window - > mutter_hints ;
}
2010-11-11 16:12:11 -05:00
/**
* meta_window_get_frame_type :
* @ window : a # MetaWindow
*
* Gets the type of window decorations that should be used for this window .
*
* Return value : the frame type
*/
MetaFrameType
meta_window_get_frame_type ( MetaWindow * window )
{
MetaFrameType base_type = META_FRAME_TYPE_LAST ;
switch ( window - > type )
{
case META_WINDOW_NORMAL :
base_type = META_FRAME_TYPE_NORMAL ;
break ;
case META_WINDOW_DIALOG :
base_type = META_FRAME_TYPE_DIALOG ;
break ;
case META_WINDOW_MODAL_DIALOG :
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
if ( meta_window_is_attached_dialog ( window ) )
2010-11-11 16:12:11 -05:00
base_type = META_FRAME_TYPE_ATTACHED ;
else
base_type = META_FRAME_TYPE_MODAL_DIALOG ;
break ;
case META_WINDOW_MENU :
base_type = META_FRAME_TYPE_MENU ;
break ;
case META_WINDOW_UTILITY :
base_type = META_FRAME_TYPE_UTILITY ;
break ;
case META_WINDOW_DESKTOP :
case META_WINDOW_DOCK :
case META_WINDOW_TOOLBAR :
case META_WINDOW_SPLASHSCREEN :
case META_WINDOW_DROPDOWN_MENU :
case META_WINDOW_POPUP_MENU :
case META_WINDOW_TOOLTIP :
case META_WINDOW_NOTIFICATION :
case META_WINDOW_COMBO :
case META_WINDOW_DND :
case META_WINDOW_OVERRIDE_OTHER :
/* No frame */
base_type = META_FRAME_TYPE_LAST ;
break ;
}
if ( base_type = = META_FRAME_TYPE_LAST )
{
/* can't add border if undecorated */
return META_FRAME_TYPE_LAST ;
}
2011-10-07 06:45:56 -04:00
else if ( ( window - > border_only & & base_type ! = META_FRAME_TYPE_ATTACHED ) | |
2012-07-02 20:19:37 -04:00
( window - > hide_titlebar_when_maximized & & META_WINDOW_MAXIMIZED ( window ) ) | |
( window - > hide_titlebar_when_maximized & & META_WINDOW_TILED_SIDE_BY_SIDE ( window ) ) )
2010-11-11 16:12:11 -05:00
{
/* override base frame type */
return META_FRAME_TYPE_BORDER ;
}
else
{
return base_type ;
}
}
2011-03-22 15:36:12 -04:00
/**
* meta_window_get_frame_bounds :
*
* Gets a region representing the outer bounds of the window ' s frame .
*
* Return value : ( transfer none ) ( allow - none ) : a # cairo_region_t
* holding the outer bounds of the window , or % NULL if the window
* doesn ' t have a frame .
*/
cairo_region_t *
meta_window_get_frame_bounds ( MetaWindow * window )
{
if ( ! window - > frame_bounds )
{
if ( window - > frame )
window - > frame_bounds = meta_frame_get_frame_bounds ( window - > frame ) ;
}
return window - > frame_bounds ;
}
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
/**
* meta_window_is_attached_dialog :
* @ window : a # MetaWindow
*
* Tests if @ window is should be attached to its parent window .
* ( If the " attach_modal_dialogs " option is not enabled , this will
* always return % FALSE . )
*
* Return value : whether @ window should be attached to its parent
*/
gboolean
meta_window_is_attached_dialog ( MetaWindow * window )
{
return window - > attached ;
}
2012-02-24 11:08:55 -05:00
/**
* meta_window_get_tile_match :
*
* Returns the matching tiled window on the same monitor as @ window . This is
* the topmost tiled window in a complementary tile mode that is :
*
* - on the same monitor ;
* - on the same workspace ;
* - spanning the remaining monitor width ;
* - there is no 3 rd window stacked between both tiled windows that ' s
* partially visible in the common edge .
*
* Return value : ( transfer none ) ( allow - none ) : the matching tiled window or
* % NULL if it doesn ' t exist .
*/
MetaWindow *
meta_window_get_tile_match ( MetaWindow * window )
{
return window - > tile_match ;
}
void
meta_window_compute_tile_match ( MetaWindow * window )
{
MetaWindow * match ;
MetaStack * stack ;
2012-03-18 14:53:31 -04:00
MetaTileMode match_tile_mode = META_TILE_NONE ;
2012-02-24 11:08:55 -05:00
window - > tile_match = NULL ;
2012-03-18 14:53:31 -04:00
if ( window - > shaded | | window - > minimized )
2012-02-24 11:08:55 -05:00
return ;
2012-03-18 14:53:31 -04:00
if ( META_WINDOW_TILED_LEFT ( window ) )
match_tile_mode = META_TILE_RIGHT ;
else if ( META_WINDOW_TILED_RIGHT ( window ) )
match_tile_mode = META_TILE_LEFT ;
else
return ;
2012-02-24 11:08:55 -05:00
stack = window - > screen - > stack ;
for ( match = meta_stack_get_top ( stack ) ;
match ;
match = meta_stack_get_below ( stack , match , FALSE ) )
{
if ( ! match - > shaded & &
! match - > minimized & &
match - > tile_mode = = match_tile_mode & &
match - > monitor = = window - > monitor & &
meta_window_get_workspace ( match ) = = meta_window_get_workspace ( window ) )
break ;
}
if ( match )
{
MetaWindow * above , * bottommost , * topmost ;
MetaRectangle above_rect , bottommost_rect , topmost_rect ;
if ( meta_stack_windows_cmp ( window - > screen - > stack , match , window ) > 0 )
{
topmost = match ;
bottommost = window ;
}
else
{
topmost = window ;
bottommost = match ;
}
meta_window_get_outer_rect ( bottommost , & bottommost_rect ) ;
meta_window_get_outer_rect ( topmost , & topmost_rect ) ;
/*
* If there ' s a window stacked in between which is partially visible
* behind the topmost tile we don ' t consider the tiles to match .
*/
for ( above = meta_stack_get_above ( stack , bottommost , FALSE ) ;
above & & above ! = topmost ;
above = meta_stack_get_above ( stack , above , FALSE ) )
{
if ( above - > minimized | |
above - > monitor ! = window - > monitor | |
meta_window_get_workspace ( above ) ! = meta_window_get_workspace ( window ) )
continue ;
meta_window_get_outer_rect ( above , & above_rect ) ;
if ( meta_rectangle_overlap ( & above_rect , & bottommost_rect ) & &
meta_rectangle_overlap ( & above_rect , & topmost_rect ) )
return ;
}
window - > tile_match = match ;
}
}