2006-10-01 18:30:10 -04:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
2001-05-30 11:36:31 -04:00
|
|
|
/* Metacity X display handler */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2001 Havoc Pennington
|
2002-12-09 22:23:04 -05:00
|
|
|
* Copyright (C) 2002 Red Hat, Inc.
|
2004-02-22 20:48:29 -05:00
|
|
|
* Copyright (C) 2003 Rob Adams
|
2006-01-10 14:43:21 -05:00
|
|
|
* Copyright (C) 2004-2006 Elijah Newren
|
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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2008-05-18 20:00:09 -04:00
|
|
|
#ifndef META_DISPLAY_PRIVATE_H
|
|
|
|
#define META_DISPLAY_PRIVATE_H
|
2001-05-30 11:36:31 -04:00
|
|
|
|
2002-10-26 23:03:32 -04:00
|
|
|
#ifndef PACKAGE
|
|
|
|
#error "config.h not included"
|
|
|
|
#endif
|
|
|
|
|
2001-05-30 11:36:31 -04:00
|
|
|
#include <glib.h>
|
2001-06-02 00:14:18 -04:00
|
|
|
#include <X11/Xlib.h>
|
2001-05-30 11:36:31 -04:00
|
|
|
#include "eventqueue.h"
|
2001-07-11 02:22:00 -04:00
|
|
|
#include "common.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 "boxes.h"
|
2008-05-18 20:00:09 -04:00
|
|
|
#include "display.h"
|
2001-05-30 11:36:31 -04:00
|
|
|
|
2002-10-25 19:35:50 -04:00
|
|
|
#ifdef HAVE_STARTUP_NOTIFICATION
|
|
|
|
#include <libsn/sn.h>
|
|
|
|
#endif
|
|
|
|
|
2002-12-09 22:23:04 -05:00
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
#include <X11/extensions/sync.h>
|
|
|
|
#endif
|
|
|
|
|
2002-04-28 00:52:26 -04:00
|
|
|
typedef struct _MetaKeyBinding MetaKeyBinding;
|
|
|
|
typedef struct _MetaStack MetaStack;
|
|
|
|
typedef struct _MetaUISlave MetaUISlave;
|
2001-05-30 11:36:31 -04:00
|
|
|
|
2002-11-03 18:42:21 -05:00
|
|
|
typedef struct _MetaWindowPropHooks MetaWindowPropHooks;
|
2002-11-30 22:58:04 -05:00
|
|
|
typedef struct _MetaGroupPropHooks MetaGroupPropHooks;
|
2002-11-03 18:42:21 -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
|
|
|
typedef struct MetaEdgeResistanceData MetaEdgeResistanceData;
|
|
|
|
|
Screw around with Anders's ping patch so he'll get plenty of CVS
2002-02-26 Havoc Pennington <hp@pobox.com>
Screw around with Anders's ping patch so he'll get plenty of CVS
conflicts. ;-)
* src/display.c (meta_display_ping_window): spew warnings
if we try to call this with CurrentTime
(meta_display_ping_timeout): remove ping from the pending pings
after it times out.
* src/util.h: added PING debug category
* src/display.c (remove_pending_pings_for_window): don't remove
"tmp" just before "tmp->next", don't break out of loop after
finding the first match
(meta_display_open): no trailing comma in array init
(event_callback): move the processing of ping replies into a
separate function
* src/screen.c (set_supported_hint): add _NET_WM_PING to supported
list
* src/display.h: change gpointer to void*
2002-02-26 Anders Carlsson <andersca@gnu.org>
* src/display.c: (ping_data_free),
(remove_pending_pings_for_window), (meta_display_open),
(event_callback), (meta_display_unregister_x_window),
(meta_display_ping_timeout), (meta_display_ping_window),
(meta_display_window_has_pending_pings):
Implement meta_display_ping_window, and filter out scroll wheel
events.
* src/display.h:
Add MetaWindowPingFunc, meta_display_ping_window and
meta_display_window_has_pending_pings.
2002-02-26 21:05:39 -05:00
|
|
|
typedef void (* MetaWindowPingFunc) (MetaDisplay *display,
|
|
|
|
Window 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,
|
Screw around with Anders's ping patch so he'll get plenty of CVS
2002-02-26 Havoc Pennington <hp@pobox.com>
Screw around with Anders's ping patch so he'll get plenty of CVS
conflicts. ;-)
* src/display.c (meta_display_ping_window): spew warnings
if we try to call this with CurrentTime
(meta_display_ping_timeout): remove ping from the pending pings
after it times out.
* src/util.h: added PING debug category
* src/display.c (remove_pending_pings_for_window): don't remove
"tmp" just before "tmp->next", don't break out of loop after
finding the first match
(meta_display_open): no trailing comma in array init
(event_callback): move the processing of ping replies into a
separate function
* src/screen.c (set_supported_hint): add _NET_WM_PING to supported
list
* src/display.h: change gpointer to void*
2002-02-26 Anders Carlsson <andersca@gnu.org>
* src/display.c: (ping_data_free),
(remove_pending_pings_for_window), (meta_display_open),
(event_callback), (meta_display_unregister_x_window),
(meta_display_ping_timeout), (meta_display_ping_window),
(meta_display_window_has_pending_pings):
Implement meta_display_ping_window, and filter out scroll wheel
events.
* src/display.h:
Add MetaWindowPingFunc, meta_display_ping_window and
meta_display_window_has_pending_pings.
2002-02-26 21:05:39 -05:00
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
|
2001-06-09 02:08:44 -04:00
|
|
|
#define _NET_WM_STATE_REMOVE 0 /* remove/unset property */
|
|
|
|
#define _NET_WM_STATE_ADD 1 /* add/set property */
|
|
|
|
#define _NET_WM_STATE_TOGGLE 2 /* toggle property */
|
|
|
|
|
2002-03-02 10:26:07 -05:00
|
|
|
/* This is basically a bogus number, just has to be large enough
|
|
|
|
* to handle the expected case of the alt+tab operation, where
|
|
|
|
* we want to ignore serials from UnmapNotify on the tab popup,
|
|
|
|
* and the LeaveNotify/EnterNotify from the pointer ungrab
|
|
|
|
*/
|
|
|
|
#define N_IGNORED_SERIALS 4
|
|
|
|
|
2001-05-30 11:36:31 -04:00
|
|
|
struct _MetaDisplay
|
|
|
|
{
|
2008-12-02 17:58:07 -05:00
|
|
|
GObject parent_instance;
|
|
|
|
|
2001-05-30 11:36:31 -04:00
|
|
|
char *name;
|
|
|
|
Display *xdisplay;
|
2001-05-31 23:00:01 -04:00
|
|
|
|
2001-06-09 17:58:30 -04:00
|
|
|
Window leader_window;
|
2007-03-31 01:19:41 -04:00
|
|
|
Window timestamp_pinging_window;
|
2001-06-09 17:58:30 -04:00
|
|
|
|
2008-05-02 14:49:01 -04:00
|
|
|
/* Pull in all the names of atoms as fields; we will intern them when the
|
|
|
|
* class is constructed.
|
|
|
|
*/
|
|
|
|
#define item(x) Atom atom_##x;
|
|
|
|
#include "atomnames.h"
|
|
|
|
#undef item
|
2004-01-10 12:16:07 -05:00
|
|
|
|
2001-06-04 00:58:22 -04:00
|
|
|
/* This is the actual window from focus events,
|
|
|
|
* not the one we last set
|
|
|
|
*/
|
|
|
|
MetaWindow *focus_window;
|
2001-06-06 00:47:37 -04:00
|
|
|
|
2004-12-23 01:44:56 -05:00
|
|
|
/* window we are expecting a FocusIn event for or the current focus
|
|
|
|
* window if we are not expecting any FocusIn/FocusOut events; not
|
|
|
|
* perfect because applications can call XSetInputFocus directly.
|
|
|
|
* (It could also be messed up if a timestamp later than current
|
|
|
|
* time is sent to meta_display_set_input_focus_window, though that
|
|
|
|
* would be a programming error). See bug 154598 for more info.
|
2002-08-08 00:45:13 -04:00
|
|
|
*/
|
|
|
|
MetaWindow *expected_focus_window;
|
|
|
|
|
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
|
|
|
/* last timestamp passed to XSetInputFocus */
|
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 last_focus_time;
|
2004-12-23 01:44:56 -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
|
|
|
/* last user interaction time in any app */
|
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 last_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
|
|
|
|
2005-02-21 21:11:25 -05:00
|
|
|
/* whether we're using mousenav (only relevant for sloppy&mouse focus modes;
|
|
|
|
* !mouse_mode means "keynav mode")
|
|
|
|
*/
|
|
|
|
guint mouse_mode : 1;
|
|
|
|
|
2006-04-12 14:01:20 -04:00
|
|
|
/* Helper var used when focus_new_windows setting is 'strict'; only
|
|
|
|
* relevant in 'strict' mode and if the focus window is a terminal.
|
|
|
|
* In that case, we don't allow new windows to take focus away from
|
|
|
|
* a terminal, but if the user explicitly did something that should
|
|
|
|
* allow a different window to gain focus (e.g. global keybinding or
|
|
|
|
* clicking on a dock), then we will allow the transfer.
|
2006-01-15 12:03:57 -05:00
|
|
|
*/
|
|
|
|
guint allow_terminal_deactivation : 1;
|
|
|
|
|
2002-01-19 18:59:11 -05:00
|
|
|
guint static_gravity_works : 1;
|
2001-06-02 00:14:18 -04:00
|
|
|
|
2001-05-31 23:00:01 -04:00
|
|
|
/*< private-ish >*/
|
2002-10-21 17:44:35 -04:00
|
|
|
guint error_trap_synced_at_last_pop : 1;
|
2001-05-30 11:36:31 -04:00
|
|
|
MetaEventQueue *events;
|
|
|
|
GSList *screens;
|
2006-01-30 12:22:14 -05:00
|
|
|
MetaScreen *active_screen;
|
2001-05-30 11:36:31 -04:00
|
|
|
GHashTable *window_ids;
|
2002-02-24 14:58:27 -05:00
|
|
|
int error_traps;
|
|
|
|
int (* error_trap_handler) (Display *display,
|
|
|
|
XErrorEvent *error);
|
2001-05-31 02:42:58 -04:00
|
|
|
int server_grab_count;
|
2001-06-07 22:17:48 -04:00
|
|
|
|
2002-03-02 10:26:07 -05:00
|
|
|
/* serials of leave/unmap events that may
|
|
|
|
* correspond to an enter event we should
|
|
|
|
* ignore
|
|
|
|
*/
|
|
|
|
unsigned long ignored_serials[N_IGNORED_SERIALS];
|
|
|
|
Window ungrab_should_not_cause_focus_window;
|
|
|
|
|
2002-01-03 18:28:19 -05:00
|
|
|
guint32 current_time;
|
Screw around with Anders's ping patch so he'll get plenty of CVS
2002-02-26 Havoc Pennington <hp@pobox.com>
Screw around with Anders's ping patch so he'll get plenty of CVS
conflicts. ;-)
* src/display.c (meta_display_ping_window): spew warnings
if we try to call this with CurrentTime
(meta_display_ping_timeout): remove ping from the pending pings
after it times out.
* src/util.h: added PING debug category
* src/display.c (remove_pending_pings_for_window): don't remove
"tmp" just before "tmp->next", don't break out of loop after
finding the first match
(meta_display_open): no trailing comma in array init
(event_callback): move the processing of ping replies into a
separate function
* src/screen.c (set_supported_hint): add _NET_WM_PING to supported
list
* src/display.h: change gpointer to void*
2002-02-26 Anders Carlsson <andersca@gnu.org>
* src/display.c: (ping_data_free),
(remove_pending_pings_for_window), (meta_display_open),
(event_callback), (meta_display_unregister_x_window),
(meta_display_ping_timeout), (meta_display_ping_window),
(meta_display_window_has_pending_pings):
Implement meta_display_ping_window, and filter out scroll wheel
events.
* src/display.h:
Add MetaWindowPingFunc, meta_display_ping_window and
meta_display_window_has_pending_pings.
2002-02-26 21:05:39 -05:00
|
|
|
|
|
|
|
/* Pings which we're waiting for a reply from */
|
|
|
|
GSList *pending_pings;
|
2002-05-23 22:23:46 -04:00
|
|
|
|
|
|
|
/* Pending autoraise */
|
|
|
|
guint autoraise_timeout_id;
|
2004-10-04 17:09:08 -04:00
|
|
|
MetaWindow* autoraise_window;
|
2002-10-07 19:14:40 -04:00
|
|
|
|
|
|
|
/* Alt+click button grabs */
|
|
|
|
unsigned int window_grab_modifiers;
|
2001-07-25 23:14:45 -04:00
|
|
|
|
2001-07-11 02:22:00 -04:00
|
|
|
/* current window operation */
|
|
|
|
MetaGrabOp grab_op;
|
2002-06-27 01:08:32 -04:00
|
|
|
MetaScreen *grab_screen;
|
2001-07-11 02:22:00 -04:00
|
|
|
MetaWindow *grab_window;
|
2002-03-02 10:26:07 -05:00
|
|
|
Window grab_xwindow;
|
2001-07-11 02:22:00 -04:00
|
|
|
int grab_button;
|
2003-10-12 02:25:38 -04:00
|
|
|
int grab_anchor_root_x;
|
|
|
|
int grab_anchor_root_y;
|
|
|
|
MetaRectangle grab_anchor_window_pos;
|
2002-12-09 22:23:04 -05:00
|
|
|
int grab_latest_motion_x;
|
|
|
|
int grab_latest_motion_y;
|
2001-07-11 02:22:00 -04:00
|
|
|
gulong grab_mask;
|
|
|
|
guint grab_have_pointer : 1;
|
|
|
|
guint grab_have_keyboard : 1;
|
2003-10-12 02:25:38 -04:00
|
|
|
guint grab_wireframe_active : 1;
|
2006-08-21 14:38:21 -04:00
|
|
|
guint grab_was_cancelled : 1; /* Only used in wireframe mode */
|
2006-10-12 20:28:34 -04:00
|
|
|
guint grab_frame_action : 1;
|
2003-10-12 02:25:38 -04:00
|
|
|
MetaRectangle grab_wireframe_rect;
|
2004-08-18 22:05:24 -04:00
|
|
|
MetaRectangle grab_wireframe_last_xor_rect;
|
2001-07-12 01:53:56 -04:00
|
|
|
MetaRectangle grab_initial_window_pos;
|
2006-01-20 18:02:24 -05:00
|
|
|
int grab_initial_x, grab_initial_y; /* These are only relevant for */
|
|
|
|
gboolean grab_threshold_movement_reached; /* raise_on_click == FALSE. */
|
2002-03-17 12:22:23 -05:00
|
|
|
MetaResizePopup *grab_resize_popup;
|
2002-08-10 01:27:17 -04:00
|
|
|
GTimeVal grab_last_moveresize_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
|
|
|
guint32 grab_motion_notify_time;
|
2005-05-26 15:58:17 -04:00
|
|
|
int grab_wireframe_last_display_width;
|
|
|
|
int grab_wireframe_last_display_height;
|
2005-01-24 00:58:30 -05:00
|
|
|
GList* grab_old_window_stacking;
|
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
|
|
|
MetaEdgeResistanceData *grab_edge_resistance_data;
|
2006-04-15 18:58:07 -04:00
|
|
|
unsigned int grab_last_user_action_was_snap;
|
|
|
|
|
2003-05-30 16:24:00 -04:00
|
|
|
/* we use property updates as sentinels for certain window focus events
|
|
|
|
* to avoid some race conditions on EnterNotify events
|
|
|
|
*/
|
|
|
|
int sentinel_counter;
|
|
|
|
|
2003-01-28 10:07:43 -05:00
|
|
|
#ifdef HAVE_XKB
|
|
|
|
int xkb_base_event_type;
|
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 last_bell_time;
|
2003-01-28 10:07:43 -05:00
|
|
|
#endif
|
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
|
|
|
/* alarm monitoring client's _NET_WM_SYNC_REQUEST_COUNTER */
|
|
|
|
XSyncAlarm grab_sync_request_alarm;
|
2002-12-09 22:23:04 -05: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
|
|
|
int grab_resize_timeout_id;
|
2002-04-28 00:52:26 -04:00
|
|
|
|
|
|
|
/* Keybindings stuff */
|
2008-11-22 14:02:54 -05:00
|
|
|
MetaKeyBinding *key_bindings;
|
|
|
|
int n_key_bindings;
|
2006-04-13 09:16:42 -04:00
|
|
|
int min_keycode;
|
|
|
|
int max_keycode;
|
2002-04-28 00:52:26 -04:00
|
|
|
KeySym *keymap;
|
|
|
|
int keysyms_per_keycode;
|
|
|
|
XModifierKeymap *modmap;
|
|
|
|
unsigned int ignored_modifier_mask;
|
|
|
|
unsigned int num_lock_mask;
|
|
|
|
unsigned int scroll_lock_mask;
|
2002-07-13 23:16:41 -04:00
|
|
|
unsigned int hyper_mask;
|
|
|
|
unsigned int super_mask;
|
|
|
|
unsigned int meta_mask;
|
|
|
|
|
2002-06-06 23:18:46 -04:00
|
|
|
/* Xinerama cache */
|
|
|
|
unsigned int xinerama_cache_invalidated : 1;
|
2002-06-22 01:11:04 -04:00
|
|
|
|
2006-10-01 17:59:09 -04:00
|
|
|
/* Opening the display */
|
|
|
|
unsigned int display_opening : 1;
|
|
|
|
|
2002-06-22 01:11:04 -04:00
|
|
|
/* Closing down the display */
|
|
|
|
int closing;
|
2002-08-12 17:32:13 -04:00
|
|
|
|
|
|
|
/* Managed by group.c */
|
|
|
|
GHashTable *groups_by_leader;
|
2002-10-26 23:03:32 -04:00
|
|
|
|
2002-10-28 00:35:30 -05:00
|
|
|
/* currently-active window menu if any */
|
|
|
|
MetaWindowMenu *window_menu;
|
|
|
|
MetaWindow *window_with_menu;
|
2002-11-03 18:42:21 -05:00
|
|
|
|
|
|
|
/* Managed by window-props.c */
|
|
|
|
MetaWindowPropHooks *prop_hooks;
|
2002-11-30 22:58:04 -05:00
|
|
|
|
|
|
|
/* Managed by group-props.c */
|
|
|
|
MetaGroupPropHooks *group_prop_hooks;
|
2003-11-20 21:32:05 -05:00
|
|
|
|
|
|
|
/* Managed by compositor.c */
|
|
|
|
MetaCompositor *compositor;
|
2002-10-26 23:03:32 -04:00
|
|
|
|
|
|
|
#ifdef HAVE_STARTUP_NOTIFICATION
|
|
|
|
SnDisplay *sn_display;
|
|
|
|
#endif
|
2002-12-09 22:23:04 -05:00
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
int xsync_event_base;
|
|
|
|
int xsync_error_base;
|
|
|
|
#endif
|
2003-01-05 02:51:02 -05:00
|
|
|
#ifdef HAVE_SHAPE
|
|
|
|
int shape_event_base;
|
|
|
|
int shape_error_base;
|
2004-08-26 22:17:49 -04:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_RENDER
|
|
|
|
int render_event_base;
|
|
|
|
int render_error_base;
|
|
|
|
#endif
|
Merge compositor branch.
2007-12-18 Iain Holmes <iain@gnome.org>
* configure.in, src/theme.c, src/display.c,
src/theme.h, src/display.h, src/theme-parser.c,
src/compositor.c, src/c-screen.c, src/compositor.h,
src/c-screen.h, src/ui.c, src/screen.c, src/ui.h,
src/screen.h, src/c-window.c, src/c-window.h,
src/theme-viewer.c, src/Makefile.am: Merge compositor branch.
svn path=/trunk/; revision=3483
2007-12-18 22:49:50 -05:00
|
|
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
|
|
|
int composite_event_base;
|
|
|
|
int composite_error_base;
|
2008-02-04 10:57:07 -05:00
|
|
|
int composite_major_version;
|
|
|
|
int composite_minor_version;
|
Merge compositor branch.
2007-12-18 Iain Holmes <iain@gnome.org>
* configure.in, src/theme.c, src/display.c,
src/theme.h, src/display.h, src/theme-parser.c,
src/compositor.c, src/c-screen.c, src/compositor.h,
src/c-screen.h, src/ui.c, src/screen.c, src/ui.h,
src/screen.h, src/c-window.c, src/c-window.h,
src/theme-viewer.c, src/Makefile.am: Merge compositor branch.
svn path=/trunk/; revision=3483
2007-12-18 22:49:50 -05:00
|
|
|
int damage_event_base;
|
|
|
|
int damage_error_base;
|
|
|
|
int xfixes_event_base;
|
|
|
|
int xfixes_error_base;
|
|
|
|
#endif
|
2004-08-26 22:17:49 -04:00
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
unsigned int have_xsync : 1;
|
|
|
|
#define META_DISPLAY_HAS_XSYNC(display) ((display)->have_xsync)
|
|
|
|
#else
|
|
|
|
#define META_DISPLAY_HAS_XSYNC(display) FALSE
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SHAPE
|
|
|
|
unsigned int have_shape : 1;
|
|
|
|
#define META_DISPLAY_HAS_SHAPE(display) ((display)->have_shape)
|
2003-01-05 02:51:02 -05:00
|
|
|
#else
|
|
|
|
#define META_DISPLAY_HAS_SHAPE(display) FALSE
|
|
|
|
#endif
|
2004-08-26 22:17:49 -04:00
|
|
|
#ifdef HAVE_RENDER
|
|
|
|
unsigned int have_render : 1;
|
|
|
|
#define META_DISPLAY_HAS_RENDER(display) ((display)->have_render)
|
|
|
|
#else
|
|
|
|
#define META_DISPLAY_HAS_RENDER(display) FALSE
|
|
|
|
#endif
|
Merge compositor branch.
2007-12-18 Iain Holmes <iain@gnome.org>
* configure.in, src/theme.c, src/display.c,
src/theme.h, src/display.h, src/theme-parser.c,
src/compositor.c, src/c-screen.c, src/compositor.h,
src/c-screen.h, src/ui.c, src/screen.c, src/ui.h,
src/screen.h, src/c-window.c, src/c-window.h,
src/theme-viewer.c, src/Makefile.am: Merge compositor branch.
svn path=/trunk/; revision=3483
2007-12-18 22:49:50 -05:00
|
|
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
|
|
|
unsigned int have_composite : 1;
|
|
|
|
unsigned int have_damage : 1;
|
|
|
|
unsigned int have_xfixes : 1;
|
|
|
|
#define META_DISPLAY_HAS_COMPOSITE(display) ((display)->have_composite)
|
|
|
|
#define META_DISPLAY_HAS_DAMAGE(display) ((display)->have_damage)
|
|
|
|
#define META_DISPLAY_HAS_XFIXES(display) ((display)->have_xfixes)
|
|
|
|
#else
|
|
|
|
#define META_DISPLAY_HAS_COMPOSITE(display) FALSE
|
|
|
|
#define META_DISPLAY_HAS_DAMAGE(display) FALSE
|
|
|
|
#define META_DISPLAY_HAS_XFIXES(display) FALSE
|
|
|
|
#endif
|
2001-05-30 11:36:31 -04:00
|
|
|
};
|
|
|
|
|
2008-12-02 17:58:07 -05:00
|
|
|
struct _MetaDisplayClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
2004-12-23 01:44:56 -05:00
|
|
|
/* Xserver time can wraparound, thus comparing two timestamps needs to take
|
|
|
|
* this into account. Here's a little macro to help out. If no wraparound
|
|
|
|
* has occurred, this is equivalent to
|
|
|
|
* time1 < time2
|
|
|
|
* Of course, the rest of the ugliness of this macro comes from accounting
|
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
|
|
|
* for the fact that wraparound can occur and the fact that a timestamp of
|
|
|
|
* 0 must be special-cased since it means older than anything else.
|
|
|
|
*
|
|
|
|
* Note that this is NOT an equivalent for time1 <= time2; if that's what
|
|
|
|
* you need then you'll need to swap the order of the arguments and negate
|
|
|
|
* the result.
|
2004-12-23 01:44:56 -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
|
|
|
#define XSERVER_TIME_IS_BEFORE_ASSUMING_REAL_TIMESTAMPS(time1, time2) \
|
2006-01-20 17:08:52 -05:00
|
|
|
( (( (time1) < (time2) ) && ( (time2) - (time1) < ((guint32)-1)/2 )) || \
|
|
|
|
(( (time1) > (time2) ) && ( (time1) - (time2) > ((guint32)-1)/2 )) \
|
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
|
|
|
)
|
|
|
|
#define XSERVER_TIME_IS_BEFORE(time1, time2) \
|
2006-01-20 17:08:52 -05:00
|
|
|
( (time1) == 0 || \
|
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
|
|
|
(XSERVER_TIME_IS_BEFORE_ASSUMING_REAL_TIMESTAMPS(time1, time2) && \
|
2006-01-20 17:08:52 -05:00
|
|
|
(time2) != 0) \
|
2004-12-23 01:44:56 -05:00
|
|
|
)
|
|
|
|
|
2006-05-04 13:32:26 -04:00
|
|
|
gboolean meta_display_open (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
|
|
|
void meta_display_close (MetaDisplay *display,
|
|
|
|
guint32 timestamp);
|
2001-05-31 23:00:01 -04:00
|
|
|
MetaScreen* meta_display_screen_for_x_screen (MetaDisplay *display,
|
|
|
|
Screen *screen);
|
2002-06-27 01:08:32 -04:00
|
|
|
MetaScreen* meta_display_screen_for_xwindow (MetaDisplay *display,
|
|
|
|
Window xindow);
|
2001-05-31 23:00:01 -04:00
|
|
|
void meta_display_grab (MetaDisplay *display);
|
|
|
|
void meta_display_ungrab (MetaDisplay *display);
|
|
|
|
|
2002-06-08 19:55:27 -04:00
|
|
|
void meta_display_unmanage_screen (MetaDisplay *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
|
|
|
MetaScreen *screen,
|
|
|
|
guint32 timestamp);
|
2002-06-08 19:55:27 -04:00
|
|
|
|
|
|
|
void meta_display_unmanage_windows_for_screen (MetaDisplay *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
|
|
|
MetaScreen *screen,
|
|
|
|
guint32 timestamp);
|
2002-06-08 19:55:27 -04:00
|
|
|
|
2007-04-16 00:57:32 -04:00
|
|
|
/* Utility function to compare the stacking of two windows */
|
|
|
|
int meta_display_stack_cmp (const void *a,
|
|
|
|
const void *b);
|
|
|
|
|
2001-05-31 02:42:58 -04:00
|
|
|
/* A given MetaWindow may have various X windows that "belong"
|
|
|
|
* to it, such as the frame window.
|
|
|
|
*/
|
|
|
|
MetaWindow* meta_display_lookup_x_window (MetaDisplay *display,
|
|
|
|
Window xwindow);
|
|
|
|
void meta_display_register_x_window (MetaDisplay *display,
|
|
|
|
Window *xwindowp,
|
|
|
|
MetaWindow *window);
|
|
|
|
void meta_display_unregister_x_window (MetaDisplay *display,
|
|
|
|
Window xwindow);
|
2005-12-28 01:24:30 -05:00
|
|
|
/* Return whether the xwindow is a no focus window for any of the screens */
|
|
|
|
gboolean meta_display_xwindow_is_a_no_focus_window (MetaDisplay *display,
|
|
|
|
Window xwindow);
|
2001-05-31 02:42:58 -04:00
|
|
|
|
2001-06-24 04:09:10 -04:00
|
|
|
GSList* meta_display_list_windows (MetaDisplay *display);
|
2001-05-30 11:36:31 -04:00
|
|
|
|
2001-05-30 23:30:58 -04:00
|
|
|
MetaDisplay* meta_display_for_x_display (Display *xdisplay);
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-24 23:39:13 -04:00
|
|
|
MetaDisplay* meta_get_display (void);
|
2001-05-30 11:36:31 -04:00
|
|
|
|
2001-07-25 23:14:45 -04:00
|
|
|
Cursor meta_display_create_x_cursor (MetaDisplay *display,
|
|
|
|
MetaCursor 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
|
|
|
void meta_display_set_grab_op_cursor (MetaDisplay *display,
|
2002-08-14 12:51:13 -04:00
|
|
|
MetaScreen *screen,
|
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
|
|
|
MetaGrabOp op,
|
|
|
|
gboolean change_pointer,
|
|
|
|
Window grab_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);
|
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
|
|
|
|
2001-07-11 02:22:00 -04:00
|
|
|
gboolean meta_display_begin_grab_op (MetaDisplay *display,
|
2002-06-27 01:08:32 -04:00
|
|
|
MetaScreen *screen,
|
2001-07-11 02:22:00 -04:00
|
|
|
MetaWindow *window,
|
|
|
|
MetaGrabOp op,
|
|
|
|
gboolean pointer_already_grabbed,
|
2006-10-12 20:28:34 -04:00
|
|
|
gboolean frame_action,
|
2001-07-11 02:22:00 -04:00
|
|
|
int button,
|
|
|
|
gulong modmask,
|
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-07-11 02:22:00 -04:00
|
|
|
int root_x,
|
|
|
|
int root_y);
|
|
|
|
void meta_display_end_grab_op (MetaDisplay *display,
|
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-07-11 02:22:00 -04:00
|
|
|
|
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
|
|
|
void meta_display_check_threshold_reached (MetaDisplay *display,
|
|
|
|
int x,
|
|
|
|
int y);
|
2001-07-25 23:14:45 -04:00
|
|
|
void meta_display_grab_window_buttons (MetaDisplay *display,
|
|
|
|
Window xwindow);
|
|
|
|
void meta_display_ungrab_window_buttons (MetaDisplay *display,
|
|
|
|
Window xwindow);
|
2001-07-11 02:22:00 -04:00
|
|
|
|
2001-12-10 23:03:58 -05:00
|
|
|
void meta_display_grab_focus_window_button (MetaDisplay *display,
|
2003-10-13 16:15:40 -04:00
|
|
|
MetaWindow *window);
|
2001-12-10 23:03:58 -05:00
|
|
|
void meta_display_ungrab_focus_window_button (MetaDisplay *display,
|
2003-10-13 16:15:40 -04:00
|
|
|
MetaWindow *window);
|
2001-12-10 02:48:21 -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
|
|
|
/* Next two functions are defined in edge-resistance.c */
|
|
|
|
void meta_display_compute_resistance_and_snapping_edges (MetaDisplay *display);
|
|
|
|
void meta_display_cleanup_edges (MetaDisplay *display);
|
|
|
|
|
2001-08-30 00:01:38 -04:00
|
|
|
/* make a request to ensure the event serial has changed */
|
|
|
|
void meta_display_increment_event_serial (MetaDisplay *display);
|
2001-06-06 00:47:37 -04:00
|
|
|
|
2001-10-07 19:06:19 -04:00
|
|
|
void meta_display_update_active_window_hint (MetaDisplay *display);
|
|
|
|
|
2002-01-05 22:15:49 -05:00
|
|
|
/* utility goo */
|
2002-03-02 10:26:07 -05:00
|
|
|
const char* meta_event_mode_to_string (int m);
|
|
|
|
const char* meta_event_detail_to_string (int d);
|
2002-01-05 22:15:49 -05:00
|
|
|
|
2002-02-06 22:25:34 -05:00
|
|
|
void meta_display_queue_retheme_all_windows (MetaDisplay *display);
|
|
|
|
void meta_display_retheme_all (void);
|
|
|
|
|
2005-07-11 09:25:08 -04:00
|
|
|
void meta_display_set_cursor_theme (const char *theme,
|
|
|
|
int size);
|
|
|
|
|
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
|
|
|
void meta_display_ping_window (MetaDisplay *display,
|
|
|
|
MetaWindow *window,
|
|
|
|
guint32 timestamp,
|
|
|
|
MetaWindowPingFunc ping_reply_func,
|
|
|
|
MetaWindowPingFunc ping_timeout_func,
|
|
|
|
void *user_data);
|
Screw around with Anders's ping patch so he'll get plenty of CVS
2002-02-26 Havoc Pennington <hp@pobox.com>
Screw around with Anders's ping patch so he'll get plenty of CVS
conflicts. ;-)
* src/display.c (meta_display_ping_window): spew warnings
if we try to call this with CurrentTime
(meta_display_ping_timeout): remove ping from the pending pings
after it times out.
* src/util.h: added PING debug category
* src/display.c (remove_pending_pings_for_window): don't remove
"tmp" just before "tmp->next", don't break out of loop after
finding the first match
(meta_display_open): no trailing comma in array init
(event_callback): move the processing of ping replies into a
separate function
* src/screen.c (set_supported_hint): add _NET_WM_PING to supported
list
* src/display.h: change gpointer to void*
2002-02-26 Anders Carlsson <andersca@gnu.org>
* src/display.c: (ping_data_free),
(remove_pending_pings_for_window), (meta_display_open),
(event_callback), (meta_display_unregister_x_window),
(meta_display_ping_timeout), (meta_display_ping_window),
(meta_display_window_has_pending_pings):
Implement meta_display_ping_window, and filter out scroll wheel
events.
* src/display.h:
Add MetaWindowPingFunc, meta_display_ping_window and
meta_display_window_has_pending_pings.
2002-02-26 21:05:39 -05:00
|
|
|
gboolean meta_display_window_has_pending_pings (MetaDisplay *display,
|
|
|
|
MetaWindow *window);
|
|
|
|
|
2002-04-05 10:52:49 -05:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_TAB_LIST_NORMAL,
|
2006-04-14 22:05:44 -04:00
|
|
|
META_TAB_LIST_DOCKS,
|
|
|
|
META_TAB_LIST_GROUP
|
2002-04-05 10:52:49 -05:00
|
|
|
} MetaTabList;
|
|
|
|
|
2006-01-10 00:05:40 -05:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_TAB_SHOW_ICON, /* Alt-Tab mode */
|
|
|
|
META_TAB_SHOW_INSTANTLY /* Alt-Esc mode */
|
|
|
|
} MetaTabShowType;
|
|
|
|
|
2003-03-14 21:16:21 -05:00
|
|
|
GList* meta_display_get_tab_list (MetaDisplay *display,
|
|
|
|
MetaTabList type,
|
|
|
|
MetaScreen *screen,
|
|
|
|
MetaWorkspace *workspace);
|
2002-03-11 23:34:17 -05:00
|
|
|
|
|
|
|
MetaWindow* meta_display_get_tab_next (MetaDisplay *display,
|
2002-04-05 10:52:49 -05:00
|
|
|
MetaTabList type,
|
2002-05-11 02:59:54 -04:00
|
|
|
MetaScreen *screen,
|
2002-03-11 23:34:17 -05:00
|
|
|
MetaWorkspace *workspace,
|
|
|
|
MetaWindow *window,
|
|
|
|
gboolean backward);
|
Screw around with Anders's ping patch so he'll get plenty of CVS
2002-02-26 Havoc Pennington <hp@pobox.com>
Screw around with Anders's ping patch so he'll get plenty of CVS
conflicts. ;-)
* src/display.c (meta_display_ping_window): spew warnings
if we try to call this with CurrentTime
(meta_display_ping_timeout): remove ping from the pending pings
after it times out.
* src/util.h: added PING debug category
* src/display.c (remove_pending_pings_for_window): don't remove
"tmp" just before "tmp->next", don't break out of loop after
finding the first match
(meta_display_open): no trailing comma in array init
(event_callback): move the processing of ping replies into a
separate function
* src/screen.c (set_supported_hint): add _NET_WM_PING to supported
list
* src/display.h: change gpointer to void*
2002-02-26 Anders Carlsson <andersca@gnu.org>
* src/display.c: (ping_data_free),
(remove_pending_pings_for_window), (meta_display_open),
(event_callback), (meta_display_unregister_x_window),
(meta_display_ping_timeout), (meta_display_ping_window),
(meta_display_window_has_pending_pings):
Implement meta_display_ping_window, and filter out scroll wheel
events.
* src/display.h:
Add MetaWindowPingFunc, meta_display_ping_window and
meta_display_window_has_pending_pings.
2002-02-26 21:05:39 -05:00
|
|
|
|
2002-09-04 00:15:46 -04:00
|
|
|
MetaWindow* meta_display_get_tab_current (MetaDisplay *display,
|
|
|
|
MetaTabList type,
|
|
|
|
MetaScreen *screen,
|
|
|
|
MetaWorkspace *workspace);
|
|
|
|
|
2002-03-17 12:22:23 -05:00
|
|
|
int meta_resize_gravity_from_grab_op (MetaGrabOp op);
|
|
|
|
|
2002-12-09 22:23:04 -05:00
|
|
|
gboolean meta_grab_op_is_moving (MetaGrabOp op);
|
|
|
|
gboolean meta_grab_op_is_resizing (MetaGrabOp op);
|
|
|
|
|
2002-10-07 19:14:40 -04:00
|
|
|
void meta_display_devirtualize_modifiers (MetaDisplay *display,
|
|
|
|
MetaVirtualModifier modifiers,
|
|
|
|
unsigned int *mask);
|
|
|
|
|
2003-05-30 16:24:00 -04:00
|
|
|
void meta_display_increment_focus_sentinel (MetaDisplay *display);
|
|
|
|
void meta_display_decrement_focus_sentinel (MetaDisplay *display);
|
|
|
|
gboolean meta_display_focus_sentinel_clear (MetaDisplay *display);
|
|
|
|
|
2004-12-23 01:44:56 -05:00
|
|
|
/* meta_display_set_input_focus_window is like XSetInputFocus, except
|
|
|
|
* that (a) it can't detect timestamps later than the current time,
|
|
|
|
* since Metacity isn't part of the XServer, and thus gives erroneous
|
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
|
|
|
* behavior in this circumstance (so don't do it), (b) it uses
|
|
|
|
* display->last_focus_time since we don't have access to the true
|
|
|
|
* Xserver one, (c) it makes use of display->user_time since checking
|
|
|
|
* whether a window should be allowed to be focused should depend
|
|
|
|
* on user_time events (see bug 167358, comment 15 in particular)
|
2004-12-23 01:44:56 -05:00
|
|
|
*/
|
|
|
|
void meta_display_set_input_focus_window (MetaDisplay *display,
|
|
|
|
MetaWindow *window,
|
|
|
|
gboolean focus_frame,
|
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-12-23 01:44:56 -05:00
|
|
|
|
|
|
|
/* meta_display_focus_the_no_focus_window is called when the
|
|
|
|
* designated no_focus_window should be focused, but is otherwise the
|
|
|
|
* same as meta_display_set_input_focus_window
|
|
|
|
*/
|
2004-10-04 17:09:08 -04:00
|
|
|
void meta_display_focus_the_no_focus_window (MetaDisplay *display,
|
2005-12-28 01:24:30 -05:00
|
|
|
MetaScreen *screen,
|
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-12-23 01:44:56 -05:00
|
|
|
|
2004-10-04 17:09:08 -04:00
|
|
|
void meta_display_queue_autoraise_callback (MetaDisplay *display,
|
|
|
|
MetaWindow *window);
|
|
|
|
void meta_display_remove_autoraise_callback (MetaDisplay *display);
|
|
|
|
|
2001-05-30 11:36:31 -04:00
|
|
|
#endif
|