2008-01-13 01:10:12 +00:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
2006-10-01 22:30:10 +00:00
|
|
|
|
2001-05-30 15:36:31 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2001 Havoc Pennington
|
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-19 00:45:24 +00:00
|
|
|
* Copyright (C) 2002, 2003, 2004 Red Hat, Inc.
|
2004-02-23 01:48:29 +00:00
|
|
|
* Copyright (C) 2003, 2004 Rob Adams
|
2006-01-10 19:43:21 +00:00
|
|
|
* Copyright (C) 2004-2006 Elijah Newren
|
2001-05-30 15:36:31 +00: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
|
2014-01-12 01:42:06 +00:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2001-05-30 15:36:31 +00:00
|
|
|
*/
|
|
|
|
|
2013-03-11 15:52:36 +00:00
|
|
|
/**
|
|
|
|
* SECTION:display
|
|
|
|
* @title: MetaDisplay
|
|
|
|
* @short_description: Mutter X display handler
|
2008-01-08 03:59:12 +00:00
|
|
|
*
|
2011-11-02 15:34:45 +00:00
|
|
|
* The display is represented as a #MetaDisplay struct.
|
2008-01-08 03:59:12 +00:00
|
|
|
*/
|
|
|
|
|
2010-06-07 17:09:46 +00:00
|
|
|
#define _XOPEN_SOURCE 600 /* for gethostname() */
|
|
|
|
|
2001-12-09 22:41:12 +00:00
|
|
|
#include <config.h>
|
2008-05-19 00:00:09 +00:00
|
|
|
#include "display-private.h"
|
2013-09-11 08:18:53 +00:00
|
|
|
#include "util-private.h"
|
2011-03-06 00:29:12 +00:00
|
|
|
#include <meta/main.h>
|
2008-05-19 00:00:09 +00:00
|
|
|
#include "screen-private.h"
|
|
|
|
#include "window-private.h"
|
2014-01-23 21:33:53 +00:00
|
|
|
#include "window-x11.h"
|
2002-11-03 23:42:21 +00:00
|
|
|
#include "window-props.h"
|
2002-12-01 03:58:04 +00:00
|
|
|
#include "group-props.h"
|
2011-03-06 00:29:12 +00:00
|
|
|
#include "frame.h"
|
|
|
|
#include <meta/errors.h>
|
2009-01-29 14:16:01 +00:00
|
|
|
#include "keybindings-private.h"
|
2011-03-06 00:29:12 +00:00
|
|
|
#include <meta/prefs.h>
|
2002-03-17 17:22:23 +00:00
|
|
|
#include "resizepopup.h"
|
2004-01-10 17:16:07 +00:00
|
|
|
#include "xprops.h"
|
2008-09-18 15:09:11 +00:00
|
|
|
#include "workspace-private.h"
|
2003-01-28 15:07:43 +00:00
|
|
|
#include "bell.h"
|
2011-03-06 00:29:12 +00:00
|
|
|
#include <meta/compositor.h>
|
2012-08-29 02:38:54 +00:00
|
|
|
#include <meta/compositor-mutter.h>
|
2001-06-10 03:17:15 +00:00
|
|
|
#include <X11/Xatom.h>
|
2012-02-10 15:27:14 +00:00
|
|
|
#include "mutter-enum-types.h"
|
2013-08-14 10:50:48 +00:00
|
|
|
#include "meta-idle-monitor-private.h"
|
2013-11-19 00:34:04 +00:00
|
|
|
#include "meta-cursor-tracker-private.h"
|
2012-02-10 15:27:14 +00:00
|
|
|
|
2003-01-03 19:06:53 +00:00
|
|
|
#ifdef HAVE_RANDR
|
|
|
|
#include <X11/extensions/Xrandr.h>
|
|
|
|
#endif
|
2003-01-05 07:51:02 +00:00
|
|
|
#ifdef HAVE_SHAPE
|
|
|
|
#include <X11/extensions/shape.h>
|
|
|
|
#endif
|
2003-01-28 15:07:43 +00:00
|
|
|
#ifdef HAVE_XKB
|
|
|
|
#include <X11/XKBlib.h>
|
|
|
|
#endif
|
2005-07-11 13:25:08 +00:00
|
|
|
#include <X11/Xcursor/Xcursor.h>
|
2009-05-07 21:56:27 +00:00
|
|
|
#include <X11/extensions/Xrender.h>
|
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-19 03:49:50 +00:00
|
|
|
#include <X11/extensions/Xcomposite.h>
|
|
|
|
#include <X11/extensions/Xdamage.h>
|
|
|
|
#include <X11/extensions/Xfixes.h>
|
2013-03-04 14:57:01 +00:00
|
|
|
#include <stdlib.h>
|
2001-06-10 03:17:15 +00:00
|
|
|
#include <string.h>
|
2010-06-07 16:32:56 +00:00
|
|
|
#include <unistd.h>
|
2001-05-30 15:36:31 +00:00
|
|
|
|
2013-08-12 13:31:18 +00:00
|
|
|
#include "meta-xwayland-private.h"
|
window-actor: Split into two subclasses of MetaSurfaceActor
The rendering logic before was somewhat complex. We had three independent
cases to take into account when doing rendering:
* X11 compositor. In this case, we're a traditional X11 compositor,
not a Wayland compositor. We use XCompositeNameWindowPixmap to get
the backing pixmap for the window, and deal with the COMPOSITE
extension messiness.
In this case, meta_is_wayland_compositor() is FALSE.
* Wayland clients. In this case, we're a Wayland compositor managing
Wayland surfaces. The rendering for this is fairly straightforward,
as Cogl handles most of the complexity with EGL and SHM buffers...
Wayland clients give us the input and opaque regions through
wl_surface.
In this case, meta_is_wayland_compositor() is TRUE and
priv->window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND.
* XWayland clients. In this case, we're a Wayland compositor, like
above, and XWayland hands us Wayland surfaces. XWayland handles
the COMPOSITE extension messiness for us, and hands us a buffer
like any other Wayland client. We have to fetch the input and
opaque regions from the X11 window ourselves.
In this case, meta_is_wayland_compositor() is TRUE and
priv->window->client_type == META_WINDOW_CLIENT_TYPE_X11.
We now split the rendering logic into two subclasses, which are:
* MetaSurfaceActorX11, which handles the X11 compositor case, in that
it uses XCompositeNameWindowPixmap to get the backing pixmap, and
deal with all the COMPOSITE extension messiness.
* MetaSurfaceActorWayland, which handles the Wayland compositor case
for both native Wayland clients and XWayland clients. XWayland handles
COMPOSITE for us, and handles pushing a surface over through the
xf86-video-wayland DDX.
Frame sync is still in MetaWindowActor, as it needs to work for both the
X11 compositor and XWayland client cases. When Wayland's video display
protocol lands, this will need to be significantly overhauled, as it would
have to work for any wl_surface, including subsurfaces, so we would need
surface-level discretion.
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-01 22:21:11 +00:00
|
|
|
#include "meta-surface-actor-wayland.h"
|
2013-08-12 13:31:18 +00:00
|
|
|
|
2005-01-24 05:58:30 +00:00
|
|
|
#define GRAB_OP_IS_WINDOW_SWITCH(g) \
|
|
|
|
(g == META_GRAB_OP_KEYBOARD_TABBING_NORMAL || \
|
|
|
|
g == META_GRAB_OP_KEYBOARD_TABBING_DOCK || \
|
2006-04-15 02:05:44 +00:00
|
|
|
g == META_GRAB_OP_KEYBOARD_TABBING_GROUP || \
|
2005-01-24 05:58:30 +00:00
|
|
|
g == META_GRAB_OP_KEYBOARD_ESCAPING_NORMAL || \
|
2006-04-15 02:05:44 +00:00
|
|
|
g == META_GRAB_OP_KEYBOARD_ESCAPING_DOCK || \
|
|
|
|
g == META_GRAB_OP_KEYBOARD_ESCAPING_GROUP)
|
2005-01-24 05:58:30 +00:00
|
|
|
|
2014-02-15 16:33:12 +00:00
|
|
|
/*
|
|
|
|
* SECTION:pings
|
|
|
|
*
|
|
|
|
* Sometimes we want to see whether a window is responding,
|
|
|
|
* so we send it a "ping" message and see whether it sends us back a "pong"
|
|
|
|
* message within a reasonable time. Here we have a system which lets us
|
|
|
|
* nominate one function to be called if we get the pong in time and another
|
|
|
|
* function if we don't. The system is rather more complicated than it needs
|
|
|
|
* to be, since we only ever use it to destroy windows which are asked to
|
|
|
|
* close themselves and don't do so within a reasonable amount of time, and
|
|
|
|
* therefore we always use the same callbacks. It's possible that we might
|
|
|
|
* use it for other things in future, or on the other hand we might decide
|
|
|
|
* that we're never going to do so and simplify it a bit.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MetaPingData:
|
|
|
|
*
|
|
|
|
* Describes a ping on a window. When we send a ping to a window, we build
|
|
|
|
* one of these structs, and it eventually gets passed to the timeout function
|
|
|
|
* or to the function which handles the response from the window. If the window
|
|
|
|
* does or doesn't respond to the ping, we use this information to deal with
|
|
|
|
* these facts; we have a handler function for each.
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
MetaWindow *window;
|
|
|
|
guint32 timestamp;
|
|
|
|
MetaWindowPingFunc ping_reply_func;
|
|
|
|
MetaWindowPingFunc ping_timeout_func;
|
|
|
|
void *user_data;
|
|
|
|
guint ping_timeout_id;
|
|
|
|
} MetaPingData;
|
|
|
|
|
2008-12-02 22:58:07 +00:00
|
|
|
G_DEFINE_TYPE(MetaDisplay, meta_display, G_TYPE_OBJECT);
|
|
|
|
|
2008-12-02 23:13:11 +00:00
|
|
|
/* Signals */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
OVERLAY_KEY,
|
2012-08-28 13:28:11 +00:00
|
|
|
ACCELERATOR_ACTIVATED,
|
2013-04-10 11:34:26 +00:00
|
|
|
MODIFIERS_ACCELERATOR_ACTIVATED,
|
2009-07-30 21:33:11 +00:00
|
|
|
FOCUS_WINDOW,
|
2009-10-13 14:34:34 +00:00
|
|
|
WINDOW_CREATED,
|
2009-10-28 17:19:24 +00:00
|
|
|
WINDOW_DEMANDS_ATTENTION,
|
2009-11-17 10:24:18 +00:00
|
|
|
WINDOW_MARKED_URGENT,
|
2012-02-10 15:27:14 +00:00
|
|
|
GRAB_OP_BEGIN,
|
|
|
|
GRAB_OP_END,
|
2008-12-02 23:13:11 +00:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2009-07-30 21:33:11 +00:00
|
|
|
enum {
|
|
|
|
PROP_0,
|
|
|
|
|
|
|
|
PROP_FOCUS_WINDOW
|
|
|
|
};
|
|
|
|
|
2008-12-02 23:13:11 +00:00
|
|
|
static guint display_signals [LAST_SIGNAL] = { 0 };
|
|
|
|
|
2011-11-02 15:34:45 +00:00
|
|
|
/*
|
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-25 03:39:13 +00:00
|
|
|
* The display we're managing. This is a singleton object. (Historically,
|
|
|
|
* this was a list of displays, but there was never any way to add more
|
|
|
|
* than one element to it.) The goofy name is because we don't want it
|
|
|
|
* to shadow the parameter in its object methods.
|
|
|
|
*/
|
|
|
|
static MetaDisplay *the_display = NULL;
|
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-27 02:05:39 +00:00
|
|
|
|
2011-10-20 14:22:35 +00:00
|
|
|
|
2012-11-05 13:55:15 +00:00
|
|
|
static const char *gnome_wm_keybindings = "Mutter";
|
2011-10-20 14:22:35 +00:00
|
|
|
static const char *net_wm_name = "Mutter";
|
|
|
|
|
2009-02-11 04:34:17 +00:00
|
|
|
#ifdef WITH_VERBOSE_MODE
|
2001-06-03 01:33:27 +00:00
|
|
|
static void meta_spew_event (MetaDisplay *display,
|
|
|
|
XEvent *event);
|
2009-02-11 04:34:17 +00:00
|
|
|
#endif
|
2003-06-26 03:09:38 +00:00
|
|
|
|
2013-10-03 19:29:44 +00:00
|
|
|
static gboolean xevent_callback (XEvent *event,
|
2001-06-03 01:33:27 +00:00
|
|
|
gpointer data);
|
2013-10-03 19:29:44 +00:00
|
|
|
static gboolean event_callback (const ClutterEvent *event,
|
|
|
|
gpointer data);
|
2001-06-03 01:33:27 +00:00
|
|
|
static Window event_get_modified_window (MetaDisplay *display,
|
|
|
|
XEvent *event);
|
2013-10-03 19:23:24 +00:00
|
|
|
static Window xievent_get_modified_window (MetaDisplay *display,
|
|
|
|
XIEvent *input_event);
|
2002-01-03 23:28:19 +00:00
|
|
|
static guint32 event_get_time (MetaDisplay *display,
|
|
|
|
XEvent *event);
|
2004-01-10 17:16:07 +00:00
|
|
|
static void process_request_frame_extents (MetaDisplay *display,
|
|
|
|
XEvent *event);
|
2002-06-08 23:55:27 +00:00
|
|
|
static void process_selection_request (MetaDisplay *display,
|
|
|
|
XEvent *event);
|
|
|
|
static void process_selection_clear (MetaDisplay *display,
|
|
|
|
XEvent *event);
|
2001-05-30 15:36:31 +00:00
|
|
|
|
2002-10-07 23:14:40 +00:00
|
|
|
static void update_window_grab_modifiers (MetaDisplay *display);
|
|
|
|
|
|
|
|
static void prefs_changed_callback (MetaPreference pref,
|
|
|
|
void *data);
|
2001-05-30 15:36:31 +00: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 17:14:16 +00:00
|
|
|
static void sanity_check_timestamps (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 16:32:33 +00:00
|
|
|
guint32 known_good_timestamp);
|
2011-11-02 15:34:45 +00:00
|
|
|
|
2006-04-15 02:05:44 +00:00
|
|
|
MetaGroup* get_focussed_group (MetaDisplay *display);
|
|
|
|
|
2009-07-30 21:33:11 +00:00
|
|
|
static void
|
|
|
|
meta_display_get_property(GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
MetaDisplay *display = META_DISPLAY (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_FOCUS_WINDOW:
|
|
|
|
g_value_set_object (value, display->focus_window);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_display_set_property(GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-02 22:58:07 +00:00
|
|
|
static void
|
|
|
|
meta_display_class_init (MetaDisplayClass *klass)
|
|
|
|
{
|
2009-07-30 21:33:11 +00:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
|
|
|
object_class->get_property = meta_display_get_property;
|
|
|
|
object_class->set_property = meta_display_set_property;
|
|
|
|
|
2008-12-02 23:13:11 +00:00
|
|
|
display_signals[OVERLAY_KEY] =
|
|
|
|
g_signal_new ("overlay-key",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
0,
|
2011-10-18 22:06:14 +00:00
|
|
|
NULL, NULL, NULL,
|
2009-07-30 21:33:11 +00:00
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2012-08-28 13:28:11 +00:00
|
|
|
display_signals[ACCELERATOR_ACTIVATED] =
|
|
|
|
g_signal_new ("accelerator-activated",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
0,
|
|
|
|
NULL, NULL, NULL,
|
2013-07-25 12:13:27 +00:00
|
|
|
G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
|
2012-08-28 13:28:11 +00:00
|
|
|
|
2013-04-10 11:34:26 +00:00
|
|
|
/**
|
|
|
|
* MetaDisplay::modifiers-accelerator-activated:
|
|
|
|
* @display: the #MetaDisplay instance
|
|
|
|
*
|
|
|
|
* The ::modifiers-accelerator-activated signal will be emitted when
|
|
|
|
* a special modifiers-only keybinding is activated.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE means that the keyboard device should remain
|
|
|
|
* frozen and %FALSE for the default behavior of unfreezing the
|
|
|
|
* keyboard.
|
|
|
|
*/
|
|
|
|
display_signals[MODIFIERS_ACCELERATOR_ACTIVATED] =
|
|
|
|
g_signal_new ("modifiers-accelerator-activated",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
0,
|
|
|
|
g_signal_accumulator_first_wins, NULL, NULL,
|
|
|
|
G_TYPE_BOOLEAN, 0);
|
|
|
|
|
2009-10-13 14:34:34 +00:00
|
|
|
display_signals[WINDOW_CREATED] =
|
|
|
|
g_signal_new ("window-created",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
0,
|
2011-10-18 22:06:14 +00:00
|
|
|
NULL, NULL, NULL,
|
2009-10-13 14:34:34 +00:00
|
|
|
G_TYPE_NONE, 1, META_TYPE_WINDOW);
|
|
|
|
|
2009-10-28 17:19:24 +00:00
|
|
|
display_signals[WINDOW_DEMANDS_ATTENTION] =
|
|
|
|
g_signal_new ("window-demands-attention",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
0,
|
2011-10-18 22:06:14 +00:00
|
|
|
NULL, NULL, NULL,
|
2009-10-28 17:19:24 +00:00
|
|
|
G_TYPE_NONE, 1, META_TYPE_WINDOW);
|
2009-10-13 14:34:34 +00:00
|
|
|
|
2009-11-17 10:24:18 +00:00
|
|
|
display_signals[WINDOW_MARKED_URGENT] =
|
|
|
|
g_signal_new ("window-marked-urgent",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
0,
|
2011-10-18 22:06:14 +00:00
|
|
|
NULL, NULL, NULL,
|
2009-11-17 10:24:18 +00:00
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
META_TYPE_WINDOW);
|
|
|
|
|
2012-02-10 15:27:14 +00:00
|
|
|
display_signals[GRAB_OP_BEGIN] =
|
|
|
|
g_signal_new ("grab-op-begin",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
0,
|
|
|
|
NULL, NULL, NULL,
|
|
|
|
G_TYPE_NONE, 3,
|
|
|
|
META_TYPE_SCREEN,
|
|
|
|
META_TYPE_WINDOW,
|
|
|
|
META_TYPE_GRAB_OP);
|
|
|
|
|
|
|
|
display_signals[GRAB_OP_END] =
|
|
|
|
g_signal_new ("grab-op-end",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
0,
|
|
|
|
NULL, NULL, NULL,
|
|
|
|
G_TYPE_NONE, 3,
|
|
|
|
META_TYPE_SCREEN,
|
|
|
|
META_TYPE_WINDOW,
|
|
|
|
META_TYPE_GRAB_OP);
|
|
|
|
|
2009-07-30 21:33:11 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_FOCUS_WINDOW,
|
|
|
|
g_param_spec_object ("focus-window",
|
|
|
|
"Focus window",
|
|
|
|
"Currently focused window",
|
|
|
|
META_TYPE_WINDOW,
|
|
|
|
G_PARAM_READABLE));
|
2008-12-02 22:58:07 +00:00
|
|
|
}
|
|
|
|
|
2014-02-15 16:33:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ping_data_free:
|
|
|
|
*
|
|
|
|
* Destructor for #MetaPingData structs. Will destroy the
|
|
|
|
* event source for the struct as well.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
ping_data_free (MetaPingData *ping_data)
|
|
|
|
{
|
|
|
|
/* Remove the timeout */
|
|
|
|
if (ping_data->ping_timeout_id != 0)
|
|
|
|
g_source_remove (ping_data->ping_timeout_id);
|
|
|
|
|
|
|
|
g_free (ping_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* remove_pending_pings_for_window:
|
|
|
|
* @display: The display the window appears on
|
|
|
|
* @xwindow: The X ID of the window whose pings we should remove
|
|
|
|
*
|
|
|
|
* Frees every pending ping structure for the given X window on the
|
|
|
|
* given display. This means that we also destroy the timeouts.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
remove_pending_pings_for_window (MetaDisplay *display, Window xwindow)
|
|
|
|
{
|
|
|
|
GSList *tmp;
|
|
|
|
GSList *dead;
|
|
|
|
|
|
|
|
/* could obviously be more efficient, don't care */
|
|
|
|
|
|
|
|
/* build list to be removed */
|
|
|
|
dead = NULL;
|
|
|
|
for (tmp = display->pending_pings; tmp; tmp = tmp->next)
|
|
|
|
{
|
|
|
|
MetaPingData *ping_data = tmp->data;
|
|
|
|
|
|
|
|
if (ping_data->window->xwindow == xwindow)
|
|
|
|
dead = g_slist_prepend (dead, ping_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* remove what we found */
|
|
|
|
for (tmp = dead; tmp; tmp = tmp->next)
|
|
|
|
{
|
|
|
|
MetaPingData *ping_data = tmp->data;
|
|
|
|
|
|
|
|
display->pending_pings = g_slist_remove (display->pending_pings, ping_data);
|
|
|
|
ping_data_free (ping_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_slist_free (dead);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-10-26 01:49:03 +00:00
|
|
|
#ifdef HAVE_STARTUP_NOTIFICATION
|
2002-10-25 23:35:50 +00:00
|
|
|
static void
|
|
|
|
sn_error_trap_push (SnDisplay *sn_display,
|
|
|
|
Display *xdisplay)
|
|
|
|
{
|
|
|
|
MetaDisplay *display;
|
|
|
|
display = meta_display_for_x_display (xdisplay);
|
|
|
|
if (display != NULL)
|
|
|
|
meta_error_trap_push (display);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
sn_error_trap_pop (SnDisplay *sn_display,
|
|
|
|
Display *xdisplay)
|
|
|
|
{
|
|
|
|
MetaDisplay *display;
|
|
|
|
display = meta_display_for_x_display (xdisplay);
|
|
|
|
if (display != NULL)
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop (display);
|
2002-10-25 23:35:50 +00:00
|
|
|
}
|
2002-10-26 01:49:03 +00:00
|
|
|
#endif
|
2002-10-25 23:35:50 +00:00
|
|
|
|
2006-02-16 20:26:05 +00:00
|
|
|
static void
|
2013-02-07 11:48:12 +00:00
|
|
|
enable_compositor (MetaDisplay *display)
|
2006-02-16 20:26:05 +00:00
|
|
|
{
|
|
|
|
GSList *list;
|
|
|
|
|
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-19 03:49:50 +00:00
|
|
|
if (!META_DISPLAY_HAS_COMPOSITE (display) ||
|
|
|
|
!META_DISPLAY_HAS_DAMAGE (display) ||
|
|
|
|
!META_DISPLAY_HAS_RENDER (display))
|
|
|
|
{
|
2013-09-11 08:37:36 +00:00
|
|
|
meta_warning ("Missing %s extension required for compositing",
|
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-19 03:49:50 +00:00
|
|
|
!META_DISPLAY_HAS_COMPOSITE (display) ? "composite" :
|
2012-07-30 19:02:56 +00:00
|
|
|
!META_DISPLAY_HAS_DAMAGE (display) ? "damage" : "render");
|
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-19 03:49:50 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-02-16 20:26:05 +00:00
|
|
|
if (!display->compositor)
|
|
|
|
display->compositor = meta_compositor_new (display);
|
|
|
|
|
|
|
|
if (!display->compositor)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (list = display->screens; list != NULL; list = list->next)
|
|
|
|
{
|
|
|
|
MetaScreen *screen = list->data;
|
|
|
|
|
|
|
|
meta_compositor_manage_screen (screen->display->compositor,
|
|
|
|
screen);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-02 22:58:07 +00:00
|
|
|
static void
|
|
|
|
meta_display_init (MetaDisplay *disp)
|
|
|
|
{
|
|
|
|
/* Some stuff could go in here that's currently in _open,
|
|
|
|
* but it doesn't really matter. */
|
|
|
|
}
|
|
|
|
|
2011-10-20 14:22:35 +00:00
|
|
|
/**
|
|
|
|
* meta_set_wm_name: (skip)
|
|
|
|
* @wm_name: value for _NET_WM_NAME
|
|
|
|
*
|
|
|
|
* Set the value to use for the _NET_WM_NAME property. To take effect,
|
|
|
|
* it is necessary to call this function before meta_init().
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
meta_set_wm_name (const char *wm_name)
|
|
|
|
{
|
|
|
|
g_return_if_fail (the_display == NULL);
|
|
|
|
|
|
|
|
net_wm_name = wm_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* meta_set_gnome_wm_keybindings: (skip)
|
|
|
|
* @wm_keybindings: value for _GNOME_WM_KEYBINDINGS
|
|
|
|
*
|
|
|
|
* Set the value to use for the _GNOME_WM_KEYBINDINGS property. To take
|
|
|
|
* effect, it is necessary to call this function before meta_init().
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
meta_set_gnome_wm_keybindings (const char *wm_keybindings)
|
|
|
|
{
|
|
|
|
g_return_if_fail (the_display == NULL);
|
|
|
|
|
|
|
|
gnome_wm_keybindings = wm_keybindings;
|
|
|
|
}
|
|
|
|
|
2008-01-13 01:01:21 +00:00
|
|
|
/**
|
2011-11-02 15:34:45 +00:00
|
|
|
* meta_display_open:
|
|
|
|
*
|
2008-01-13 01:01:21 +00:00
|
|
|
* Opens a new display, sets it up, initialises all the X extensions
|
2008-01-08 03:59:12 +00:00
|
|
|
* we will need, and adds it to the list of displays.
|
|
|
|
*
|
2011-11-02 15:34:45 +00:00
|
|
|
* Returns: %TRUE if the display was opened successfully, and %FALSE
|
2008-01-08 03:59:12 +00:00
|
|
|
* otherwise-- that is, if the display doesn't exist or it already
|
|
|
|
* has a window manager.
|
|
|
|
*/
|
2001-05-30 15:36:31 +00:00
|
|
|
gboolean
|
2006-05-04 17:32:26 +00:00
|
|
|
meta_display_open (void)
|
2001-05-30 15:36:31 +00:00
|
|
|
{
|
|
|
|
Display *xdisplay;
|
2001-05-31 03:30:58 +00:00
|
|
|
GSList *screens;
|
2012-09-10 18:19:21 +00:00
|
|
|
MetaScreen *screen;
|
2002-03-02 15:26:07 +00:00
|
|
|
int i;
|
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 16:32:33 +00:00
|
|
|
guint32 timestamp;
|
2008-05-02 18:49:01 +00:00
|
|
|
|
|
|
|
/* A list of all atom names, so that we can intern them in one go. */
|
2001-06-04 06:17:52 +00:00
|
|
|
char *atom_names[] = {
|
2008-05-02 18:49:01 +00:00
|
|
|
#define item(x) #x,
|
2011-03-06 00:29:12 +00:00
|
|
|
#include <meta/atomnames.h>
|
2008-05-02 18:49:01 +00:00
|
|
|
#undef item
|
2001-06-04 06:17:52 +00:00
|
|
|
};
|
2001-06-02 04:14:18 +00:00
|
|
|
Atom atoms[G_N_ELEMENTS(atom_names)];
|
|
|
|
|
2006-05-04 17:32:26 +00:00
|
|
|
meta_verbose ("Opening display '%s'\n", XDisplayName (NULL));
|
2001-05-30 15:36:31 +00:00
|
|
|
|
2006-05-04 17:32:26 +00:00
|
|
|
xdisplay = meta_ui_get_display ();
|
2001-06-20 03:01:26 +00:00
|
|
|
|
2001-05-30 15:36:31 +00:00
|
|
|
if (xdisplay == NULL)
|
|
|
|
{
|
|
|
|
meta_warning (_("Failed to open X Window System display '%s'\n"),
|
2006-05-04 17:32:26 +00:00
|
|
|
XDisplayName (NULL));
|
2001-05-30 15:36:31 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2013-08-12 13:31:18 +00:00
|
|
|
if (meta_is_wayland_compositor ())
|
|
|
|
meta_xwayland_complete_init ();
|
|
|
|
|
2001-05-31 06:42:58 +00:00
|
|
|
if (meta_is_syncing ())
|
|
|
|
XSynchronize (xdisplay, True);
|
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
g_assert (the_display == NULL);
|
2008-12-02 22:58:07 +00:00
|
|
|
the_display = g_object_new (META_TYPE_DISPLAY, NULL);
|
2001-06-03 01:33:27 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->closing = 0;
|
2002-06-22 05:11:04 +00:00
|
|
|
|
2001-06-03 01:33:27 +00:00
|
|
|
/* here we use XDisplayName which is what the user
|
|
|
|
* probably put in, vs. DisplayString(display) which is
|
|
|
|
* canonicalized by XOpenDisplay()
|
|
|
|
*/
|
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-25 03:39:13 +00:00
|
|
|
the_display->name = g_strdup (XDisplayName (NULL));
|
|
|
|
the_display->xdisplay = xdisplay;
|
|
|
|
the_display->error_trap_synced_at_last_pop = TRUE;
|
|
|
|
the_display->error_traps = 0;
|
|
|
|
the_display->error_trap_handler = NULL;
|
|
|
|
the_display->server_grab_count = 0;
|
|
|
|
the_display->display_opening = TRUE;
|
|
|
|
|
2014-02-15 16:33:12 +00:00
|
|
|
the_display->pending_pings = NULL;
|
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-25 03:39:13 +00:00
|
|
|
the_display->autoraise_timeout_id = 0;
|
|
|
|
the_display->autoraise_window = NULL;
|
|
|
|
the_display->focus_window = NULL;
|
2011-04-26 12:12:04 +00:00
|
|
|
the_display->focus_serial = 0;
|
|
|
|
the_display->server_focus_window = None;
|
|
|
|
the_display->server_focus_serial = 0;
|
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-25 03:39:13 +00:00
|
|
|
the_display->grab_old_window_stacking = NULL;
|
|
|
|
|
|
|
|
the_display->mouse_mode = TRUE; /* Only relevant for mouse or sloppy focus */
|
|
|
|
the_display->allow_terminal_deactivation = TRUE; /* Only relevant for when a
|
2006-01-15 17:03:57 +00:00
|
|
|
terminal has the focus */
|
2005-02-22 02:11:25 +00:00
|
|
|
|
2002-01-19 23:59:11 +00:00
|
|
|
/* FIXME copy the checks from GDK probably */
|
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 10:29:20 +00:00
|
|
|
the_display->static_gravity_works = g_getenv ("MUTTER_USE_STATIC_GRAVITY") != NULL;
|
2001-06-06 04:47:37 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
meta_bell_init (the_display);
|
2003-01-28 15:07:43 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
meta_display_init_keys (the_display);
|
2001-06-09 05:14:43 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
update_window_grab_modifiers (the_display);
|
2002-10-07 23:14:40 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
meta_prefs_add_listener (prefs_changed_callback, the_display);
|
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-19 03:49:50 +00:00
|
|
|
|
2007-12-19 21:38:15 +00:00
|
|
|
meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names));
|
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-25 03:39:13 +00:00
|
|
|
XInternAtoms (the_display->xdisplay, atom_names, G_N_ELEMENTS (atom_names),
|
2001-06-09 05:14:43 +00:00
|
|
|
False, atoms);
|
2008-05-02 18:49:01 +00:00
|
|
|
{
|
|
|
|
int i = 0;
|
|
|
|
#define item(x) the_display->atom_##x = atoms[i++];
|
2011-03-06 00:29:12 +00:00
|
|
|
#include <meta/atomnames.h>
|
2008-05-02 18:49:01 +00:00
|
|
|
#undef item
|
|
|
|
}
|
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-25 03:39:13 +00:00
|
|
|
|
|
|
|
the_display->prop_hooks = NULL;
|
|
|
|
meta_display_init_window_prop_hooks (the_display);
|
|
|
|
the_display->group_prop_hooks = NULL;
|
|
|
|
meta_display_init_group_prop_hooks (the_display);
|
2002-04-28 15:47:21 +00:00
|
|
|
|
2001-06-10 19:23:28 +00:00
|
|
|
/* Offscreen unmapped window used for _NET_SUPPORTING_WM_CHECK,
|
|
|
|
* created in screen_new
|
|
|
|
*/
|
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-25 03:39:13 +00:00
|
|
|
the_display->leader_window = None;
|
|
|
|
the_display->timestamp_pinging_window = None;
|
2002-06-07 03:18:46 +00:00
|
|
|
|
2009-08-31 13:52:16 +00:00
|
|
|
the_display->monitor_cache_invalidated = TRUE;
|
2002-08-12 21:32:13 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->groups_by_leader = NULL;
|
2002-05-08 16:24:28 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->window_with_menu = NULL;
|
|
|
|
the_display->window_menu = NULL;
|
2002-10-28 05:35:30 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->screens = NULL;
|
|
|
|
the_display->active_screen = NULL;
|
2002-10-28 05:35:30 +00:00
|
|
|
|
2002-10-25 23:35:50 +00:00
|
|
|
#ifdef HAVE_STARTUP_NOTIFICATION
|
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-25 03:39:13 +00:00
|
|
|
the_display->sn_display = sn_display_new (the_display->xdisplay,
|
2002-10-25 23:35:50 +00:00
|
|
|
sn_error_trap_push,
|
|
|
|
sn_error_trap_pop);
|
|
|
|
#endif
|
2001-06-20 03:01:26 +00:00
|
|
|
|
|
|
|
/* Get events */
|
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-25 03:39:13 +00:00
|
|
|
meta_ui_add_event_func (the_display->xdisplay,
|
2013-10-03 19:29:44 +00:00
|
|
|
xevent_callback,
|
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-25 03:39:13 +00:00
|
|
|
the_display);
|
2013-11-14 17:58:52 +00:00
|
|
|
the_display->clutter_event_filter = clutter_event_add_filter (NULL,
|
|
|
|
event_callback,
|
|
|
|
NULL,
|
|
|
|
the_display);
|
|
|
|
|
2013-02-06 22:02:59 +00:00
|
|
|
the_display->xids = g_hash_table_new (meta_unsigned_long_hash,
|
|
|
|
meta_unsigned_long_equal);
|
2013-09-16 09:24:01 +00:00
|
|
|
the_display->wayland_windows = g_hash_table_new (NULL, NULL);
|
2012-07-30 18:57:53 +00:00
|
|
|
|
2002-03-02 15:26:07 +00:00
|
|
|
i = 0;
|
2011-09-12 13:50:30 +00:00
|
|
|
while (i < N_IGNORED_CROSSING_SERIALS)
|
2002-03-02 15:26:07 +00:00
|
|
|
{
|
2011-09-12 13:50:30 +00:00
|
|
|
the_display->ignored_crossing_serials[i] = 0;
|
2002-03-02 15:26:07 +00:00
|
|
|
++i;
|
|
|
|
}
|
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-25 03:39:13 +00:00
|
|
|
the_display->ungrab_should_not_cause_focus_window = None;
|
2002-03-02 15:26:07 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->current_time = CurrentTime;
|
|
|
|
the_display->sentinel_counter = 0;
|
2004-09-22 18:57:36 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->grab_resize_timeout_id = 0;
|
|
|
|
the_display->grab_have_keyboard = FALSE;
|
2001-08-30 04:01:38 +00:00
|
|
|
|
2006-09-10 04:29:14 +00:00
|
|
|
#ifdef HAVE_XKB
|
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-25 03:39:13 +00:00
|
|
|
the_display->last_bell_time = 0;
|
2006-09-10 04:29:14 +00:00
|
|
|
#endif
|
2006-01-20 22:08:52 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->grab_op = META_GRAB_OP_NONE;
|
|
|
|
the_display->grab_window = NULL;
|
|
|
|
the_display->grab_screen = NULL;
|
|
|
|
the_display->grab_resize_popup = NULL;
|
2011-01-19 16:00:18 +00:00
|
|
|
the_display->grab_tile_mode = META_TILE_NONE;
|
2011-10-08 15:00:16 +00:00
|
|
|
the_display->grab_tile_monitor_number = -1;
|
2002-10-07 23:14:40 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->grab_edge_resistance_data = NULL;
|
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 14:58:50 +00:00
|
|
|
|
2002-12-10 03:23:04 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
{
|
|
|
|
int major, minor;
|
2004-08-27 02:17:49 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->have_xsync = FALSE;
|
2002-12-10 03:23:04 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->xsync_error_base = 0;
|
|
|
|
the_display->xsync_event_base = 0;
|
2002-12-10 03:23:04 +00:00
|
|
|
|
|
|
|
/* I don't think we really have to fill these in */
|
|
|
|
major = SYNC_MAJOR_VERSION;
|
|
|
|
minor = SYNC_MINOR_VERSION;
|
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
if (!XSyncQueryExtension (the_display->xdisplay,
|
|
|
|
&the_display->xsync_event_base,
|
|
|
|
&the_display->xsync_error_base) ||
|
|
|
|
!XSyncInitialize (the_display->xdisplay,
|
2002-12-10 03:23:04 +00:00
|
|
|
&major, &minor))
|
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
the_display->xsync_error_base = 0;
|
|
|
|
the_display->xsync_event_base = 0;
|
2002-12-10 03:23:04 +00:00
|
|
|
}
|
2004-08-27 02:17:49 +00:00
|
|
|
else
|
2012-11-12 18:43:28 +00:00
|
|
|
{
|
|
|
|
the_display->have_xsync = TRUE;
|
|
|
|
XSyncSetPriority (the_display->xdisplay, None, 10);
|
|
|
|
}
|
|
|
|
|
2002-12-10 03:23:04 +00:00
|
|
|
meta_verbose ("Attempted to init Xsync, found version %d.%d error base %d event base %d\n",
|
|
|
|
major, minor,
|
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-25 03:39:13 +00:00
|
|
|
the_display->xsync_error_base,
|
|
|
|
the_display->xsync_event_base);
|
2002-12-10 03:23:04 +00:00
|
|
|
}
|
|
|
|
#else /* HAVE_XSYNC */
|
|
|
|
meta_verbose ("Not compiled with Xsync support\n");
|
|
|
|
#endif /* !HAVE_XSYNC */
|
2003-01-05 07:51:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SHAPE
|
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
the_display->have_shape = FALSE;
|
2004-08-27 02:17:49 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->shape_error_base = 0;
|
|
|
|
the_display->shape_event_base = 0;
|
2003-01-05 07:51:02 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
if (!XShapeQueryExtension (the_display->xdisplay,
|
|
|
|
&the_display->shape_event_base,
|
|
|
|
&the_display->shape_error_base))
|
2003-01-05 07:51:02 +00:00
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
the_display->shape_error_base = 0;
|
|
|
|
the_display->shape_event_base = 0;
|
2003-01-05 07:51:02 +00:00
|
|
|
}
|
2004-08-27 02:17:49 +00:00
|
|
|
else
|
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-25 03:39:13 +00:00
|
|
|
the_display->have_shape = TRUE;
|
2004-08-27 02:17:49 +00:00
|
|
|
|
2003-01-05 07:51:02 +00:00
|
|
|
meta_verbose ("Attempted to init Shape, found error base %d event base %d\n",
|
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-25 03:39:13 +00:00
|
|
|
the_display->shape_error_base,
|
|
|
|
the_display->shape_event_base);
|
2003-01-05 07:51:02 +00:00
|
|
|
}
|
|
|
|
#else /* HAVE_SHAPE */
|
|
|
|
meta_verbose ("Not compiled with Shape support\n");
|
|
|
|
#endif /* !HAVE_SHAPE */
|
2003-11-21 02:32:05 +00:00
|
|
|
|
2004-08-27 02:17:49 +00:00
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
the_display->have_render = FALSE;
|
2004-08-27 02:17:49 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->render_error_base = 0;
|
|
|
|
the_display->render_event_base = 0;
|
2004-08-27 02:17:49 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
if (!XRenderQueryExtension (the_display->xdisplay,
|
|
|
|
&the_display->render_event_base,
|
|
|
|
&the_display->render_error_base))
|
2004-08-27 02:17:49 +00:00
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
the_display->render_error_base = 0;
|
|
|
|
the_display->render_event_base = 0;
|
2004-08-27 02:17:49 +00:00
|
|
|
}
|
|
|
|
else
|
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-25 03:39:13 +00:00
|
|
|
the_display->have_render = TRUE;
|
2004-08-27 02:17:49 +00:00
|
|
|
|
|
|
|
meta_verbose ("Attempted to init Render, found error base %d event base %d\n",
|
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-25 03:39:13 +00:00
|
|
|
the_display->render_error_base,
|
|
|
|
the_display->render_event_base);
|
2004-08-27 02:17:49 +00:00
|
|
|
}
|
2005-07-11 13:25:08 +00:00
|
|
|
|
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-19 03:49:50 +00:00
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
the_display->have_composite = FALSE;
|
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-19 03:49:50 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->composite_error_base = 0;
|
|
|
|
the_display->composite_event_base = 0;
|
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-19 03:49:50 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
if (!XCompositeQueryExtension (the_display->xdisplay,
|
|
|
|
&the_display->composite_event_base,
|
|
|
|
&the_display->composite_error_base))
|
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-19 03:49:50 +00:00
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
the_display->composite_error_base = 0;
|
|
|
|
the_display->composite_event_base = 0;
|
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-19 03:49:50 +00:00
|
|
|
}
|
|
|
|
else
|
2008-02-04 15:57:07 +00:00
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
the_display->composite_major_version = 0;
|
|
|
|
the_display->composite_minor_version = 0;
|
|
|
|
if (XCompositeQueryVersion (the_display->xdisplay,
|
|
|
|
&the_display->composite_major_version,
|
|
|
|
&the_display->composite_minor_version))
|
2008-02-04 15:57:07 +00:00
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
the_display->have_composite = TRUE;
|
2008-02-04 15:57:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
the_display->composite_major_version = 0;
|
|
|
|
the_display->composite_minor_version = 0;
|
2008-02-04 15:57:07 +00:00
|
|
|
}
|
|
|
|
}
|
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-19 03:49:50 +00:00
|
|
|
|
2008-02-04 15:57:07 +00:00
|
|
|
meta_verbose ("Attempted to init Composite, found error base %d event base %d "
|
|
|
|
"extn ver %d %d\n",
|
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-25 03:39:13 +00:00
|
|
|
the_display->composite_error_base,
|
|
|
|
the_display->composite_event_base,
|
|
|
|
the_display->composite_major_version,
|
|
|
|
the_display->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-19 03:49:50 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->have_damage = FALSE;
|
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-19 03:49:50 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->damage_error_base = 0;
|
|
|
|
the_display->damage_event_base = 0;
|
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-19 03:49:50 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
if (!XDamageQueryExtension (the_display->xdisplay,
|
|
|
|
&the_display->damage_event_base,
|
|
|
|
&the_display->damage_error_base))
|
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-19 03:49:50 +00:00
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
the_display->damage_error_base = 0;
|
|
|
|
the_display->damage_event_base = 0;
|
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-19 03:49:50 +00:00
|
|
|
}
|
|
|
|
else
|
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-25 03:39:13 +00:00
|
|
|
the_display->have_damage = TRUE;
|
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-19 03:49:50 +00:00
|
|
|
|
|
|
|
meta_verbose ("Attempted to init Damage, found error base %d event base %d\n",
|
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-25 03:39:13 +00:00
|
|
|
the_display->damage_error_base,
|
|
|
|
the_display->damage_event_base);
|
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-19 03:49:50 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->xfixes_error_base = 0;
|
|
|
|
the_display->xfixes_event_base = 0;
|
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-19 03:49:50 +00:00
|
|
|
|
2012-07-30 19:02:56 +00:00
|
|
|
if (XFixesQueryExtension (the_display->xdisplay,
|
|
|
|
&the_display->xfixes_event_base,
|
|
|
|
&the_display->xfixes_error_base))
|
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-19 03:49:50 +00:00
|
|
|
{
|
2012-07-30 19:02:56 +00:00
|
|
|
int xfixes_major, xfixes_minor;
|
|
|
|
|
|
|
|
XFixesQueryVersion (the_display->xdisplay, &xfixes_major, &xfixes_minor);
|
|
|
|
|
|
|
|
if (xfixes_major * 100 + xfixes_minor < 500)
|
|
|
|
meta_fatal ("Mutter requires XFixes 5.0");
|
|
|
|
}
|
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-19 03:49:50 +00:00
|
|
|
else
|
2012-07-30 19:02:56 +00:00
|
|
|
{
|
|
|
|
meta_fatal ("Mutter requires XFixes 5.0");
|
|
|
|
}
|
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-19 03:49:50 +00:00
|
|
|
|
|
|
|
meta_verbose ("Attempted to init XFixes, found error base %d event base %d\n",
|
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-25 03:39:13 +00:00
|
|
|
the_display->xfixes_error_base,
|
|
|
|
the_display->xfixes_event_base);
|
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-19 03:49:50 +00:00
|
|
|
}
|
2012-11-15 20:57:08 +00:00
|
|
|
|
|
|
|
{
|
2013-01-30 13:51:18 +00:00
|
|
|
int major = 2, minor = 3;
|
2012-11-15 20:57:08 +00:00
|
|
|
gboolean has_xi = FALSE;
|
|
|
|
|
|
|
|
if (XQueryExtension (the_display->xdisplay,
|
|
|
|
"XInputExtension",
|
|
|
|
&the_display->xinput_opcode,
|
|
|
|
&the_display->xinput_error_base,
|
|
|
|
&the_display->xinput_event_base))
|
|
|
|
{
|
|
|
|
if (XIQueryVersion (the_display->xdisplay, &major, &minor) == Success)
|
2012-07-30 18:57:53 +00:00
|
|
|
{
|
|
|
|
int version = (major * 10) + minor;
|
|
|
|
if (version >= 22)
|
|
|
|
has_xi = TRUE;
|
|
|
|
|
|
|
|
#ifdef HAVE_XI23
|
|
|
|
if (version >= 23)
|
|
|
|
the_display->have_xinput_23 = TRUE;
|
|
|
|
#endif /* HAVE_XI23 */
|
|
|
|
}
|
2012-11-15 20:57:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!has_xi)
|
|
|
|
meta_fatal ("X server doesn't have the XInput extension, version 2.2 or newer\n");
|
|
|
|
}
|
|
|
|
|
2005-07-11 13:25:08 +00:00
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
XcursorSetTheme (the_display->xdisplay, meta_prefs_get_cursor_theme ());
|
|
|
|
XcursorSetDefaultSize (the_display->xdisplay, meta_prefs_get_cursor_size ());
|
2005-07-11 13:25:08 +00:00
|
|
|
}
|
|
|
|
|
2003-11-24 17:47:48 +00:00
|
|
|
/* Create the leader window here. Set its properties and
|
|
|
|
* use the timestamp from one of the PropertyNotify events
|
|
|
|
* that will follow.
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
gulong data[1];
|
|
|
|
XEvent event;
|
|
|
|
|
2007-03-31 23:34:36 +00:00
|
|
|
/* We only care about the PropertyChangeMask in the next 30 or so lines of
|
|
|
|
* code. Note that gdk will at some point unset the PropertyChangeMask for
|
|
|
|
* this window, so we can't rely on it still being set later. See bug
|
|
|
|
* 354213 for details.
|
|
|
|
*/
|
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-25 03:39:13 +00:00
|
|
|
the_display->leader_window =
|
|
|
|
meta_create_offscreen_window (the_display->xdisplay,
|
|
|
|
DefaultRootWindow (the_display->xdisplay),
|
2007-03-31 23:34:36 +00:00
|
|
|
PropertyChangeMask);
|
2003-11-24 17:47:48 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
meta_prop_set_utf8_string_hint (the_display,
|
|
|
|
the_display->leader_window,
|
2008-05-02 18:49:01 +00:00
|
|
|
the_display->atom__NET_WM_NAME,
|
2011-10-20 14:22:35 +00:00
|
|
|
net_wm_name);
|
2009-09-03 18:43:49 +00:00
|
|
|
|
|
|
|
meta_prop_set_utf8_string_hint (the_display,
|
|
|
|
the_display->leader_window,
|
|
|
|
the_display->atom__GNOME_WM_KEYBINDINGS,
|
2011-10-20 14:22:35 +00:00
|
|
|
gnome_wm_keybindings);
|
2003-11-24 17:47:48 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
meta_prop_set_utf8_string_hint (the_display,
|
|
|
|
the_display->leader_window,
|
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 10:29:20 +00:00
|
|
|
the_display->atom__MUTTER_VERSION,
|
2005-10-03 18:13:45 +00:00
|
|
|
VERSION);
|
2005-02-07 04:37:35 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
data[0] = the_display->leader_window;
|
|
|
|
XChangeProperty (the_display->xdisplay,
|
|
|
|
the_display->leader_window,
|
2008-05-02 18:49:01 +00:00
|
|
|
the_display->atom__NET_SUPPORTING_WM_CHECK,
|
2003-11-24 17:47:48 +00:00
|
|
|
XA_WINDOW,
|
|
|
|
32, PropModeReplace, (guchar*) data, 1);
|
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
XWindowEvent (the_display->xdisplay,
|
|
|
|
the_display->leader_window,
|
2003-11-24 17:47:48 +00:00
|
|
|
PropertyChangeMask,
|
|
|
|
&event);
|
|
|
|
|
|
|
|
timestamp = event.xproperty.time;
|
2007-03-31 23:34:36 +00:00
|
|
|
|
|
|
|
/* Make it painfully clear that we can't rely on PropertyNotify events on
|
|
|
|
* this window, as per bug 354213.
|
|
|
|
*/
|
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-25 03:39:13 +00:00
|
|
|
XSelectInput(the_display->xdisplay,
|
|
|
|
the_display->leader_window,
|
2007-03-31 23:34:36 +00:00
|
|
|
NoEventMask);
|
2003-11-24 17:47:48 +00:00
|
|
|
}
|
|
|
|
|
2007-03-31 05:19:41 +00:00
|
|
|
/* Make a little window used only for pinging the server for timestamps; note
|
|
|
|
* that meta_create_offscreen_window already selects for PropertyChangeMask.
|
|
|
|
*/
|
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-25 03:39:13 +00:00
|
|
|
the_display->timestamp_pinging_window =
|
|
|
|
meta_create_offscreen_window (the_display->xdisplay,
|
|
|
|
DefaultRootWindow (the_display->xdisplay),
|
2007-03-31 23:34:36 +00:00
|
|
|
PropertyChangeMask);
|
2007-03-31 05:19:41 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
the_display->last_focus_time = timestamp;
|
|
|
|
the_display->last_user_time = timestamp;
|
|
|
|
the_display->compositor = NULL;
|
2002-12-10 03:23:04 +00:00
|
|
|
|
2012-09-10 18:19:21 +00:00
|
|
|
/* Mutter used to manage all X screens of the display in a single process, but
|
|
|
|
* now it always manages exactly one screen as specified by the DISPLAY
|
|
|
|
* environment variable. The screens GSList is left for simplicity.
|
|
|
|
*/
|
2002-10-07 23:14:40 +00:00
|
|
|
screens = NULL;
|
|
|
|
|
2012-09-10 18:19:21 +00:00
|
|
|
i = meta_ui_get_screen_number ();
|
2002-10-07 23:14:40 +00:00
|
|
|
|
2012-09-10 18:19:21 +00:00
|
|
|
screen = meta_screen_new (the_display, i, timestamp);
|
|
|
|
|
2014-02-08 00:52:34 +00:00
|
|
|
if (!screen)
|
2002-10-07 23:14:40 +00:00
|
|
|
{
|
|
|
|
/* This would typically happen because all the screens already
|
|
|
|
* have window managers.
|
|
|
|
*/
|
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-25 03:39:13 +00:00
|
|
|
meta_display_close (the_display, timestamp);
|
2002-10-07 23:14:40 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
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-19 03:49:50 +00:00
|
|
|
|
2014-02-08 00:52:34 +00:00
|
|
|
screens = g_slist_prepend (screens, screen);
|
2012-01-07 22:21:32 +00:00
|
|
|
|
2014-02-08 00:52:34 +00:00
|
|
|
the_display->screens = screens;
|
2014-02-02 04:09:53 +00:00
|
|
|
|
2014-02-08 00:52:34 +00:00
|
|
|
enable_compositor (the_display);
|
2006-01-13 19:41:01 +00:00
|
|
|
|
2014-02-08 00:52:34 +00:00
|
|
|
meta_screen_create_guard_window (screen);
|
|
|
|
|
|
|
|
/* We know that if mutter is running as a Wayland compositor,
|
|
|
|
* we start out with no windows.
|
|
|
|
*/
|
|
|
|
if (!meta_is_wayland_compositor ())
|
|
|
|
meta_screen_manage_all_windows (screen);
|
2002-07-24 15:41:44 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
Window focus;
|
|
|
|
int ret_to;
|
|
|
|
|
|
|
|
/* kinda bogus because GetInputFocus has no possible errors */
|
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-25 03:39:13 +00:00
|
|
|
meta_error_trap_push (the_display);
|
2002-07-24 15:41:44 +00:00
|
|
|
|
2004-12-23 06:44:56 +00:00
|
|
|
/* FIXME: This is totally broken; see comment 9 of bug 88194 about this */
|
2002-07-24 15:41:44 +00:00
|
|
|
focus = None;
|
2002-11-22 06:00:18 +00:00
|
|
|
ret_to = RevertToPointerRoot;
|
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-25 03:39:13 +00:00
|
|
|
XGetInputFocus (the_display->xdisplay, &focus, &ret_to);
|
2002-07-24 15:41:44 +00:00
|
|
|
|
|
|
|
/* Force a new FocusIn (does this work?) */
|
2003-09-27 02:40:09 +00:00
|
|
|
|
2003-11-24 17:47:48 +00:00
|
|
|
/* Use the same timestamp that was passed to meta_screen_new(),
|
|
|
|
* as it is the most recent timestamp.
|
|
|
|
*/
|
2004-12-23 06:44:56 +00:00
|
|
|
if (focus == None || focus == PointerRoot)
|
2005-12-28 06:24:30 +00:00
|
|
|
/* Just focus the no_focus_window on the first screen */
|
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-25 03:39:13 +00:00
|
|
|
meta_display_focus_the_no_focus_window (the_display,
|
|
|
|
the_display->screens->data,
|
2005-12-28 06:24:30 +00:00
|
|
|
timestamp);
|
2004-12-23 06:44:56 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
MetaWindow * window;
|
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-25 03:39:13 +00:00
|
|
|
window = meta_display_lookup_x_window (the_display, focus);
|
2004-12-23 06:44:56 +00:00
|
|
|
if (window)
|
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-25 03:39:13 +00:00
|
|
|
meta_display_set_input_focus_window (the_display, window, FALSE, timestamp);
|
2004-12-23 06:44:56 +00:00
|
|
|
else
|
2005-12-28 06:24:30 +00:00
|
|
|
/* Just focus the no_focus_window on the first screen */
|
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-25 03:39:13 +00:00
|
|
|
meta_display_focus_the_no_focus_window (the_display,
|
|
|
|
the_display->screens->data,
|
2005-12-28 06:24:30 +00:00
|
|
|
timestamp);
|
2004-12-23 06:44:56 +00:00
|
|
|
}
|
|
|
|
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop (the_display);
|
2002-07-24 15:41:44 +00:00
|
|
|
}
|
2013-08-14 11:51:05 +00:00
|
|
|
|
|
|
|
meta_idle_monitor_init_dbus ();
|
|
|
|
|
2006-10-01 21:59:09 +00:00
|
|
|
/* Done opening new display */
|
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-25 03:39:13 +00:00
|
|
|
the_display->display_opening = FALSE;
|
2006-10-01 21:59:09 +00:00
|
|
|
|
2001-05-30 15:36:31 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2001-06-03 18:33:59 +00:00
|
|
|
static gint
|
|
|
|
ptrcmp (gconstpointer a, gconstpointer b)
|
|
|
|
{
|
|
|
|
if (a < b)
|
|
|
|
return -1;
|
|
|
|
else if (a > b)
|
|
|
|
return 1;
|
|
|
|
else
|
|
|
|
return 0;
|
2001-05-30 15:36:31 +00:00
|
|
|
}
|
|
|
|
|
2009-06-15 19:32:23 +00:00
|
|
|
/**
|
|
|
|
* meta_display_list_windows:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
* @flags: options for listing
|
|
|
|
*
|
|
|
|
* Lists windows for the display, the @flags parameter for
|
|
|
|
* now determines whether override-redirect windows will be
|
|
|
|
* included.
|
|
|
|
*
|
|
|
|
* Return value: (transfer container): the list of windows.
|
|
|
|
*/
|
2001-06-24 08:09:10 +00:00
|
|
|
GSList*
|
2009-06-15 19:32:23 +00:00
|
|
|
meta_display_list_windows (MetaDisplay *display,
|
|
|
|
MetaListWindowsFlags flags)
|
2001-05-30 15:36:31 +00:00
|
|
|
{
|
2001-06-03 18:33:59 +00:00
|
|
|
GSList *winlist;
|
|
|
|
GSList *tmp;
|
2001-06-24 08:09:10 +00:00
|
|
|
GSList *prev;
|
2009-06-15 19:32:23 +00:00
|
|
|
GHashTableIter iter;
|
|
|
|
gpointer key, value;
|
|
|
|
|
2001-06-03 18:33:59 +00:00
|
|
|
winlist = NULL;
|
2009-06-15 19:32:23 +00:00
|
|
|
|
2013-02-06 22:02:59 +00:00
|
|
|
g_hash_table_iter_init (&iter, display->xids);
|
2009-06-15 19:32:23 +00:00
|
|
|
while (g_hash_table_iter_next (&iter, &key, &value))
|
|
|
|
{
|
|
|
|
MetaWindow *window = value;
|
|
|
|
|
2012-07-30 18:57:53 +00:00
|
|
|
if (!META_IS_WINDOW (window))
|
|
|
|
continue;
|
|
|
|
|
2009-06-15 19:32:23 +00:00
|
|
|
if (!window->override_redirect ||
|
|
|
|
(flags & META_LIST_INCLUDE_OVERRIDE_REDIRECT) != 0)
|
|
|
|
winlist = g_slist_prepend (winlist, window);
|
|
|
|
}
|
2001-06-03 18:33:59 +00:00
|
|
|
|
2013-09-16 09:24:01 +00:00
|
|
|
g_hash_table_iter_init (&iter, display->wayland_windows);
|
|
|
|
while (g_hash_table_iter_next (&iter, &key, &value))
|
|
|
|
{
|
|
|
|
MetaWindow *window = value;
|
|
|
|
|
|
|
|
if (!META_IS_WINDOW (window))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!window->override_redirect ||
|
|
|
|
(flags & META_LIST_INCLUDE_OVERRIDE_REDIRECT) != 0)
|
|
|
|
winlist = g_slist_prepend (winlist, window);
|
|
|
|
}
|
|
|
|
|
2001-06-24 08:09:10 +00:00
|
|
|
/* Uniquify the list, since both frame windows and plain
|
|
|
|
* windows are in the hash
|
|
|
|
*/
|
2001-06-03 18:33:59 +00:00
|
|
|
winlist = g_slist_sort (winlist, ptrcmp);
|
|
|
|
|
2001-06-24 08:09:10 +00:00
|
|
|
prev = NULL;
|
|
|
|
tmp = winlist;
|
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
GSList *next;
|
|
|
|
|
|
|
|
next = tmp->next;
|
|
|
|
|
|
|
|
if (next &&
|
|
|
|
next->data == tmp->data)
|
|
|
|
{
|
|
|
|
/* Delete tmp from list */
|
|
|
|
|
|
|
|
if (prev)
|
|
|
|
prev->next = next;
|
|
|
|
|
|
|
|
if (tmp == winlist)
|
|
|
|
winlist = next;
|
|
|
|
|
|
|
|
g_slist_free_1 (tmp);
|
|
|
|
|
|
|
|
/* leave prev unchanged */
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
prev = tmp;
|
|
|
|
}
|
|
|
|
|
|
|
|
tmp = next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return winlist;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 17:27:24 +00:00
|
|
|
meta_display_close (MetaDisplay *display,
|
|
|
|
guint32 timestamp)
|
2001-06-24 08:09:10 +00:00
|
|
|
{
|
|
|
|
GSList *tmp;
|
2006-01-13 19:41:01 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
g_assert (display != NULL);
|
|
|
|
|
2008-03-27 12:32:50 +00:00
|
|
|
if (display->closing != 0)
|
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-25 03:39:13 +00:00
|
|
|
{
|
2008-03-27 12:32:50 +00:00
|
|
|
/* The display's already been closed. */
|
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-25 03:39:13 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2002-02-24 19:58:27 +00:00
|
|
|
if (display->error_traps > 0)
|
2001-06-24 08:09:10 +00:00
|
|
|
meta_bug ("Display closed with error traps pending\n");
|
|
|
|
|
2002-06-22 05:11:04 +00:00
|
|
|
display->closing += 1;
|
2002-10-07 23:14:40 +00:00
|
|
|
|
|
|
|
meta_prefs_remove_listener (prefs_changed_callback, display);
|
2002-06-22 05:11:04 +00:00
|
|
|
|
2004-10-04 21:09:08 +00:00
|
|
|
meta_display_remove_autoraise_callback (display);
|
2005-01-24 05:58:30 +00:00
|
|
|
|
2012-12-04 21:45:35 +00:00
|
|
|
if (display->focus_timeout_id)
|
2012-08-29 02:38:54 +00:00
|
|
|
g_source_remove (display->focus_timeout_id);
|
|
|
|
display->focus_timeout_id = 0;
|
|
|
|
|
2005-01-24 05:58:30 +00:00
|
|
|
if (display->grab_old_window_stacking)
|
|
|
|
g_list_free (display->grab_old_window_stacking);
|
2002-10-25 23:35:50 +00:00
|
|
|
|
2001-06-20 03:01:26 +00:00
|
|
|
/* Stop caring about events */
|
|
|
|
meta_ui_remove_event_func (display->xdisplay,
|
2013-10-03 19:29:44 +00:00
|
|
|
xevent_callback,
|
2001-06-20 03:01:26 +00:00
|
|
|
display);
|
2013-11-14 17:58:52 +00:00
|
|
|
clutter_event_remove_filter (display->clutter_event_filter);
|
|
|
|
display->clutter_event_filter = 0;
|
2002-10-25 23:35:50 +00:00
|
|
|
|
2002-01-04 22:18:10 +00:00
|
|
|
/* Free all screens */
|
|
|
|
tmp = display->screens;
|
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaScreen *screen = tmp->data;
|
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 17:27:24 +00:00
|
|
|
meta_screen_free (screen, timestamp);
|
2002-01-04 22:18:10 +00:00
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_slist_free (display->screens);
|
|
|
|
display->screens = NULL;
|
2002-10-25 23:35:50 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_STARTUP_NOTIFICATION
|
|
|
|
if (display->sn_display)
|
|
|
|
{
|
|
|
|
sn_display_unref (display->sn_display);
|
|
|
|
display->sn_display = NULL;
|
|
|
|
}
|
|
|
|
#endif
|
2001-06-20 03:01:26 +00:00
|
|
|
|
2008-11-07 09:57:00 +00:00
|
|
|
/* Must be after all calls to meta_window_unmanage() since they
|
2001-06-04 04:58:22 +00:00
|
|
|
* unregister windows
|
|
|
|
*/
|
2013-02-06 22:02:59 +00:00
|
|
|
g_hash_table_destroy (display->xids);
|
2001-06-09 21:58:30 +00:00
|
|
|
|
2001-06-10 19:23:28 +00:00
|
|
|
if (display->leader_window != None)
|
|
|
|
XDestroyWindow (display->xdisplay, display->leader_window);
|
2001-06-20 03:01:26 +00:00
|
|
|
|
2002-08-06 04:11:23 +00:00
|
|
|
XFlush (display->xdisplay);
|
2002-11-03 23:42:21 +00:00
|
|
|
|
|
|
|
meta_display_free_window_prop_hooks (display);
|
2002-12-01 03:58:04 +00:00
|
|
|
meta_display_free_group_prop_hooks (display);
|
2002-08-06 04:11:23 +00:00
|
|
|
|
2001-05-30 15:36:31 +00:00
|
|
|
g_free (display->name);
|
|
|
|
|
2002-04-28 04:52:26 +00:00
|
|
|
meta_display_shutdown_keys (display);
|
2003-11-21 02:32:05 +00:00
|
|
|
|
2006-05-26 16:51:03 +00:00
|
|
|
if (display->compositor)
|
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-19 03:49:50 +00:00
|
|
|
meta_compositor_destroy (display->compositor);
|
2002-04-28 04:52:26 +00:00
|
|
|
|
2009-02-03 09:11:32 +00:00
|
|
|
g_object_unref (display);
|
2009-08-22 19:55:17 +00:00
|
|
|
the_display = NULL;
|
2001-05-30 15:36:31 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
meta_quit (META_EXIT_SUCCESS);
|
2001-05-30 15:36:31 +00:00
|
|
|
}
|
|
|
|
|
2008-11-17 21:34:28 +00:00
|
|
|
/**
|
|
|
|
* meta_display_screen_for_root:
|
|
|
|
* @display: a #MetaDisplay
|
2013-02-15 18:42:08 +00:00
|
|
|
* @xroot: a X window
|
2008-11-17 21:34:28 +00:00
|
|
|
*
|
|
|
|
* Return the #MetaScreen corresponding to a specified X root window ID.
|
|
|
|
*
|
|
|
|
* Return Value: (transfer none): the screen for the specified root window ID, or %NULL
|
|
|
|
*/
|
2001-05-30 15:36:31 +00:00
|
|
|
MetaScreen*
|
|
|
|
meta_display_screen_for_root (MetaDisplay *display,
|
|
|
|
Window xroot)
|
|
|
|
{
|
|
|
|
GSList *tmp;
|
|
|
|
|
|
|
|
tmp = display->screens;
|
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaScreen *screen = tmp->data;
|
|
|
|
|
|
|
|
if (xroot == screen->xroot)
|
|
|
|
return screen;
|
|
|
|
|
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2002-06-27 05:08:32 +00:00
|
|
|
MetaScreen*
|
|
|
|
meta_display_screen_for_xwindow (MetaDisplay *display,
|
|
|
|
Window xwindow)
|
|
|
|
{
|
|
|
|
XWindowAttributes attr;
|
2002-10-21 21:44:35 +00:00
|
|
|
int result;
|
|
|
|
|
2002-07-23 19:12:02 +00:00
|
|
|
meta_error_trap_push (display);
|
2002-10-21 21:44:35 +00:00
|
|
|
attr.screen = NULL;
|
|
|
|
result = XGetWindowAttributes (display->xdisplay, xwindow, &attr);
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop (display);
|
2002-10-21 21:44:35 +00:00
|
|
|
|
|
|
|
/* Note, XGetWindowAttributes is on all kinds of crack
|
|
|
|
* and returns 1 on success 0 on failure, rather than Success
|
|
|
|
* on success.
|
|
|
|
*/
|
|
|
|
if (result == 0 || attr.screen == NULL)
|
2002-07-23 19:12:02 +00:00
|
|
|
return NULL;
|
|
|
|
|
2002-06-27 05:08:32 +00:00
|
|
|
return meta_display_screen_for_x_screen (display, attr.screen);
|
|
|
|
}
|
|
|
|
|
2001-06-01 03:00:01 +00:00
|
|
|
MetaScreen*
|
|
|
|
meta_display_screen_for_x_screen (MetaDisplay *display,
|
|
|
|
Screen *xscreen)
|
|
|
|
{
|
|
|
|
GSList *tmp;
|
|
|
|
|
|
|
|
tmp = display->screens;
|
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaScreen *screen = tmp->data;
|
|
|
|
|
|
|
|
if (xscreen == screen->xscreen)
|
|
|
|
return screen;
|
|
|
|
|
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-12-30 22:52:14 +00:00
|
|
|
/* Grab/ungrab routines taken from fvwm.
|
|
|
|
* Calling this function will cause X to ignore all other clients until
|
|
|
|
* you ungrab. This may not be quite as bad as it sounds, yet there is
|
|
|
|
* agreement that avoiding server grabs except when they are clearly needed
|
|
|
|
* is a good thing.
|
|
|
|
*
|
|
|
|
* If you do use such grabs, please clearly explain the necessity for their
|
|
|
|
* usage in a comment. Try to keep their scope extremely limited. In
|
|
|
|
* particular, try to avoid emitting any signals or notifications while
|
|
|
|
* a grab is active (if the signal receiver tries to block on an X request
|
|
|
|
* from another client at this point, you will have a deadlock).
|
|
|
|
*/
|
2001-05-31 06:42:58 +00:00
|
|
|
void
|
|
|
|
meta_display_grab (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
if (display->server_grab_count == 0)
|
|
|
|
{
|
|
|
|
XGrabServer (display->xdisplay);
|
|
|
|
}
|
|
|
|
display->server_grab_count += 1;
|
2001-06-11 03:24:20 +00:00
|
|
|
meta_verbose ("Grabbing display, grab count now %d\n",
|
|
|
|
display->server_grab_count);
|
2001-05-31 06:42:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_display_ungrab (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
if (display->server_grab_count == 0)
|
|
|
|
meta_bug ("Ungrabbed non-grabbed server\n");
|
2001-06-06 04:47:37 +00:00
|
|
|
|
2001-05-31 06:42:58 +00:00
|
|
|
display->server_grab_count -= 1;
|
|
|
|
if (display->server_grab_count == 0)
|
|
|
|
{
|
2001-06-06 04:47:37 +00:00
|
|
|
/* FIXME we want to purge all pending "queued" stuff
|
|
|
|
* at this point, such as window hide/show
|
|
|
|
*/
|
2001-05-31 06:42:58 +00:00
|
|
|
XUngrabServer (display->xdisplay);
|
2002-11-04 00:56:12 +00:00
|
|
|
XFlush (display->xdisplay);
|
2001-05-31 06:42:58 +00:00
|
|
|
}
|
2001-06-11 03:24:20 +00:00
|
|
|
|
|
|
|
meta_verbose ("Ungrabbing display, grab count now %d\n",
|
|
|
|
display->server_grab_count);
|
2001-05-31 06:42:58 +00:00
|
|
|
}
|
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
/**
|
2011-11-02 15:34:45 +00:00
|
|
|
* meta_display_for_x_display:
|
|
|
|
* @xdisplay: An X display
|
|
|
|
*
|
|
|
|
* Returns the singleton MetaDisplay if @xdisplay matches the X display it's
|
|
|
|
* managing; otherwise gives a warning and returns %NULL. When we were claiming
|
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-25 03:39:13 +00:00
|
|
|
* to be able to manage multiple displays, this was supposed to find the
|
|
|
|
* display out of the list which matched that display. Now it's merely an
|
|
|
|
* extra sanity check.
|
|
|
|
*
|
2011-11-02 15:34:45 +00:00
|
|
|
* Returns: The singleton X display, or %NULL if @xdisplay isn't the one
|
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-25 03:39:13 +00:00
|
|
|
* we're managing.
|
|
|
|
*/
|
2001-05-31 03:30:58 +00: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-25 03:39:13 +00:00
|
|
|
if (the_display->xdisplay == xdisplay)
|
|
|
|
return the_display;
|
2001-05-31 03:30:58 +00:00
|
|
|
|
2002-03-06 22:27:24 +00:00
|
|
|
meta_warning ("Could not find display for X display %p, probably going to crash\n",
|
|
|
|
xdisplay);
|
|
|
|
|
2001-05-31 03:30:58 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
/**
|
2011-11-02 15:34:45 +00:00
|
|
|
* meta_get_display:
|
|
|
|
*
|
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-25 03:39:13 +00:00
|
|
|
* Accessor for the singleton MetaDisplay.
|
|
|
|
*
|
2011-11-02 15:34:45 +00:00
|
|
|
* Returns: The only #MetaDisplay there is. This can be %NULL, but only
|
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-25 03:39:13 +00:00
|
|
|
* during startup.
|
|
|
|
*/
|
|
|
|
MetaDisplay*
|
|
|
|
meta_get_display (void)
|
2001-05-31 06:42:58 +00:00
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
return the_display;
|
2001-05-31 06:42:58 +00:00
|
|
|
}
|
|
|
|
|
2008-02-15 04:37:39 +00:00
|
|
|
#ifdef WITH_VERBOSE_MODE
|
2001-05-30 15:36:31 +00:00
|
|
|
static gboolean dump_events = TRUE;
|
2008-02-15 04:37:39 +00:00
|
|
|
#endif
|
2001-05-30 15:36:31 +00:00
|
|
|
|
2006-08-21 18:38:21 +00:00
|
|
|
static gboolean
|
|
|
|
grab_op_is_mouse_only (MetaGrabOp op)
|
|
|
|
{
|
|
|
|
switch (op)
|
|
|
|
{
|
|
|
|
case META_GRAB_OP_MOVING:
|
|
|
|
case META_GRAB_OP_RESIZING_SE:
|
|
|
|
case META_GRAB_OP_RESIZING_S:
|
|
|
|
case META_GRAB_OP_RESIZING_SW:
|
|
|
|
case META_GRAB_OP_RESIZING_N:
|
|
|
|
case META_GRAB_OP_RESIZING_NE:
|
|
|
|
case META_GRAB_OP_RESIZING_NW:
|
|
|
|
case META_GRAB_OP_RESIZING_W:
|
|
|
|
case META_GRAB_OP_RESIZING_E:
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-15 22:18:06 +00:00
|
|
|
gboolean
|
|
|
|
meta_grab_op_is_mouse (MetaGrabOp op)
|
2001-07-26 03:14:45 +00:00
|
|
|
{
|
|
|
|
switch (op)
|
|
|
|
{
|
|
|
|
case META_GRAB_OP_MOVING:
|
|
|
|
case META_GRAB_OP_RESIZING_SE:
|
|
|
|
case META_GRAB_OP_RESIZING_S:
|
|
|
|
case META_GRAB_OP_RESIZING_SW:
|
|
|
|
case META_GRAB_OP_RESIZING_N:
|
|
|
|
case META_GRAB_OP_RESIZING_NE:
|
|
|
|
case META_GRAB_OP_RESIZING_NW:
|
|
|
|
case META_GRAB_OP_RESIZING_W:
|
|
|
|
case META_GRAB_OP_RESIZING_E:
|
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 04:27:23 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_S:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_N:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_W:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_E:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_SE:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_NE:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_SW:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_NW:
|
|
|
|
case META_GRAB_OP_KEYBOARD_MOVING:
|
2009-08-12 04:12:52 +00:00
|
|
|
case META_GRAB_OP_COMPOSITOR:
|
2001-07-26 03:14:45 +00:00
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
grab_op_is_keyboard (MetaGrabOp op)
|
|
|
|
{
|
|
|
|
switch (op)
|
|
|
|
{
|
|
|
|
case META_GRAB_OP_KEYBOARD_MOVING:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_S:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_N:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_W:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_E:
|
2001-08-19 18:09:10 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_SE:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_NE:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_SW:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_NW:
|
2002-04-05 15:52:49 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_TABBING_NORMAL:
|
|
|
|
case META_GRAB_OP_KEYBOARD_TABBING_DOCK:
|
2006-04-15 02:05:44 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_TABBING_GROUP:
|
2002-07-06 16:50:48 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_ESCAPING_NORMAL:
|
|
|
|
case META_GRAB_OP_KEYBOARD_ESCAPING_DOCK:
|
2006-04-15 02:05:44 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_ESCAPING_GROUP:
|
2002-06-09 04:04:19 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING:
|
2009-08-12 04:12:52 +00:00
|
|
|
case META_GRAB_OP_COMPOSITOR:
|
2001-07-26 03:14:45 +00:00
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-12-10 03:23:04 +00:00
|
|
|
gboolean
|
|
|
|
meta_grab_op_is_resizing (MetaGrabOp op)
|
|
|
|
{
|
|
|
|
switch (op)
|
|
|
|
{
|
|
|
|
case META_GRAB_OP_RESIZING_SE:
|
|
|
|
case META_GRAB_OP_RESIZING_S:
|
|
|
|
case META_GRAB_OP_RESIZING_SW:
|
|
|
|
case META_GRAB_OP_RESIZING_N:
|
|
|
|
case META_GRAB_OP_RESIZING_NE:
|
|
|
|
case META_GRAB_OP_RESIZING_NW:
|
|
|
|
case META_GRAB_OP_RESIZING_W:
|
|
|
|
case META_GRAB_OP_RESIZING_E:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_S:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_N:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_W:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_E:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_SE:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_NE:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_SW:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_NW:
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
meta_grab_op_is_moving (MetaGrabOp op)
|
|
|
|
{
|
|
|
|
switch (op)
|
|
|
|
{
|
|
|
|
case META_GRAB_OP_MOVING:
|
|
|
|
case META_GRAB_OP_KEYBOARD_MOVING:
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-17 18:43:08 +00:00
|
|
|
/**
|
|
|
|
* meta_display_xserver_time_is_before:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
* @time1: An event timestamp
|
|
|
|
* @time2: An event timestamp
|
|
|
|
*
|
|
|
|
* Xserver time can wraparound, thus comparing two timestamps needs to take
|
|
|
|
* this into account. If no wraparound has occurred, this is equivalent to
|
|
|
|
* time1 < time2
|
|
|
|
* Otherwise, we need to account 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.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
meta_display_xserver_time_is_before (MetaDisplay *display,
|
|
|
|
guint32 time1,
|
|
|
|
guint32 time2)
|
|
|
|
{
|
|
|
|
return XSERVER_TIME_IS_BEFORE(time1, time2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* meta_display_get_last_user_time:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
*
|
|
|
|
* Returns: Timestamp of the last user interaction event with a window
|
|
|
|
*/
|
|
|
|
guint32
|
|
|
|
meta_display_get_last_user_time (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return display->last_user_time;
|
|
|
|
}
|
|
|
|
|
2002-01-03 23:28:19 +00:00
|
|
|
/* Get time of current event, or CurrentTime if none. */
|
|
|
|
guint32
|
|
|
|
meta_display_get_current_time (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return display->current_time;
|
|
|
|
}
|
|
|
|
|
display: Ensure that we ignore our own focus events for focus predictions
When we set the input focus, we first set the predicted window,
and then try to process focus events. But as XI_FocusOut on the
existing window comes before XI_FocusIn on the new window, we'll
see the focus out on the old window and think the focus is going
to nothing, which makes mutter think the prediction failed.
This didn't really matter as nothing paid attention to the focus
window changing, but with gnome-shell's focus rework, we'll try
and drop keyboard focus in events like these.
Fix this by making sure that we ignore focus window changes of our
own cause when updating the focus window field, by ignoring all
focus events that have a serial the same as the focus request or
lower. Note that if mutter doens't make any requests after the
focus request, this could be racy, as another client could steal
the focus, but mutter would ignore it as the serial was the same.
Bump the serial by making a dummy ChangeProperty request to a
mutter-controlled window in this case.
https://bugzilla.gnome.org/show_bug.cgi?id=701017
2013-05-25 20:09:08 +00:00
|
|
|
static Bool
|
2013-05-24 21:58:55 +00:00
|
|
|
find_timestamp_predicate (Display *xdisplay,
|
display: Ensure that we ignore our own focus events for focus predictions
When we set the input focus, we first set the predicted window,
and then try to process focus events. But as XI_FocusOut on the
existing window comes before XI_FocusIn on the new window, we'll
see the focus out on the old window and think the focus is going
to nothing, which makes mutter think the prediction failed.
This didn't really matter as nothing paid attention to the focus
window changing, but with gnome-shell's focus rework, we'll try
and drop keyboard focus in events like these.
Fix this by making sure that we ignore focus window changes of our
own cause when updating the focus window field, by ignoring all
focus events that have a serial the same as the focus request or
lower. Note that if mutter doens't make any requests after the
focus request, this could be racy, as another client could steal
the focus, but mutter would ignore it as the serial was the same.
Bump the serial by making a dummy ChangeProperty request to a
mutter-controlled window in this case.
https://bugzilla.gnome.org/show_bug.cgi?id=701017
2013-05-25 20:09:08 +00:00
|
|
|
XEvent *ev,
|
|
|
|
XPointer arg)
|
|
|
|
{
|
2013-05-24 21:58:55 +00:00
|
|
|
MetaDisplay *display = (MetaDisplay *) arg;
|
display: Ensure that we ignore our own focus events for focus predictions
When we set the input focus, we first set the predicted window,
and then try to process focus events. But as XI_FocusOut on the
existing window comes before XI_FocusIn on the new window, we'll
see the focus out on the old window and think the focus is going
to nothing, which makes mutter think the prediction failed.
This didn't really matter as nothing paid attention to the focus
window changing, but with gnome-shell's focus rework, we'll try
and drop keyboard focus in events like these.
Fix this by making sure that we ignore focus window changes of our
own cause when updating the focus window field, by ignoring all
focus events that have a serial the same as the focus request or
lower. Note that if mutter doens't make any requests after the
focus request, this could be racy, as another client could steal
the focus, but mutter would ignore it as the serial was the same.
Bump the serial by making a dummy ChangeProperty request to a
mutter-controlled window in this case.
https://bugzilla.gnome.org/show_bug.cgi?id=701017
2013-05-25 20:09:08 +00:00
|
|
|
|
|
|
|
return (ev->type == PropertyNotify &&
|
|
|
|
ev->xproperty.atom == display->atom__MUTTER_TIMESTAMP_PING);
|
|
|
|
}
|
|
|
|
|
Fix a variety of focus race conditions in all focus modes, or at least
2004-10-04 Elijah Newren <newren@math.utah.edu>
Fix a variety of focus race conditions in all focus modes, or at
least make them harder to trigger (fixes #152000)
* src/core.[ch] (meta_core_user_lower_and_unfocus): add a
timestamp parameter; pass it along to
meta_workspace_focus_default_window
* src/display.[ch] (meta_display_get_current_time_roundtrip): new
function
* src/display.c (event_callback): pass a timestamp to the
meta_workspace_activate and meta_workspace_focus_default_window
function calls
* src/frames.c (meta_frames_button_press_event): pass a timestamp
to meta_core_user_lower_and_unfocus
* src/keybindings.c (handle_activate_workspace): pass a timestamp
to meta_workspace_activate, (process_workspace_switch_grab): pass
a timestamp to meta_workspace_focus_default_window and
meta_workspace_activate, (handle_toggle_desktop): pass a timestamp
to meta_workspace_focus_default_window,
(do_handle_move_to_workspace): pass a timestamp to
meta_workspace_activate_with_focus, (handle_workspace_switch):
meta_workspace_activate
* src/screen.c (meta_screen_new): pass a timestamp to
meta_workspace_activate
* src/window.c (meta_window_free): pass a timestamp to
meta_workspace_focus_default_window, (idle_calc_showing): don't
increment the focus sentinel here, (meta_window_minimize): pass a
timestamp to meta_workspace_focus_default_window,
(meta_window_client_message), pass a timestamp to
meta_workspace_focus_default_window
* src/workspace.h (meta_workspace_activate): add timestamp
parameter, (meta_workspace_activate_with_focus): add timestamp
parameter, (meta_workspace_focus_default_window): add timestamp
parameter
* src/workspace.c (meta_workspace_focus_mru_window): make this
function take a timestamp and use it for meta_window_focus or
XSetInputFocus, (meta_workspace_activate_with_focus): make this
function take a timestamp and pass it along to meta_window_focus
and meta_workspace_focus_default_window,
(meta_workspace_activate): make this function take a timestamp and
pass it to meta_workspace_activate_with_focus),
(meta_workspace_focus_default_window): make this function take a
timestamp, warn if its 0 but try to handle that case sanely, and
pass the timestamp on to meta_window_focus or
meta_workspace_focus_mru_window or XSetInputFocus
2004-10-04 20:32:59 +00:00
|
|
|
/* Get a timestamp, even if it means a roundtrip */
|
|
|
|
guint32
|
|
|
|
meta_display_get_current_time_roundtrip (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
guint32 timestamp;
|
|
|
|
|
|
|
|
timestamp = meta_display_get_current_time (display);
|
|
|
|
if (timestamp == CurrentTime)
|
|
|
|
{
|
|
|
|
XEvent property_event;
|
|
|
|
|
display: Ensure that we ignore our own focus events for focus predictions
When we set the input focus, we first set the predicted window,
and then try to process focus events. But as XI_FocusOut on the
existing window comes before XI_FocusIn on the new window, we'll
see the focus out on the old window and think the focus is going
to nothing, which makes mutter think the prediction failed.
This didn't really matter as nothing paid attention to the focus
window changing, but with gnome-shell's focus rework, we'll try
and drop keyboard focus in events like these.
Fix this by making sure that we ignore focus window changes of our
own cause when updating the focus window field, by ignoring all
focus events that have a serial the same as the focus request or
lower. Note that if mutter doens't make any requests after the
focus request, this could be racy, as another client could steal
the focus, but mutter would ignore it as the serial was the same.
Bump the serial by making a dummy ChangeProperty request to a
mutter-controlled window in this case.
https://bugzilla.gnome.org/show_bug.cgi?id=701017
2013-05-25 20:09:08 +00:00
|
|
|
XChangeProperty (display->xdisplay, display->timestamp_pinging_window,
|
|
|
|
display->atom__MUTTER_TIMESTAMP_PING,
|
|
|
|
XA_STRING, 8, PropModeAppend, NULL, 0);
|
|
|
|
XIfEvent (display->xdisplay,
|
|
|
|
&property_event,
|
|
|
|
find_timestamp_predicate,
|
2013-05-24 21:58:55 +00:00
|
|
|
(XPointer) display);
|
Fix a variety of focus race conditions in all focus modes, or at least
2004-10-04 Elijah Newren <newren@math.utah.edu>
Fix a variety of focus race conditions in all focus modes, or at
least make them harder to trigger (fixes #152000)
* src/core.[ch] (meta_core_user_lower_and_unfocus): add a
timestamp parameter; pass it along to
meta_workspace_focus_default_window
* src/display.[ch] (meta_display_get_current_time_roundtrip): new
function
* src/display.c (event_callback): pass a timestamp to the
meta_workspace_activate and meta_workspace_focus_default_window
function calls
* src/frames.c (meta_frames_button_press_event): pass a timestamp
to meta_core_user_lower_and_unfocus
* src/keybindings.c (handle_activate_workspace): pass a timestamp
to meta_workspace_activate, (process_workspace_switch_grab): pass
a timestamp to meta_workspace_focus_default_window and
meta_workspace_activate, (handle_toggle_desktop): pass a timestamp
to meta_workspace_focus_default_window,
(do_handle_move_to_workspace): pass a timestamp to
meta_workspace_activate_with_focus, (handle_workspace_switch):
meta_workspace_activate
* src/screen.c (meta_screen_new): pass a timestamp to
meta_workspace_activate
* src/window.c (meta_window_free): pass a timestamp to
meta_workspace_focus_default_window, (idle_calc_showing): don't
increment the focus sentinel here, (meta_window_minimize): pass a
timestamp to meta_workspace_focus_default_window,
(meta_window_client_message), pass a timestamp to
meta_workspace_focus_default_window
* src/workspace.h (meta_workspace_activate): add timestamp
parameter, (meta_workspace_activate_with_focus): add timestamp
parameter, (meta_workspace_focus_default_window): add timestamp
parameter
* src/workspace.c (meta_workspace_focus_mru_window): make this
function take a timestamp and use it for meta_window_focus or
XSetInputFocus, (meta_workspace_activate_with_focus): make this
function take a timestamp and pass it along to meta_window_focus
and meta_workspace_focus_default_window,
(meta_workspace_activate): make this function take a timestamp and
pass it to meta_workspace_activate_with_focus),
(meta_workspace_focus_default_window): make this function take a
timestamp, warn if its 0 but try to handle that case sanely, and
pass the timestamp on to meta_window_focus or
meta_workspace_focus_mru_window or XSetInputFocus
2004-10-04 20:32:59 +00:00
|
|
|
timestamp = property_event.xproperty.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 17:14:16 +00:00
|
|
|
sanity_check_timestamps (display, timestamp);
|
|
|
|
|
Fix a variety of focus race conditions in all focus modes, or at least
2004-10-04 Elijah Newren <newren@math.utah.edu>
Fix a variety of focus race conditions in all focus modes, or at
least make them harder to trigger (fixes #152000)
* src/core.[ch] (meta_core_user_lower_and_unfocus): add a
timestamp parameter; pass it along to
meta_workspace_focus_default_window
* src/display.[ch] (meta_display_get_current_time_roundtrip): new
function
* src/display.c (event_callback): pass a timestamp to the
meta_workspace_activate and meta_workspace_focus_default_window
function calls
* src/frames.c (meta_frames_button_press_event): pass a timestamp
to meta_core_user_lower_and_unfocus
* src/keybindings.c (handle_activate_workspace): pass a timestamp
to meta_workspace_activate, (process_workspace_switch_grab): pass
a timestamp to meta_workspace_focus_default_window and
meta_workspace_activate, (handle_toggle_desktop): pass a timestamp
to meta_workspace_focus_default_window,
(do_handle_move_to_workspace): pass a timestamp to
meta_workspace_activate_with_focus, (handle_workspace_switch):
meta_workspace_activate
* src/screen.c (meta_screen_new): pass a timestamp to
meta_workspace_activate
* src/window.c (meta_window_free): pass a timestamp to
meta_workspace_focus_default_window, (idle_calc_showing): don't
increment the focus sentinel here, (meta_window_minimize): pass a
timestamp to meta_workspace_focus_default_window,
(meta_window_client_message), pass a timestamp to
meta_workspace_focus_default_window
* src/workspace.h (meta_workspace_activate): add timestamp
parameter, (meta_workspace_activate_with_focus): add timestamp
parameter, (meta_workspace_focus_default_window): add timestamp
parameter
* src/workspace.c (meta_workspace_focus_mru_window): make this
function take a timestamp and use it for meta_window_focus or
XSetInputFocus, (meta_workspace_activate_with_focus): make this
function take a timestamp and pass it along to meta_window_focus
and meta_workspace_focus_default_window,
(meta_workspace_activate): make this function take a timestamp and
pass it to meta_workspace_activate_with_focus),
(meta_workspace_focus_default_window): make this function take a
timestamp, warn if its 0 but try to handle that case sanely, and
pass the timestamp on to meta_window_focus or
meta_workspace_focus_mru_window or XSetInputFocus
2004-10-04 20:32:59 +00:00
|
|
|
return timestamp;
|
|
|
|
}
|
|
|
|
|
2012-03-13 15:07:59 +00:00
|
|
|
/**
|
|
|
|
* meta_display_get_ignored_modifier_mask:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
*
|
|
|
|
* Returns: a mask of modifiers that should be ignored
|
|
|
|
* when matching keybindings to events
|
|
|
|
*/
|
|
|
|
unsigned int
|
|
|
|
meta_display_get_ignored_modifier_mask (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return display->ignored_modifier_mask;
|
|
|
|
}
|
|
|
|
|
2011-09-07 15:19:15 +00:00
|
|
|
/**
|
|
|
|
* meta_display_add_ignored_crossing_serial:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
* @serial: the serial to ignore
|
|
|
|
*
|
|
|
|
* Save the specified serial and ignore crossing events with that
|
|
|
|
* serial for the purpose of focus-follows-mouse. This can be used
|
|
|
|
* for certain changes to the window hierarchy that we don't want
|
|
|
|
* to change the focus window, even if they cause the pointer to
|
|
|
|
* end up in a new window.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
meta_display_add_ignored_crossing_serial (MetaDisplay *display,
|
|
|
|
unsigned long serial)
|
2002-03-02 15:26:07 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* don't add the same serial more than once */
|
2011-09-12 13:50:30 +00:00
|
|
|
if (display->ignored_crossing_serials[N_IGNORED_CROSSING_SERIALS-1] == serial)
|
2002-03-02 15:26:07 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* shift serials to the left */
|
|
|
|
i = 0;
|
2011-09-12 13:50:30 +00:00
|
|
|
while (i < (N_IGNORED_CROSSING_SERIALS - 1))
|
2002-03-02 15:26:07 +00:00
|
|
|
{
|
2011-09-12 13:50:30 +00:00
|
|
|
display->ignored_crossing_serials[i] = display->ignored_crossing_serials[i+1];
|
2002-03-02 15:26:07 +00:00
|
|
|
++i;
|
|
|
|
}
|
|
|
|
/* put new one on the end */
|
2011-09-12 13:50:30 +00:00
|
|
|
display->ignored_crossing_serials[i] = serial;
|
2002-03-02 15:26:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2011-09-12 13:50:30 +00:00
|
|
|
crossing_serial_is_ignored (MetaDisplay *display,
|
|
|
|
unsigned long serial)
|
2002-03-02 15:26:07 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
i = 0;
|
2011-09-12 13:50:30 +00:00
|
|
|
while (i < N_IGNORED_CROSSING_SERIALS)
|
2002-03-02 15:26:07 +00:00
|
|
|
{
|
2011-09-12 13:50:30 +00:00
|
|
|
if (display->ignored_crossing_serials[i] == serial)
|
2002-03-02 15:26:07 +00:00
|
|
|
return TRUE;
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-05-24 02:23:46 +00:00
|
|
|
static gboolean
|
|
|
|
window_raise_with_delay_callback (void *data)
|
|
|
|
{
|
2013-10-16 04:19:33 +00:00
|
|
|
MetaWindow *window = data;
|
2002-05-24 02:23:46 +00:00
|
|
|
|
2013-10-16 04:19:33 +00:00
|
|
|
window->display->autoraise_timeout_id = 0;
|
|
|
|
window->display->autoraise_window = NULL;
|
2002-05-24 02:23:46 +00:00
|
|
|
|
|
|
|
/* If we aren't already on top, check whether the pointer is inside
|
|
|
|
* the window and raise the window if so.
|
|
|
|
*/
|
|
|
|
if (meta_stack_get_top (window->screen->stack) != window)
|
|
|
|
{
|
|
|
|
int x, y, root_x, root_y;
|
|
|
|
Window root, child;
|
2013-11-15 21:11:20 +00:00
|
|
|
MetaRectangle frame_rect;
|
2002-05-24 02:23:46 +00:00
|
|
|
unsigned int mask;
|
|
|
|
gboolean same_screen;
|
2006-01-20 22:03:56 +00:00
|
|
|
gboolean point_in_window;
|
2002-05-24 02:23:46 +00:00
|
|
|
|
|
|
|
meta_error_trap_push (window->display);
|
|
|
|
same_screen = XQueryPointer (window->display->xdisplay,
|
|
|
|
window->xwindow,
|
|
|
|
&root, &child,
|
|
|
|
&root_x, &root_y, &x, &y, &mask);
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop (window->display);
|
2002-05-24 02:23:46 +00:00
|
|
|
|
2013-11-19 17:24:45 +00:00
|
|
|
meta_window_get_frame_rect (window, &frame_rect);
|
2013-11-15 21:11:20 +00:00
|
|
|
point_in_window = POINT_IN_RECT (root_x, root_y, frame_rect);
|
2006-01-20 22:03:56 +00:00
|
|
|
if (same_screen && point_in_window)
|
2002-05-24 02:23:46 +00:00
|
|
|
meta_window_raise (window);
|
|
|
|
else
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Pointer not inside window, not raising %s\n",
|
|
|
|
window->desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2004-10-04 21:09:08 +00:00
|
|
|
void
|
|
|
|
meta_display_queue_autoraise_callback (MetaDisplay *display,
|
|
|
|
MetaWindow *window)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Queuing an autoraise timeout for %s with delay %d\n",
|
|
|
|
window->desc,
|
|
|
|
meta_prefs_get_auto_raise_delay ());
|
|
|
|
|
|
|
|
if (display->autoraise_timeout_id != 0)
|
|
|
|
g_source_remove (display->autoraise_timeout_id);
|
|
|
|
|
|
|
|
display->autoraise_timeout_id =
|
|
|
|
g_timeout_add_full (G_PRIORITY_DEFAULT,
|
|
|
|
meta_prefs_get_auto_raise_delay (),
|
|
|
|
window_raise_with_delay_callback,
|
2013-10-16 04:19:33 +00:00
|
|
|
window, NULL);
|
2004-10-04 21:09:08 +00:00
|
|
|
display->autoraise_window = window;
|
|
|
|
}
|
|
|
|
|
2012-04-24 22:02:33 +00:00
|
|
|
#if 0
|
|
|
|
static void
|
|
|
|
handle_net_restack_window (MetaDisplay* display,
|
|
|
|
XEvent *event)
|
|
|
|
{
|
|
|
|
MetaWindow *window;
|
|
|
|
|
|
|
|
window = meta_display_lookup_x_window (display,
|
|
|
|
event->xclient.window);
|
|
|
|
|
|
|
|
if (window)
|
|
|
|
{
|
|
|
|
/* FIXME: The EWMH includes a sibling for the restack request, but we
|
|
|
|
* (stupidly) don't currently support these types of raises.
|
|
|
|
*
|
|
|
|
* Also, unconditionally following these is REALLY stupid--we should
|
|
|
|
* combine this code with the stuff in
|
2014-01-23 21:33:53 +00:00
|
|
|
* meta_window_x11_configure_request() which is smart about whether to
|
2012-04-24 22:02:33 +00:00
|
|
|
* follow the request or do something else (though not smart enough
|
|
|
|
* and is also too stupid to handle the sibling stuff).
|
|
|
|
*/
|
|
|
|
switch (event->xclient.data.l[2])
|
|
|
|
{
|
|
|
|
case Above:
|
|
|
|
meta_window_raise (window);
|
|
|
|
break;
|
|
|
|
case Below:
|
|
|
|
meta_window_lower (window);
|
|
|
|
break;
|
|
|
|
case TopIf:
|
|
|
|
case BottomIf:
|
|
|
|
case Opposite:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-10-03 19:29:44 +00:00
|
|
|
static MetaWindow *
|
2013-11-18 23:36:39 +00:00
|
|
|
get_window_for_event (MetaDisplay *display,
|
|
|
|
const ClutterEvent *event)
|
2013-10-03 19:29:44 +00:00
|
|
|
{
|
2013-11-18 23:36:39 +00:00
|
|
|
ClutterActor *source;
|
2013-10-03 19:29:44 +00:00
|
|
|
|
2013-12-05 22:14:48 +00:00
|
|
|
if (display->grab_op != META_GRAB_OP_NONE)
|
2013-11-18 23:36:39 +00:00
|
|
|
return display->grab_window;
|
2013-10-03 19:29:44 +00:00
|
|
|
|
2013-11-18 23:36:39 +00:00
|
|
|
source = clutter_event_get_source (event);
|
window-actor: Split into two subclasses of MetaSurfaceActor
The rendering logic before was somewhat complex. We had three independent
cases to take into account when doing rendering:
* X11 compositor. In this case, we're a traditional X11 compositor,
not a Wayland compositor. We use XCompositeNameWindowPixmap to get
the backing pixmap for the window, and deal with the COMPOSITE
extension messiness.
In this case, meta_is_wayland_compositor() is FALSE.
* Wayland clients. In this case, we're a Wayland compositor managing
Wayland surfaces. The rendering for this is fairly straightforward,
as Cogl handles most of the complexity with EGL and SHM buffers...
Wayland clients give us the input and opaque regions through
wl_surface.
In this case, meta_is_wayland_compositor() is TRUE and
priv->window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND.
* XWayland clients. In this case, we're a Wayland compositor, like
above, and XWayland hands us Wayland surfaces. XWayland handles
the COMPOSITE extension messiness for us, and hands us a buffer
like any other Wayland client. We have to fetch the input and
opaque regions from the X11 window ourselves.
In this case, meta_is_wayland_compositor() is TRUE and
priv->window->client_type == META_WINDOW_CLIENT_TYPE_X11.
We now split the rendering logic into two subclasses, which are:
* MetaSurfaceActorX11, which handles the X11 compositor case, in that
it uses XCompositeNameWindowPixmap to get the backing pixmap, and
deal with all the COMPOSITE extension messiness.
* MetaSurfaceActorWayland, which handles the Wayland compositor case
for both native Wayland clients and XWayland clients. XWayland handles
COMPOSITE for us, and handles pushing a surface over through the
xf86-video-wayland DDX.
Frame sync is still in MetaWindowActor, as it needs to work for both the
X11 compositor and XWayland client cases. When Wayland's video display
protocol lands, this will need to be significantly overhauled, as it would
have to work for any wl_surface, including subsurfaces, so we would need
surface-level discretion.
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-01 22:21:11 +00:00
|
|
|
if (META_IS_SURFACE_ACTOR_WAYLAND (source))
|
2014-02-19 02:27:20 +00:00
|
|
|
{
|
window-actor: Split into two subclasses of MetaSurfaceActor
The rendering logic before was somewhat complex. We had three independent
cases to take into account when doing rendering:
* X11 compositor. In this case, we're a traditional X11 compositor,
not a Wayland compositor. We use XCompositeNameWindowPixmap to get
the backing pixmap for the window, and deal with the COMPOSITE
extension messiness.
In this case, meta_is_wayland_compositor() is FALSE.
* Wayland clients. In this case, we're a Wayland compositor managing
Wayland surfaces. The rendering for this is fairly straightforward,
as Cogl handles most of the complexity with EGL and SHM buffers...
Wayland clients give us the input and opaque regions through
wl_surface.
In this case, meta_is_wayland_compositor() is TRUE and
priv->window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND.
* XWayland clients. In this case, we're a Wayland compositor, like
above, and XWayland hands us Wayland surfaces. XWayland handles
the COMPOSITE extension messiness for us, and hands us a buffer
like any other Wayland client. We have to fetch the input and
opaque regions from the X11 window ourselves.
In this case, meta_is_wayland_compositor() is TRUE and
priv->window->client_type == META_WINDOW_CLIENT_TYPE_X11.
We now split the rendering logic into two subclasses, which are:
* MetaSurfaceActorX11, which handles the X11 compositor case, in that
it uses XCompositeNameWindowPixmap to get the backing pixmap, and
deal with all the COMPOSITE extension messiness.
* MetaSurfaceActorWayland, which handles the Wayland compositor case
for both native Wayland clients and XWayland clients. XWayland handles
COMPOSITE for us, and handles pushing a surface over through the
xf86-video-wayland DDX.
Frame sync is still in MetaWindowActor, as it needs to work for both the
X11 compositor and XWayland client cases. When Wayland's video display
protocol lands, this will need to be significantly overhauled, as it would
have to work for any wl_surface, including subsurfaces, so we would need
surface-level discretion.
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-01 22:21:11 +00:00
|
|
|
MetaWaylandSurface *surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (source));
|
2014-02-19 02:27:20 +00:00
|
|
|
g_assert (surface != NULL);
|
|
|
|
return surface->window;
|
|
|
|
}
|
2013-10-03 19:29:44 +00:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-11-15 21:35:42 +00:00
|
|
|
static XIEvent *
|
|
|
|
get_input_event (MetaDisplay *display,
|
|
|
|
XEvent *event)
|
2011-06-08 08:27:27 +00:00
|
|
|
{
|
2012-11-15 21:35:42 +00:00
|
|
|
if (event->type == GenericEvent &&
|
|
|
|
event->xcookie.extension == display->xinput_opcode)
|
|
|
|
{
|
|
|
|
XIEvent *input_event;
|
|
|
|
|
|
|
|
/* NB: GDK event filters already have generic events
|
|
|
|
* allocated, so no need to do XGetEventData() on our own
|
|
|
|
*/
|
|
|
|
input_event = (XIEvent *) event->xcookie.data;
|
|
|
|
|
|
|
|
switch (input_event->evtype)
|
|
|
|
{
|
|
|
|
case XI_Motion:
|
|
|
|
case XI_ButtonPress:
|
|
|
|
case XI_ButtonRelease:
|
2012-11-20 21:59:20 +00:00
|
|
|
if (((XIDeviceEvent *) input_event)->deviceid == META_VIRTUAL_CORE_POINTER_ID)
|
2012-11-20 22:26:19 +00:00
|
|
|
return input_event;
|
2013-09-03 19:57:05 +00:00
|
|
|
break;
|
2012-11-15 21:35:42 +00:00
|
|
|
case XI_KeyPress:
|
|
|
|
case XI_KeyRelease:
|
2012-11-20 21:59:20 +00:00
|
|
|
if (((XIDeviceEvent *) input_event)->deviceid == META_VIRTUAL_CORE_KEYBOARD_ID)
|
2012-11-20 22:26:19 +00:00
|
|
|
return input_event;
|
2013-09-03 19:57:05 +00:00
|
|
|
break;
|
2012-11-15 21:35:42 +00:00
|
|
|
case XI_FocusIn:
|
|
|
|
case XI_FocusOut:
|
2012-11-20 21:59:20 +00:00
|
|
|
if (((XIEnterEvent *) input_event)->deviceid == META_VIRTUAL_CORE_KEYBOARD_ID)
|
2012-11-20 22:26:19 +00:00
|
|
|
return input_event;
|
2013-09-03 19:57:05 +00:00
|
|
|
break;
|
2012-11-15 21:35:42 +00:00
|
|
|
case XI_Enter:
|
|
|
|
case XI_Leave:
|
2012-11-20 21:59:20 +00:00
|
|
|
if (((XIEnterEvent *) input_event)->deviceid == META_VIRTUAL_CORE_POINTER_ID)
|
2012-11-20 22:26:19 +00:00
|
|
|
return input_event;
|
2012-07-30 18:57:53 +00:00
|
|
|
break;
|
2013-02-08 23:28:22 +00:00
|
|
|
#ifdef HAVE_XI23
|
2012-07-30 18:57:53 +00:00
|
|
|
case XI_BarrierHit:
|
|
|
|
case XI_BarrierLeave:
|
|
|
|
if (((XIBarrierEvent *) input_event)->deviceid == META_VIRTUAL_CORE_POINTER_ID)
|
|
|
|
return input_event;
|
|
|
|
break;
|
2013-02-08 23:28:22 +00:00
|
|
|
#endif /* HAVE_XI23 */
|
2012-11-15 21:35:42 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2011-06-08 08:27:27 +00:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2011-04-26 12:12:04 +00:00
|
|
|
static void
|
2014-02-23 17:28:51 +00:00
|
|
|
update_focus_window (MetaDisplay *display,
|
|
|
|
MetaWindow *window,
|
|
|
|
Window xwindow,
|
|
|
|
gulong serial,
|
|
|
|
gboolean focused_by_us)
|
2011-04-26 12:12:04 +00:00
|
|
|
{
|
2013-08-12 16:04:34 +00:00
|
|
|
MetaWaylandCompositor *compositor;
|
|
|
|
|
2011-04-26 12:12:04 +00:00
|
|
|
display->focus_serial = serial;
|
2013-12-16 21:01:04 +00:00
|
|
|
display->focused_by_us = focused_by_us;
|
2011-04-26 12:12:04 +00:00
|
|
|
|
2013-08-12 16:04:34 +00:00
|
|
|
if (display->focus_xwindow == xwindow &&
|
|
|
|
display->focus_window == window)
|
2011-04-26 12:12:04 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (display->focus_window)
|
|
|
|
{
|
|
|
|
MetaWindow *previous;
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"%s is now the previous focus window due to being focused out or unmapped\n",
|
|
|
|
display->focus_window->desc);
|
|
|
|
|
|
|
|
/* Make sure that signals handlers invoked by
|
|
|
|
* meta_window_set_focused_internal() don't see
|
|
|
|
* display->focus_window->has_focus == FALSE
|
|
|
|
*/
|
|
|
|
previous = display->focus_window;
|
|
|
|
display->focus_window = NULL;
|
2013-05-24 21:58:55 +00:00
|
|
|
display->focus_xwindow = None;
|
2011-04-26 12:12:04 +00:00
|
|
|
|
|
|
|
meta_window_set_focused_internal (previous, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
display->focus_window = window;
|
2013-05-24 21:58:55 +00:00
|
|
|
display->focus_xwindow = xwindow;
|
2011-04-26 12:12:04 +00:00
|
|
|
|
|
|
|
if (display->focus_window)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_FOCUS, "* Focus --> %s with serial %lu\n",
|
|
|
|
display->focus_window->desc, serial);
|
|
|
|
meta_window_set_focused_internal (display->focus_window, TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
meta_topic (META_DEBUG_FOCUS, "* Focus --> NULL with serial %lu\n", serial);
|
|
|
|
|
2013-08-12 16:04:34 +00:00
|
|
|
if (meta_is_wayland_compositor ())
|
|
|
|
{
|
|
|
|
compositor = meta_wayland_compositor_get_default ();
|
|
|
|
|
2014-02-23 17:28:51 +00:00
|
|
|
if (meta_display_xwindow_is_a_no_focus_window (display, xwindow))
|
2013-08-12 16:04:34 +00:00
|
|
|
meta_wayland_compositor_set_input_focus (compositor, NULL);
|
|
|
|
else if (window && window->surface)
|
|
|
|
meta_wayland_compositor_set_input_focus (compositor, window);
|
|
|
|
else
|
|
|
|
meta_topic (META_DEBUG_FOCUS, "Focus change has no effect, because there is no matching wayland surface");
|
|
|
|
}
|
|
|
|
|
2011-04-26 12:12:04 +00:00
|
|
|
g_object_notify (G_OBJECT (display), "focus-window");
|
|
|
|
meta_display_update_active_window_hint (display);
|
|
|
|
}
|
|
|
|
|
2013-05-23 19:54:39 +00:00
|
|
|
static gboolean
|
|
|
|
timestamp_too_old (MetaDisplay *display,
|
|
|
|
guint32 *timestamp)
|
|
|
|
{
|
|
|
|
/* FIXME: If Soeren's suggestion in bug 151984 is implemented, it will allow
|
|
|
|
* us to sanity check the timestamp here and ensure it doesn't correspond to
|
|
|
|
* a future time (though we would want to rename to
|
|
|
|
* timestamp_too_old_or_in_future).
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (*timestamp == CurrentTime)
|
|
|
|
{
|
|
|
|
*timestamp = meta_display_get_current_time_roundtrip (display);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else if (XSERVER_TIME_IS_BEFORE (*timestamp, display->last_focus_time))
|
|
|
|
{
|
|
|
|
if (XSERVER_TIME_IS_BEFORE (*timestamp, display->last_user_time))
|
|
|
|
return TRUE;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*timestamp = display->last_focus_time;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-02-23 17:28:51 +00:00
|
|
|
request_xserver_input_focus_change (MetaDisplay *display,
|
|
|
|
MetaScreen *screen,
|
|
|
|
MetaWindow *meta_window,
|
|
|
|
Window xwindow,
|
|
|
|
guint32 timestamp)
|
2013-05-23 19:54:39 +00:00
|
|
|
{
|
display: Ensure that we ignore our own focus events for focus predictions
When we set the input focus, we first set the predicted window,
and then try to process focus events. But as XI_FocusOut on the
existing window comes before XI_FocusIn on the new window, we'll
see the focus out on the old window and think the focus is going
to nothing, which makes mutter think the prediction failed.
This didn't really matter as nothing paid attention to the focus
window changing, but with gnome-shell's focus rework, we'll try
and drop keyboard focus in events like these.
Fix this by making sure that we ignore focus window changes of our
own cause when updating the focus window field, by ignoring all
focus events that have a serial the same as the focus request or
lower. Note that if mutter doens't make any requests after the
focus request, this could be racy, as another client could steal
the focus, but mutter would ignore it as the serial was the same.
Bump the serial by making a dummy ChangeProperty request to a
mutter-controlled window in this case.
https://bugzilla.gnome.org/show_bug.cgi?id=701017
2013-05-25 20:09:08 +00:00
|
|
|
gulong serial;
|
2013-05-23 19:54:39 +00:00
|
|
|
|
|
|
|
if (timestamp_too_old (display, ×tamp))
|
|
|
|
return;
|
|
|
|
|
|
|
|
meta_error_trap_push (display);
|
display: Ensure that we ignore our own focus events for focus predictions
When we set the input focus, we first set the predicted window,
and then try to process focus events. But as XI_FocusOut on the
existing window comes before XI_FocusIn on the new window, we'll
see the focus out on the old window and think the focus is going
to nothing, which makes mutter think the prediction failed.
This didn't really matter as nothing paid attention to the focus
window changing, but with gnome-shell's focus rework, we'll try
and drop keyboard focus in events like these.
Fix this by making sure that we ignore focus window changes of our
own cause when updating the focus window field, by ignoring all
focus events that have a serial the same as the focus request or
lower. Note that if mutter doens't make any requests after the
focus request, this could be racy, as another client could steal
the focus, but mutter would ignore it as the serial was the same.
Bump the serial by making a dummy ChangeProperty request to a
mutter-controlled window in this case.
https://bugzilla.gnome.org/show_bug.cgi?id=701017
2013-05-25 20:09:08 +00:00
|
|
|
|
|
|
|
/* In order for mutter to know that the focus request succeeded, we track
|
|
|
|
* the serial of the "focus request" we made, but if we take the serial
|
|
|
|
* of the XSetInputFocus request, then there's no way to determine the
|
|
|
|
* difference between focus events as a result of the SetInputFocus and
|
|
|
|
* focus events that other clients send around the same time. Ensure that
|
|
|
|
* we know which is which by making two requests that the server will
|
|
|
|
* process at the same time.
|
|
|
|
*/
|
|
|
|
meta_display_grab (display);
|
|
|
|
|
|
|
|
serial = XNextRequest (display->xdisplay);
|
2013-05-23 19:54:39 +00:00
|
|
|
|
|
|
|
XSetInputFocus (display->xdisplay,
|
|
|
|
xwindow,
|
|
|
|
RevertToPointerRoot,
|
|
|
|
timestamp);
|
display: Ensure that we ignore our own focus events for focus predictions
When we set the input focus, we first set the predicted window,
and then try to process focus events. But as XI_FocusOut on the
existing window comes before XI_FocusIn on the new window, we'll
see the focus out on the old window and think the focus is going
to nothing, which makes mutter think the prediction failed.
This didn't really matter as nothing paid attention to the focus
window changing, but with gnome-shell's focus rework, we'll try
and drop keyboard focus in events like these.
Fix this by making sure that we ignore focus window changes of our
own cause when updating the focus window field, by ignoring all
focus events that have a serial the same as the focus request or
lower. Note that if mutter doens't make any requests after the
focus request, this could be racy, as another client could steal
the focus, but mutter would ignore it as the serial was the same.
Bump the serial by making a dummy ChangeProperty request to a
mutter-controlled window in this case.
https://bugzilla.gnome.org/show_bug.cgi?id=701017
2013-05-25 20:09:08 +00:00
|
|
|
|
|
|
|
XChangeProperty (display->xdisplay, display->timestamp_pinging_window,
|
|
|
|
display->atom__MUTTER_FOCUS_SET,
|
|
|
|
XA_STRING, 8, PropModeAppend, NULL, 0);
|
|
|
|
|
|
|
|
meta_display_ungrab (display);
|
|
|
|
|
|
|
|
update_focus_window (display,
|
|
|
|
meta_window,
|
2013-05-24 21:58:55 +00:00
|
|
|
xwindow,
|
2013-12-16 21:01:04 +00:00
|
|
|
serial,
|
|
|
|
TRUE);
|
display: Ensure that we ignore our own focus events for focus predictions
When we set the input focus, we first set the predicted window,
and then try to process focus events. But as XI_FocusOut on the
existing window comes before XI_FocusIn on the new window, we'll
see the focus out on the old window and think the focus is going
to nothing, which makes mutter think the prediction failed.
This didn't really matter as nothing paid attention to the focus
window changing, but with gnome-shell's focus rework, we'll try
and drop keyboard focus in events like these.
Fix this by making sure that we ignore focus window changes of our
own cause when updating the focus window field, by ignoring all
focus events that have a serial the same as the focus request or
lower. Note that if mutter doens't make any requests after the
focus request, this could be racy, as another client could steal
the focus, but mutter would ignore it as the serial was the same.
Bump the serial by making a dummy ChangeProperty request to a
mutter-controlled window in this case.
https://bugzilla.gnome.org/show_bug.cgi?id=701017
2013-05-25 20:09:08 +00:00
|
|
|
|
2013-05-23 19:54:39 +00:00
|
|
|
meta_error_trap_pop (display);
|
|
|
|
|
|
|
|
display->last_focus_time = timestamp;
|
|
|
|
display->active_screen = screen;
|
|
|
|
|
|
|
|
if (meta_window == NULL || meta_window != display->autoraise_window)
|
|
|
|
meta_display_remove_autoraise_callback (display);
|
|
|
|
}
|
|
|
|
|
2011-04-26 12:12:04 +00:00
|
|
|
static void
|
|
|
|
handle_window_focus_event (MetaDisplay *display,
|
|
|
|
MetaWindow *window,
|
|
|
|
XIEnterEvent *event,
|
|
|
|
unsigned long serial)
|
|
|
|
{
|
|
|
|
MetaWindow *focus_window;
|
|
|
|
#ifdef WITH_VERBOSE_MODE
|
|
|
|
const char *window_type;
|
|
|
|
|
|
|
|
/* Note the event can be on either the window or the frame,
|
|
|
|
* we focus the frame for shaded windows
|
|
|
|
*/
|
|
|
|
if (window)
|
|
|
|
{
|
|
|
|
if (event->event == window->xwindow)
|
|
|
|
window_type = "client window";
|
|
|
|
else if (window->frame && event->event == window->frame->xwindow)
|
|
|
|
window_type = "frame window";
|
|
|
|
else
|
|
|
|
window_type = "unknown client window";
|
|
|
|
}
|
|
|
|
else if (meta_display_xwindow_is_a_no_focus_window (display, event->event))
|
2014-02-23 17:28:51 +00:00
|
|
|
window_type = "no_focus_window";
|
2011-04-26 12:12:04 +00:00
|
|
|
else if (meta_display_screen_for_root (display, event->event))
|
|
|
|
window_type = "root window";
|
|
|
|
else
|
|
|
|
window_type = "unknown window";
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Focus %s event received on %s 0x%lx (%s) "
|
|
|
|
"mode %s detail %s serial %lu\n",
|
|
|
|
event->evtype == XI_FocusIn ? "in" :
|
|
|
|
event->evtype == XI_FocusOut ? "out" :
|
|
|
|
"???",
|
|
|
|
window ? window->desc : "",
|
|
|
|
event->event, window_type,
|
|
|
|
meta_event_mode_to_string (event->mode),
|
|
|
|
meta_event_detail_to_string (event->mode),
|
|
|
|
event->serial);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* FIXME our pointer tracking is broken; see how
|
|
|
|
* gtk+/gdk/x11/gdkevents-x11.c or XFree86/xc/programs/xterm/misc.c
|
|
|
|
* for how to handle it the correct way. In brief you need to track
|
|
|
|
* pointer focus and regular focus, and handle EnterNotify in
|
|
|
|
* PointerRoot mode with no window manager. However as noted above,
|
|
|
|
* accurate focus tracking will break things because we want to keep
|
|
|
|
* windows "focused" when using keybindings on them, and also we
|
|
|
|
* sometimes "focus" a window by focusing its frame or
|
|
|
|
* no_focus_window; so this all needs rethinking massively.
|
|
|
|
*
|
|
|
|
* My suggestion is to change it so that we clearly separate
|
|
|
|
* actual keyboard focus tracking using the xterm algorithm,
|
|
|
|
* and mutter's "pretend" focus window, and go through all
|
|
|
|
* the code and decide which one should be used in each place;
|
|
|
|
* a hard bit is deciding on a policy for that.
|
|
|
|
*
|
|
|
|
* http://bugzilla.gnome.org/show_bug.cgi?id=90382
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* We ignore grabs, though this is questionable. It may be better to
|
|
|
|
* increase the intelligence of the focus window tracking.
|
|
|
|
*
|
|
|
|
* The problem is that keybindings for windows are done with
|
|
|
|
* XGrabKey, which means focus_window disappears and the front of
|
|
|
|
* the MRU list gets confused from what the user expects once a
|
|
|
|
* keybinding is used.
|
|
|
|
*/
|
|
|
|
|
2012-12-17 02:53:19 +00:00
|
|
|
if (event->mode == XINotifyGrab ||
|
|
|
|
event->mode == XINotifyUngrab ||
|
2011-04-26 12:12:04 +00:00
|
|
|
/* From WindowMaker, ignore all funky pointer root events */
|
2012-12-17 02:53:19 +00:00
|
|
|
event->detail > XINotifyNonlinearVirtual)
|
2011-04-26 12:12:04 +00:00
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Ignoring focus event generated by a grab or other weirdness\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (event->evtype == XI_FocusIn)
|
|
|
|
{
|
|
|
|
display->server_focus_window = event->event;
|
|
|
|
display->server_focus_serial = serial;
|
2013-05-01 21:37:50 +00:00
|
|
|
focus_window = window;
|
2011-04-26 12:12:04 +00:00
|
|
|
}
|
|
|
|
else if (event->evtype == XI_FocusOut)
|
|
|
|
{
|
2012-12-17 02:53:19 +00:00
|
|
|
if (event->detail == XINotifyInferior)
|
2011-04-26 12:12:04 +00:00
|
|
|
{
|
|
|
|
/* This event means the client moved focus to a subwindow */
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Ignoring focus out with NotifyInferior\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
display->server_focus_window = None;
|
|
|
|
display->server_focus_serial = serial;
|
|
|
|
focus_window = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
g_return_if_reached ();
|
|
|
|
|
2013-12-16 21:01:04 +00:00
|
|
|
/* If display->focused_by_us, then the focus_serial will be used only
|
|
|
|
* for a focus change we made and have already accounted for.
|
|
|
|
* (See request_xserver_input_focus_change().) Otherwise, we can get
|
|
|
|
* multiple focus events with the same serial.
|
|
|
|
*/
|
|
|
|
if (display->server_focus_serial > display->focus_serial ||
|
|
|
|
(!display->focused_by_us &&
|
|
|
|
display->server_focus_serial == display->focus_serial))
|
2011-04-26 12:12:04 +00:00
|
|
|
{
|
2013-05-24 21:58:55 +00:00
|
|
|
update_focus_window (display,
|
|
|
|
focus_window,
|
|
|
|
focus_window ? focus_window->xwindow : None,
|
2013-12-16 21:01:04 +00:00
|
|
|
display->server_focus_serial,
|
|
|
|
FALSE);
|
2011-04-26 12:12:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-25 20:13:48 +00:00
|
|
|
static gboolean
|
|
|
|
window_has_xwindow (MetaWindow *window,
|
|
|
|
Window xwindow)
|
|
|
|
{
|
|
|
|
if (window->xwindow == xwindow)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
if (window->frame && window->frame->xwindow == xwindow)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2013-11-19 01:50:56 +00:00
|
|
|
static gboolean
|
2013-10-03 19:29:44 +00:00
|
|
|
meta_display_handle_event (MetaDisplay *display,
|
|
|
|
const ClutterEvent *event)
|
2013-10-03 19:23:24 +00:00
|
|
|
{
|
|
|
|
MetaWindow *window;
|
2014-02-01 16:54:38 +00:00
|
|
|
gboolean bypass_clutter = FALSE, bypass_wayland = FALSE;
|
2014-02-18 02:28:41 +00:00
|
|
|
MetaWaylandCompositor *compositor = NULL;
|
2013-11-18 23:36:39 +00:00
|
|
|
|
|
|
|
/* XXX -- we need to fill this in properly at some point... */
|
|
|
|
gboolean frame_was_receiver = FALSE;
|
2013-11-13 20:41:29 +00:00
|
|
|
|
|
|
|
if (meta_is_wayland_compositor ())
|
|
|
|
{
|
|
|
|
compositor = meta_wayland_compositor_get_default ();
|
|
|
|
meta_wayland_compositor_update (compositor, event);
|
|
|
|
}
|
2013-10-03 19:23:24 +00:00
|
|
|
|
2013-11-18 23:36:39 +00:00
|
|
|
window = get_window_for_event (display, event);
|
2013-10-03 19:23:24 +00:00
|
|
|
|
2013-10-03 19:29:44 +00:00
|
|
|
display->current_time = event->any.time;
|
2013-10-03 19:23:24 +00:00
|
|
|
|
2013-10-03 22:03:53 +00:00
|
|
|
if (window && !window->override_redirect &&
|
|
|
|
(event->type == CLUTTER_KEY_PRESS || event->type == CLUTTER_BUTTON_PRESS))
|
2013-10-03 19:23:24 +00:00
|
|
|
{
|
|
|
|
if (CurrentTime == display->current_time)
|
|
|
|
{
|
|
|
|
/* We can't use missing (i.e. invalid) timestamps to set user time,
|
|
|
|
* nor do we want to use them to sanity check other timestamps.
|
|
|
|
* See bug 313490 for more details.
|
|
|
|
*/
|
|
|
|
meta_warning ("Event has no timestamp! You may be using a broken "
|
|
|
|
"program such as xse. Please ask the authors of that "
|
|
|
|
"program to fix it.\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
meta_window_set_user_time (window, display->current_time);
|
|
|
|
sanity_check_timestamps (display, display->current_time);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-03 19:29:44 +00:00
|
|
|
switch (event->type)
|
2013-10-03 19:23:24 +00:00
|
|
|
{
|
2013-10-03 19:29:44 +00:00
|
|
|
case CLUTTER_BUTTON_PRESS:
|
2013-10-03 19:23:24 +00:00
|
|
|
if (display->grab_op == META_GRAB_OP_COMPOSITOR)
|
|
|
|
break;
|
|
|
|
|
|
|
|
display->overlay_key_only_pressed = FALSE;
|
|
|
|
|
|
|
|
if ((window &&
|
|
|
|
meta_grab_op_is_mouse (display->grab_op) &&
|
2013-10-03 19:29:44 +00:00
|
|
|
(event->button.modifier_state & display->window_grab_modifiers) &&
|
|
|
|
display->grab_button != (int) event->button.button &&
|
2013-10-03 19:23:24 +00:00
|
|
|
display->grab_window == window) ||
|
|
|
|
grab_op_is_keyboard (display->grab_op))
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Ending grab op %u on window %s due to button press\n",
|
|
|
|
display->grab_op,
|
|
|
|
(display->grab_window ?
|
|
|
|
display->grab_window->desc :
|
|
|
|
"none"));
|
|
|
|
if (GRAB_OP_IS_WINDOW_SWITCH (display->grab_op))
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Syncing to old stack positions.\n");
|
|
|
|
|
2013-10-03 19:29:44 +00:00
|
|
|
/* XXX: I'm not sure if this is the right thing to do.
|
|
|
|
The pre-Wayland code was only calling
|
|
|
|
meta_stack_set_positions if the modified window was a
|
|
|
|
root window */
|
|
|
|
if (event->any.source == CLUTTER_ACTOR (event->any.stage) && window && window->screen)
|
|
|
|
meta_stack_set_positions (window->screen->stack,
|
2013-10-03 19:23:24 +00:00
|
|
|
display->grab_old_window_stacking);
|
|
|
|
}
|
2014-02-01 16:54:38 +00:00
|
|
|
meta_display_end_grab_op (display, event->any.time);
|
|
|
|
bypass_clutter = TRUE;
|
|
|
|
bypass_wayland = TRUE;
|
2013-10-03 19:23:24 +00:00
|
|
|
}
|
|
|
|
else if (window && display->grab_op == META_GRAB_OP_NONE)
|
|
|
|
{
|
|
|
|
gboolean begin_move = FALSE;
|
2013-10-03 19:29:44 +00:00
|
|
|
ClutterModifierType grab_mask;
|
2013-10-03 19:23:24 +00:00
|
|
|
gboolean unmodified;
|
|
|
|
|
|
|
|
grab_mask = display->window_grab_modifiers;
|
|
|
|
if (g_getenv ("MUTTER_DEBUG_BUTTON_GRABS"))
|
2013-10-03 19:29:44 +00:00
|
|
|
grab_mask |= CLUTTER_CONTROL_MASK;
|
2013-10-03 19:23:24 +00:00
|
|
|
|
|
|
|
/* Two possible sources of an unmodified event; one is a
|
|
|
|
* client that's letting button presses pass through to the
|
|
|
|
* frame, the other is our focus_window_grab on unmodified
|
|
|
|
* button 1. So for all such events we focus the window.
|
|
|
|
*/
|
2013-10-03 19:29:44 +00:00
|
|
|
unmodified = (event->button.modifier_state & grab_mask) == 0;
|
2013-10-03 19:23:24 +00:00
|
|
|
|
|
|
|
if (unmodified ||
|
2013-10-03 19:29:44 +00:00
|
|
|
event->button.button == 1)
|
2013-10-03 19:23:24 +00:00
|
|
|
{
|
|
|
|
/* don't focus if frame received, will be lowered in
|
|
|
|
* frames.c or special-cased if the click was on a
|
|
|
|
* minimize/close button.
|
|
|
|
*/
|
|
|
|
if (!frame_was_receiver)
|
|
|
|
{
|
|
|
|
if (meta_prefs_get_raise_on_click ())
|
|
|
|
meta_window_raise (window);
|
|
|
|
else
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Not raising window on click due to don't-raise-on-click option\n");
|
|
|
|
|
|
|
|
/* Don't focus panels--they must explicitly request focus.
|
|
|
|
* See bug 160470
|
|
|
|
*/
|
|
|
|
if (window->type != META_WINDOW_DOCK)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Focusing %s due to unmodified button %u press (display.c)\n",
|
2013-10-03 19:29:44 +00:00
|
|
|
window->desc, event->button.button);
|
|
|
|
meta_window_focus (window, event->any.time);
|
2013-10-03 19:23:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
/* However, do allow terminals to lose focus due to new
|
|
|
|
* window mappings after the user clicks on a panel.
|
|
|
|
*/
|
|
|
|
display->allow_terminal_deactivation = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* you can move on alt-click but not on
|
|
|
|
* the click-to-focus
|
|
|
|
*/
|
|
|
|
if (!unmodified)
|
|
|
|
begin_move = TRUE;
|
|
|
|
}
|
2013-10-03 19:29:44 +00:00
|
|
|
else if (!unmodified && ((int) event->button.button == meta_prefs_get_mouse_button_resize ()))
|
2013-10-03 19:23:24 +00:00
|
|
|
{
|
|
|
|
if (window->has_resize_func)
|
|
|
|
{
|
|
|
|
gboolean north, south;
|
|
|
|
gboolean west, east;
|
2013-11-15 21:11:20 +00:00
|
|
|
MetaRectangle frame_rect;
|
2013-10-03 19:23:24 +00:00
|
|
|
MetaGrabOp op;
|
|
|
|
|
2013-11-19 17:24:45 +00:00
|
|
|
meta_window_get_frame_rect (window, &frame_rect);
|
2013-10-03 19:23:24 +00:00
|
|
|
|
2013-11-15 21:11:20 +00:00
|
|
|
west = event->button.x < (frame_rect.x + 1 * frame_rect.width / 3);
|
|
|
|
east = event->button.x > (frame_rect.x + 2 * frame_rect.width / 3);
|
|
|
|
north = event->button.y < (frame_rect.y + 1 * frame_rect.height / 3);
|
|
|
|
south = event->button.y > (frame_rect.y + 2 * frame_rect.height / 3);
|
2013-10-03 19:23:24 +00:00
|
|
|
|
|
|
|
if (north && west)
|
|
|
|
op = META_GRAB_OP_RESIZING_NW;
|
|
|
|
else if (north && east)
|
|
|
|
op = META_GRAB_OP_RESIZING_NE;
|
|
|
|
else if (south && west)
|
|
|
|
op = META_GRAB_OP_RESIZING_SW;
|
|
|
|
else if (south && east)
|
|
|
|
op = META_GRAB_OP_RESIZING_SE;
|
|
|
|
else if (north)
|
|
|
|
op = META_GRAB_OP_RESIZING_N;
|
|
|
|
else if (west)
|
|
|
|
op = META_GRAB_OP_RESIZING_W;
|
|
|
|
else if (east)
|
|
|
|
op = META_GRAB_OP_RESIZING_E;
|
|
|
|
else if (south)
|
|
|
|
op = META_GRAB_OP_RESIZING_S;
|
|
|
|
else /* Middle region is no-op to avoid user triggering wrong action */
|
|
|
|
op = META_GRAB_OP_NONE;
|
|
|
|
|
|
|
|
if (op != META_GRAB_OP_NONE)
|
|
|
|
meta_display_begin_grab_op (display,
|
|
|
|
window->screen,
|
|
|
|
window,
|
|
|
|
op,
|
|
|
|
TRUE,
|
|
|
|
FALSE,
|
2013-10-03 19:29:44 +00:00
|
|
|
event->button.button,
|
2013-10-03 19:23:24 +00:00
|
|
|
0,
|
2013-10-03 19:29:44 +00:00
|
|
|
event->any.time,
|
|
|
|
event->button.x,
|
|
|
|
event->button.y);
|
2013-10-03 19:23:24 +00:00
|
|
|
}
|
|
|
|
}
|
2013-10-03 19:29:44 +00:00
|
|
|
else if ((int) event->button.button == meta_prefs_get_mouse_button_menu ())
|
2013-10-03 19:23:24 +00:00
|
|
|
{
|
|
|
|
if (meta_prefs_get_raise_on_click ())
|
|
|
|
meta_window_raise (window);
|
|
|
|
meta_window_show_menu (window,
|
2013-10-03 19:29:44 +00:00
|
|
|
event->button.x,
|
|
|
|
event->button.y,
|
|
|
|
event->button.button,
|
|
|
|
event->any.time);
|
2014-02-01 16:54:38 +00:00
|
|
|
bypass_clutter = TRUE;
|
|
|
|
bypass_wayland = TRUE;
|
2013-10-03 19:23:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (begin_move && window->has_move_func)
|
|
|
|
{
|
|
|
|
meta_display_begin_grab_op (display,
|
|
|
|
window->screen,
|
|
|
|
window,
|
|
|
|
META_GRAB_OP_MOVING,
|
|
|
|
TRUE,
|
|
|
|
FALSE,
|
2013-10-03 19:29:44 +00:00
|
|
|
event->button.button,
|
2013-10-03 19:23:24 +00:00
|
|
|
0,
|
2013-10-03 19:29:44 +00:00
|
|
|
event->any.time,
|
|
|
|
event->button.x,
|
|
|
|
event->button.y);
|
2014-02-01 16:54:38 +00:00
|
|
|
bypass_clutter = TRUE;
|
|
|
|
bypass_wayland = TRUE;
|
2013-10-03 19:23:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2013-10-03 19:29:44 +00:00
|
|
|
case CLUTTER_BUTTON_RELEASE:
|
2013-10-03 19:23:24 +00:00
|
|
|
if (display->grab_op == META_GRAB_OP_COMPOSITOR)
|
|
|
|
break;
|
|
|
|
|
|
|
|
display->overlay_key_only_pressed = FALSE;
|
|
|
|
|
|
|
|
if (display->grab_window == window &&
|
|
|
|
meta_grab_op_is_mouse (display->grab_op))
|
2014-02-01 16:54:38 +00:00
|
|
|
{
|
|
|
|
meta_window_handle_mouse_grab_op_event (window, event);
|
|
|
|
bypass_clutter = TRUE;
|
|
|
|
bypass_wayland = TRUE;
|
|
|
|
}
|
2013-10-03 19:23:24 +00:00
|
|
|
break;
|
2013-10-03 19:29:44 +00:00
|
|
|
case CLUTTER_MOTION:
|
2013-10-03 19:23:24 +00:00
|
|
|
if (display->grab_op == META_GRAB_OP_COMPOSITOR)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (display->grab_window == window &&
|
|
|
|
meta_grab_op_is_mouse (display->grab_op))
|
2014-02-01 16:54:38 +00:00
|
|
|
{
|
|
|
|
meta_window_handle_mouse_grab_op_event (window, event);
|
|
|
|
bypass_clutter = TRUE;
|
|
|
|
bypass_wayland = TRUE;
|
|
|
|
}
|
2013-10-03 19:29:44 +00:00
|
|
|
break;
|
|
|
|
|
2013-10-03 22:03:53 +00:00
|
|
|
case CLUTTER_KEY_PRESS:
|
|
|
|
case CLUTTER_KEY_RELEASE:
|
|
|
|
/* For key events, it's important to enforce single-handling, or
|
|
|
|
* we can get into a confused state. So if a keybinding is
|
|
|
|
* handled (because it's one of our hot-keys, or because we are
|
|
|
|
* in a keyboard-grabbed mode like moving a window, we don't
|
2013-10-04 06:29:43 +00:00
|
|
|
* want to pass the key event to the compositor or Wayland at all.
|
2013-10-03 22:03:53 +00:00
|
|
|
*/
|
|
|
|
if (meta_display_process_key_event (display, window, (ClutterKeyEvent *) event))
|
2014-02-01 16:54:38 +00:00
|
|
|
{
|
|
|
|
bypass_clutter = TRUE;
|
|
|
|
bypass_wayland = TRUE;
|
|
|
|
}
|
2013-10-03 22:03:53 +00:00
|
|
|
|
2013-10-03 19:29:44 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2014-02-01 16:54:38 +00:00
|
|
|
/* If the compositor has a grab, don't pass that through to Wayland */
|
|
|
|
if (display->grab_op == META_GRAB_OP_COMPOSITOR)
|
|
|
|
bypass_wayland = TRUE;
|
|
|
|
|
|
|
|
if (compositor && !bypass_wayland)
|
2013-10-04 06:29:43 +00:00
|
|
|
{
|
|
|
|
if (meta_wayland_compositor_handle_event (compositor, event))
|
2014-02-01 16:54:38 +00:00
|
|
|
bypass_clutter = TRUE;
|
2013-10-04 06:29:43 +00:00
|
|
|
}
|
|
|
|
|
2014-02-01 16:54:38 +00:00
|
|
|
return bypass_clutter;
|
2013-10-03 19:29:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
handle_input_xevent (MetaDisplay *display,
|
|
|
|
XIEvent *input_event,
|
|
|
|
gulong serial)
|
|
|
|
{
|
2013-12-05 21:13:03 +00:00
|
|
|
XIDeviceEvent *device_event = (XIDeviceEvent *) input_event;
|
2013-10-03 19:29:44 +00:00
|
|
|
XIEnterEvent *enter_event = (XIEnterEvent *) input_event;
|
|
|
|
Window modified;
|
|
|
|
MetaWindow *window;
|
2013-12-05 21:13:03 +00:00
|
|
|
gboolean frame_was_receiver;
|
2014-02-26 00:48:34 +00:00
|
|
|
MetaScreen *screen;
|
2013-10-03 19:29:44 +00:00
|
|
|
|
|
|
|
if (input_event == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
2014-02-26 00:48:34 +00:00
|
|
|
screen = meta_display_screen_for_root (display, device_event->root);
|
|
|
|
|
2013-10-03 19:29:44 +00:00
|
|
|
modified = xievent_get_modified_window (display, input_event);
|
|
|
|
window = modified != None ? meta_display_lookup_x_window (display, modified) : NULL;
|
|
|
|
|
2013-12-05 21:13:03 +00:00
|
|
|
frame_was_receiver = FALSE;
|
|
|
|
if (window &&
|
|
|
|
window->frame &&
|
|
|
|
modified == window->frame->xwindow)
|
|
|
|
{
|
|
|
|
/* Note that if the frame and the client both have an
|
|
|
|
* XGrabButton (as is normal with our setup), the event
|
|
|
|
* goes to the frame.
|
|
|
|
*/
|
|
|
|
frame_was_receiver = TRUE;
|
|
|
|
meta_topic (META_DEBUG_EVENTS, "Frame was receiver of event for %s\n",
|
|
|
|
window->desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (window && !window->override_redirect &&
|
|
|
|
(input_event->evtype == XI_KeyPress || input_event->evtype == XI_ButtonPress))
|
|
|
|
{
|
|
|
|
if (CurrentTime == display->current_time)
|
|
|
|
{
|
|
|
|
/* We can't use missing (i.e. invalid) timestamps to set user time,
|
|
|
|
* nor do we want to use them to sanity check other timestamps.
|
|
|
|
* See bug 313490 for more details.
|
|
|
|
*/
|
|
|
|
meta_warning ("Event has no timestamp! You may be using a broken "
|
|
|
|
"program such as xse. Please ask the authors of that "
|
|
|
|
"program to fix it.\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
meta_window_set_user_time (window, display->current_time);
|
|
|
|
sanity_check_timestamps (display, display->current_time);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-03 19:29:44 +00:00
|
|
|
switch (input_event->evtype)
|
|
|
|
{
|
2013-12-05 21:13:03 +00:00
|
|
|
case XI_ButtonPress:
|
|
|
|
if (display->grab_op == META_GRAB_OP_COMPOSITOR)
|
|
|
|
break;
|
|
|
|
|
|
|
|
display->overlay_key_only_pressed = FALSE;
|
|
|
|
|
|
|
|
if (device_event->detail == 4 || device_event->detail == 5)
|
|
|
|
/* Scrollwheel event, do nothing and deliver event to compositor below */
|
|
|
|
break;
|
|
|
|
|
|
|
|
if ((window &&
|
|
|
|
meta_grab_op_is_mouse (display->grab_op) &&
|
|
|
|
(device_event->mods.effective & display->window_grab_modifiers) &&
|
|
|
|
display->grab_button != device_event->detail &&
|
|
|
|
display->grab_window == window) ||
|
|
|
|
grab_op_is_keyboard (display->grab_op))
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Ending grab op %u on window %s due to button press\n",
|
|
|
|
display->grab_op,
|
|
|
|
(display->grab_window ?
|
|
|
|
display->grab_window->desc :
|
|
|
|
"none"));
|
|
|
|
if (GRAB_OP_IS_WINDOW_SWITCH (display->grab_op))
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Syncing to old stack positions.\n");
|
|
|
|
|
2014-02-26 00:48:34 +00:00
|
|
|
if (device_event->root == device_event->event)
|
2013-12-05 21:13:03 +00:00
|
|
|
meta_stack_set_positions (screen->stack,
|
|
|
|
display->grab_old_window_stacking);
|
|
|
|
}
|
|
|
|
meta_display_end_grab_op (display,
|
|
|
|
device_event->time);
|
|
|
|
}
|
|
|
|
else if (window && display->grab_op == META_GRAB_OP_NONE)
|
|
|
|
{
|
|
|
|
gboolean begin_move = FALSE;
|
|
|
|
unsigned int grab_mask;
|
|
|
|
gboolean unmodified;
|
|
|
|
|
|
|
|
grab_mask = display->window_grab_modifiers;
|
|
|
|
if (g_getenv ("MUTTER_DEBUG_BUTTON_GRABS"))
|
|
|
|
grab_mask |= ControlMask;
|
|
|
|
|
|
|
|
/* Two possible sources of an unmodified event; one is a
|
|
|
|
* client that's letting button presses pass through to the
|
|
|
|
* frame, the other is our focus_window_grab on unmodified
|
|
|
|
* button 1. So for all such events we focus the window.
|
|
|
|
*/
|
|
|
|
unmodified = (device_event->mods.effective & grab_mask) == 0;
|
|
|
|
|
|
|
|
if (unmodified ||
|
|
|
|
device_event->detail == 1)
|
|
|
|
{
|
|
|
|
/* don't focus if frame received, will be lowered in
|
|
|
|
* frames.c or special-cased if the click was on a
|
|
|
|
* minimize/close button.
|
|
|
|
*/
|
|
|
|
if (!frame_was_receiver)
|
|
|
|
{
|
|
|
|
if (meta_prefs_get_raise_on_click ())
|
|
|
|
meta_window_raise (window);
|
|
|
|
else
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Not raising window on click due to don't-raise-on-click option\n");
|
|
|
|
|
|
|
|
/* Don't focus panels--they must explicitly request focus.
|
|
|
|
* See bug 160470
|
|
|
|
*/
|
|
|
|
if (window->type != META_WINDOW_DOCK)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Focusing %s due to unmodified button %u press (display.c)\n",
|
|
|
|
window->desc, device_event->detail);
|
|
|
|
meta_window_focus (window, device_event->time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* However, do allow terminals to lose focus due to new
|
|
|
|
* window mappings after the user clicks on a panel.
|
|
|
|
*/
|
|
|
|
display->allow_terminal_deactivation = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* you can move on alt-click but not on
|
|
|
|
* the click-to-focus
|
|
|
|
*/
|
|
|
|
if (!unmodified)
|
|
|
|
begin_move = TRUE;
|
|
|
|
}
|
|
|
|
else if (!unmodified && device_event->detail == meta_prefs_get_mouse_button_resize())
|
|
|
|
{
|
|
|
|
if (window->has_resize_func)
|
|
|
|
{
|
|
|
|
gboolean north, south;
|
|
|
|
gboolean west, east;
|
|
|
|
MetaRectangle frame_rect;
|
|
|
|
MetaGrabOp op;
|
|
|
|
|
|
|
|
meta_window_get_frame_rect (window, &frame_rect);
|
|
|
|
|
|
|
|
west = device_event->root_x < (frame_rect.x + 1 * frame_rect.width / 3);
|
|
|
|
east = device_event->root_x > (frame_rect.x + 2 * frame_rect.width / 3);
|
|
|
|
north = device_event->root_y < (frame_rect.y + 1 * frame_rect.height / 3);
|
|
|
|
south = device_event->root_y > (frame_rect.y + 2 * frame_rect.height / 3);
|
|
|
|
|
|
|
|
if (north && west)
|
|
|
|
op = META_GRAB_OP_RESIZING_NW;
|
|
|
|
else if (north && east)
|
|
|
|
op = META_GRAB_OP_RESIZING_NE;
|
|
|
|
else if (south && west)
|
|
|
|
op = META_GRAB_OP_RESIZING_SW;
|
|
|
|
else if (south && east)
|
|
|
|
op = META_GRAB_OP_RESIZING_SE;
|
|
|
|
else if (north)
|
|
|
|
op = META_GRAB_OP_RESIZING_N;
|
|
|
|
else if (west)
|
|
|
|
op = META_GRAB_OP_RESIZING_W;
|
|
|
|
else if (east)
|
|
|
|
op = META_GRAB_OP_RESIZING_E;
|
|
|
|
else if (south)
|
|
|
|
op = META_GRAB_OP_RESIZING_S;
|
|
|
|
else /* Middle region is no-op to avoid user triggering wrong action */
|
|
|
|
op = META_GRAB_OP_NONE;
|
|
|
|
|
|
|
|
if (op != META_GRAB_OP_NONE)
|
2014-02-26 00:41:18 +00:00
|
|
|
{
|
|
|
|
meta_display_begin_grab_op (display,
|
|
|
|
window->screen,
|
|
|
|
window,
|
|
|
|
op,
|
|
|
|
TRUE,
|
|
|
|
FALSE,
|
|
|
|
device_event->detail,
|
|
|
|
0,
|
|
|
|
device_event->time,
|
|
|
|
device_event->root_x,
|
|
|
|
device_event->root_y);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2013-12-05 21:13:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (device_event->detail == meta_prefs_get_mouse_button_menu())
|
|
|
|
{
|
|
|
|
if (meta_prefs_get_raise_on_click ())
|
|
|
|
meta_window_raise (window);
|
|
|
|
meta_window_show_menu (window,
|
|
|
|
device_event->root_x,
|
|
|
|
device_event->root_y,
|
|
|
|
device_event->detail,
|
|
|
|
device_event->time);
|
2014-02-26 00:41:18 +00:00
|
|
|
return TRUE;
|
2013-12-05 21:13:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!frame_was_receiver && unmodified)
|
|
|
|
{
|
|
|
|
/* This is from our synchronous grab since
|
|
|
|
* it has no modifiers and was on the client window
|
|
|
|
*/
|
|
|
|
|
|
|
|
meta_verbose ("Allowing events time %u\n",
|
|
|
|
(unsigned int)device_event->time);
|
|
|
|
|
|
|
|
XIAllowEvents (display->xdisplay, device_event->deviceid,
|
|
|
|
XIReplayDevice, device_event->time);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (begin_move && window->has_move_func)
|
|
|
|
{
|
|
|
|
meta_display_begin_grab_op (display,
|
|
|
|
window->screen,
|
|
|
|
window,
|
|
|
|
META_GRAB_OP_MOVING,
|
|
|
|
TRUE,
|
|
|
|
FALSE,
|
|
|
|
device_event->detail,
|
|
|
|
0,
|
|
|
|
device_event->time,
|
|
|
|
device_event->root_x,
|
|
|
|
device_event->root_y);
|
2014-02-26 00:41:18 +00:00
|
|
|
return TRUE;
|
2013-12-05 21:13:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case XI_ButtonRelease:
|
|
|
|
if (display->grab_op == META_GRAB_OP_COMPOSITOR)
|
|
|
|
break;
|
|
|
|
|
|
|
|
display->overlay_key_only_pressed = FALSE;
|
|
|
|
|
|
|
|
if (display->grab_window == window &&
|
|
|
|
meta_grab_op_is_mouse (display->grab_op))
|
2014-02-26 00:41:18 +00:00
|
|
|
{
|
|
|
|
meta_window_handle_mouse_grab_op_xevent (window, device_event);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2013-12-05 21:13:03 +00:00
|
|
|
break;
|
|
|
|
case XI_Motion:
|
|
|
|
if (display->grab_op == META_GRAB_OP_COMPOSITOR)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (display->grab_window == window &&
|
|
|
|
meta_grab_op_is_mouse (display->grab_op))
|
2014-02-26 00:41:18 +00:00
|
|
|
{
|
|
|
|
meta_window_handle_mouse_grab_op_xevent (window, device_event);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2013-12-05 21:13:03 +00:00
|
|
|
break;
|
2013-10-03 19:23:24 +00:00
|
|
|
case XI_Enter:
|
|
|
|
if (display->grab_op == META_GRAB_OP_COMPOSITOR)
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* If the mouse switches screens, active the default window on the new
|
|
|
|
* screen; this will make keybindings and workspace-launched items
|
|
|
|
* actually appear on the right screen.
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
MetaScreen *new_screen =
|
|
|
|
meta_display_screen_for_root (display, enter_event->root);
|
|
|
|
|
|
|
|
if (new_screen != NULL && display->active_screen != new_screen)
|
|
|
|
meta_workspace_focus_default_window (new_screen->active_workspace,
|
|
|
|
NULL,
|
|
|
|
enter_event->time);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check if we've entered a window; do this even if window->has_focus to
|
|
|
|
* avoid races.
|
|
|
|
*/
|
|
|
|
if (window && !crossing_serial_is_ignored (display, serial) &&
|
|
|
|
enter_event->mode != XINotifyGrab &&
|
|
|
|
enter_event->mode != XINotifyUngrab &&
|
|
|
|
enter_event->detail != XINotifyInferior &&
|
|
|
|
meta_display_focus_sentinel_clear (display))
|
|
|
|
{
|
2013-10-16 04:06:10 +00:00
|
|
|
meta_window_handle_enter (window,
|
|
|
|
enter_event->time,
|
|
|
|
enter_event->root_x,
|
|
|
|
enter_event->root_y);
|
2013-10-03 19:23:24 +00:00
|
|
|
|
|
|
|
if (window->type == META_WINDOW_DOCK)
|
|
|
|
meta_window_raise (window);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case XI_Leave:
|
|
|
|
if (display->grab_op == META_GRAB_OP_COMPOSITOR)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (window != NULL)
|
|
|
|
{
|
|
|
|
if (window->type == META_WINDOW_DOCK &&
|
|
|
|
enter_event->mode != XINotifyGrab &&
|
|
|
|
enter_event->mode != XINotifyUngrab &&
|
|
|
|
!window->has_focus)
|
|
|
|
meta_window_lower (window);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case XI_FocusIn:
|
|
|
|
case XI_FocusOut:
|
|
|
|
handle_window_focus_event (display, window, enter_event, serial);
|
|
|
|
if (!window)
|
|
|
|
{
|
|
|
|
/* Check if the window is a root window. */
|
2014-02-26 00:48:34 +00:00
|
|
|
if (enter_event->root == enter_event->event)
|
2013-10-03 19:23:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
if (enter_event->evtype == XI_FocusIn &&
|
|
|
|
enter_event->mode == XINotifyDetailNone)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Focus got set to None, probably due to "
|
|
|
|
"brain-damage in the X protocol (see bug "
|
|
|
|
"125492). Setting the default focus window.\n");
|
|
|
|
meta_workspace_focus_default_window (screen->active_workspace,
|
|
|
|
NULL,
|
|
|
|
meta_display_get_current_time_roundtrip (display));
|
|
|
|
}
|
|
|
|
else if (enter_event->evtype == XI_FocusIn &&
|
|
|
|
enter_event->mode == XINotifyNormal &&
|
|
|
|
enter_event->detail == XINotifyInferior)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Focus got set to root window, probably due to "
|
|
|
|
"gnome-session logout dialog usage (see bug "
|
|
|
|
"153220). Setting the default focus window.\n");
|
|
|
|
meta_workspace_focus_default_window (screen->active_workspace,
|
|
|
|
NULL,
|
|
|
|
meta_display_get_current_time_roundtrip (display));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2014-02-26 00:41:18 +00:00
|
|
|
|
|
|
|
/* Don't send FocusIn / FocusOut to Clutter */
|
|
|
|
return TRUE;
|
2013-10-03 19:23:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2013-09-04 09:11:39 +00:00
|
|
|
static void
|
|
|
|
reload_xkb_rules (MetaScreen *screen)
|
|
|
|
{
|
|
|
|
MetaWaylandCompositor *compositor;
|
|
|
|
char **names;
|
|
|
|
int n_names;
|
|
|
|
gboolean ok;
|
|
|
|
const char *rules, *model, *layout, *variant, *options;
|
|
|
|
|
|
|
|
compositor = meta_wayland_compositor_get_default ();
|
|
|
|
|
|
|
|
ok = meta_prop_get_latin1_list (screen->display, screen->xroot,
|
|
|
|
screen->display->atom__XKB_RULES_NAMES,
|
|
|
|
&names, &n_names);
|
|
|
|
if (!ok)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (n_names != 5)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
rules = names[0];
|
|
|
|
model = names[1];
|
|
|
|
layout = names[2];
|
|
|
|
variant = names[3];
|
|
|
|
options = names[4];
|
|
|
|
|
|
|
|
meta_wayland_keyboard_set_keymap_names (&compositor->seat->keyboard,
|
|
|
|
rules, model, layout, variant, options,
|
|
|
|
META_WAYLAND_KEYBOARD_SKIP_XCLIENTS);
|
|
|
|
|
|
|
|
out:
|
|
|
|
g_strfreev (names);
|
|
|
|
}
|
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
static gboolean
|
|
|
|
handle_other_xevent (MetaDisplay *display,
|
|
|
|
XEvent *event)
|
2001-05-30 15:36:31 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
Window modified;
|
2001-05-30 15:36:31 +00:00
|
|
|
MetaWindow *window;
|
2007-03-31 05:19:41 +00:00
|
|
|
MetaWindow *property_for_window;
|
2001-07-11 06:22:00 +00:00
|
|
|
gboolean frame_was_receiver;
|
2013-10-03 21:13:48 +00:00
|
|
|
gboolean bypass_gtk = FALSE;
|
2013-08-13 10:57:41 +00:00
|
|
|
|
2002-03-02 15:26:07 +00:00
|
|
|
modified = event_get_modified_window (display, event);
|
2013-10-03 21:13:48 +00:00
|
|
|
window = modified != None ? meta_display_lookup_x_window (display, modified) : NULL;
|
|
|
|
frame_was_receiver = (window && window->frame && modified == window->frame->xwindow);
|
2001-07-11 06:22:00 +00:00
|
|
|
|
2007-03-31 05:19:41 +00:00
|
|
|
/* We only want to respond to _NET_WM_USER_TIME property notify
|
|
|
|
* events on _NET_WM_USER_TIME_WINDOW windows; in particular,
|
|
|
|
* responding to UnmapNotify events is kind of bad.
|
|
|
|
*/
|
|
|
|
property_for_window = NULL;
|
|
|
|
if (window && modified == window->user_time_window)
|
|
|
|
{
|
|
|
|
property_for_window = window;
|
|
|
|
window = NULL;
|
|
|
|
}
|
|
|
|
|
2002-12-10 03:23:04 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
2011-06-08 15:26:03 +00:00
|
|
|
if (META_DISPLAY_HAS_XSYNC (display) &&
|
|
|
|
event->type == (display->xsync_event_base + XSyncAlarmNotify))
|
2002-12-10 03:23:04 +00:00
|
|
|
{
|
2011-06-08 15:26:03 +00:00
|
|
|
MetaWindow *alarm_window = meta_display_lookup_sync_alarm (display,
|
|
|
|
((XSyncAlarmNotifyEvent*)event)->alarm);
|
|
|
|
|
|
|
|
if (alarm_window != NULL)
|
|
|
|
{
|
|
|
|
XSyncValue value = ((XSyncAlarmNotifyEvent*)event)->counter_value;
|
2011-06-08 17:58:54 +00:00
|
|
|
gint64 new_counter_value;
|
2011-06-08 15:26:03 +00:00
|
|
|
new_counter_value = XSyncValueLow32 (value) + ((gint64)XSyncValueHigh32 (value) << 32);
|
|
|
|
meta_window_update_sync_request_counter (alarm_window, new_counter_value);
|
2013-10-03 20:56:24 +00:00
|
|
|
bypass_gtk = TRUE; /* GTK doesn't want to see this really */
|
2011-06-08 15:26:03 +00:00
|
|
|
}
|
2013-08-14 11:51:05 +00:00
|
|
|
else
|
|
|
|
meta_idle_monitor_handle_xevent_all (event);
|
2013-10-03 20:12:34 +00:00
|
|
|
|
|
|
|
goto out;
|
2002-12-10 03:23:04 +00:00
|
|
|
}
|
|
|
|
#endif /* HAVE_XSYNC */
|
2003-01-05 07:51:02 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_SHAPE
|
|
|
|
if (META_DISPLAY_HAS_SHAPE (display) &&
|
|
|
|
event->type == (display->shape_event_base + ShapeNotify))
|
|
|
|
{
|
2013-10-03 20:56:24 +00:00
|
|
|
bypass_gtk = TRUE; /* GTK doesn't want to see this really */
|
2003-01-05 07:51:02 +00:00
|
|
|
|
|
|
|
if (window && !frame_was_receiver)
|
|
|
|
{
|
|
|
|
XShapeEvent *sev = (XShapeEvent*) event;
|
|
|
|
|
|
|
|
if (sev->kind == ShapeBounding)
|
2014-01-23 21:33:53 +00:00
|
|
|
meta_window_x11_update_shape_region (window);
|
2012-01-19 01:20:02 +00:00
|
|
|
else if (sev->kind == ShapeInput)
|
2014-01-23 21:33:53 +00:00
|
|
|
meta_window_x11_update_input_region (window);
|
2003-01-05 07:51:02 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_SHAPES,
|
|
|
|
"ShapeNotify not on a client window (window %s frame_was_receiver = %d)\n",
|
|
|
|
window ? window->desc : "(none)",
|
|
|
|
frame_was_receiver);
|
|
|
|
}
|
2013-10-03 20:12:34 +00:00
|
|
|
|
|
|
|
goto out;
|
2003-01-05 07:51:02 +00:00
|
|
|
}
|
|
|
|
#endif /* HAVE_SHAPE */
|
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 15:47:05 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
switch (event->type)
|
2013-10-03 19:22:26 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
case KeymapNotify:
|
|
|
|
break;
|
|
|
|
case Expose:
|
|
|
|
break;
|
|
|
|
case GraphicsExpose:
|
|
|
|
break;
|
|
|
|
case NoExpose:
|
|
|
|
break;
|
|
|
|
case VisibilityNotify:
|
|
|
|
break;
|
|
|
|
case CreateNotify:
|
|
|
|
{
|
|
|
|
MetaScreen *screen;
|
2013-10-03 19:22:26 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
screen = meta_display_screen_for_root (display,
|
|
|
|
event->xcreatewindow.parent);
|
|
|
|
if (screen)
|
|
|
|
meta_stack_tracker_create_event (screen->stack_tracker,
|
|
|
|
&event->xcreatewindow);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DestroyNotify:
|
|
|
|
{
|
|
|
|
MetaScreen *screen;
|
|
|
|
|
|
|
|
screen = meta_display_screen_for_root (display,
|
|
|
|
event->xdestroywindow.event);
|
|
|
|
if (screen)
|
|
|
|
meta_stack_tracker_destroy_event (screen->stack_tracker,
|
|
|
|
&event->xdestroywindow);
|
|
|
|
}
|
|
|
|
if (window)
|
2001-06-04 06:17:52 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
/* FIXME: It sucks that DestroyNotify events don't come with
|
|
|
|
* a timestamp; could we do something better here? Maybe X
|
|
|
|
* will change one day?
|
|
|
|
*/
|
|
|
|
guint32 timestamp;
|
|
|
|
timestamp = meta_display_get_current_time_roundtrip (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 17:27:24 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
if (display->grab_op != META_GRAB_OP_NONE &&
|
|
|
|
display->grab_window == window)
|
|
|
|
meta_display_end_grab_op (display, timestamp);
|
2011-06-08 08:27:27 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
if (frame_was_receiver)
|
2001-06-11 03:24:20 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
meta_warning ("Unexpected destruction of frame 0x%lx, not sure if this should silently fail or be considered a bug\n",
|
|
|
|
window->frame->xwindow);
|
|
|
|
meta_error_trap_push (display);
|
|
|
|
meta_window_destroy_frame (window->frame->window);
|
|
|
|
meta_error_trap_pop (display);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Unmanage destroyed window */
|
|
|
|
meta_window_unmanage (window, timestamp);
|
|
|
|
window = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case UnmapNotify:
|
|
|
|
if (window)
|
|
|
|
{
|
|
|
|
/* FIXME: It sucks that UnmapNotify events don't come with
|
|
|
|
* a timestamp; could we do something better here? Maybe X
|
|
|
|
* will change one day?
|
|
|
|
*/
|
|
|
|
guint32 timestamp;
|
|
|
|
timestamp = meta_display_get_current_time_roundtrip (display);
|
2006-05-23 20:38:18 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
if (display->grab_op != META_GRAB_OP_NONE &&
|
|
|
|
display->grab_window == window &&
|
Always map the client and frame windows
Traditionally, WMs unmap windows when minimizing them, and map them
when restoring them or wanting to show them for other reasons, like
upon creation.
However, as metacity morphed into mutter, we optionally chose to keep
windows mapped for the lifetime of the window under the user option
"live-window-previews", which makes the code keep windows mapped so it
can show window preview for minimized windows in other places, like
Alt-Tab and Expose.
I removed this preference two years ago mechanically, by removing all
the if statements, but never went through and cleaned up the code so
that windows are simply mapped for the lifetime of the window -- the
"architecture" of the old code that maps and unmaps on show/hide was
still there.
Remove this now.
The one case we still need to be careful of is shaded windows, in which
we do still unmap the client window. In the future, we might want to
show previews of shaded windows in the overview and Alt-Tab. In that
we'd also keep shaded windows mapped, and could remove all unmap logic,
but we'd need a more complex method of showing the shaded titlebar, such
as using a different actor.
At the same time, simplify the compositor interface by removing
meta_compositor_window_[un]mapped API, and instead adding/removing the
window on-demand.
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-02 00:06:51 +00:00
|
|
|
window->frame == NULL)
|
2013-10-03 21:13:48 +00:00
|
|
|
meta_display_end_grab_op (display, timestamp);
|
|
|
|
|
|
|
|
if (!frame_was_receiver)
|
|
|
|
{
|
|
|
|
if (window->unmaps_pending == 0)
|
2002-08-03 23:07:04 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
meta_topic (META_DEBUG_WINDOW_STATE,
|
|
|
|
"Window %s withdrawn\n",
|
|
|
|
window->desc);
|
|
|
|
|
|
|
|
/* Unmanage withdrawn window */
|
|
|
|
window->withdrawn = TRUE;
|
2011-06-08 08:27:27 +00:00
|
|
|
meta_window_unmanage (window, timestamp);
|
|
|
|
window = NULL;
|
2002-08-03 23:07:04 +00:00
|
|
|
}
|
2013-10-03 21:13:48 +00:00
|
|
|
else
|
2003-01-21 22:40:25 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
window->unmaps_pending -= 1;
|
|
|
|
meta_topic (META_DEBUG_WINDOW_STATE,
|
|
|
|
"Received pending unmap, %d now pending\n",
|
|
|
|
window->unmaps_pending);
|
2003-01-21 22:40:25 +00:00
|
|
|
}
|
|
|
|
}
|
2013-10-03 21:13:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MapNotify:
|
|
|
|
/* NB: override redirect windows wont cause a map request so we
|
|
|
|
* watch out for map notifies against any root windows too if a
|
|
|
|
* compositor is enabled: */
|
|
|
|
if (display->compositor && window == NULL
|
|
|
|
&& meta_display_screen_for_root (display, event->xmap.event))
|
|
|
|
{
|
2014-02-02 00:19:22 +00:00
|
|
|
window = meta_window_x11_new (display, event->xmap.window,
|
|
|
|
FALSE, META_COMP_EFFECT_CREATE);
|
2013-10-03 21:13:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MapRequest:
|
|
|
|
if (window == NULL)
|
|
|
|
{
|
2014-02-02 00:19:22 +00:00
|
|
|
window = meta_window_x11_new (display, event->xmaprequest.window,
|
|
|
|
FALSE, META_COMP_EFFECT_CREATE);
|
2013-10-03 21:13:48 +00:00
|
|
|
}
|
|
|
|
/* if frame was receiver it's some malicious send event or something */
|
|
|
|
else if (!frame_was_receiver && window)
|
|
|
|
{
|
|
|
|
meta_verbose ("MapRequest on %s mapped = %d minimized = %d\n",
|
|
|
|
window->desc, window->mapped, window->minimized);
|
|
|
|
if (window->minimized)
|
2011-06-08 08:27:27 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
meta_window_unminimize (window);
|
|
|
|
if (window->workspace != window->screen->active_workspace)
|
2011-06-08 08:27:27 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
meta_verbose ("Changing workspace due to MapRequest mapped = %d minimized = %d\n",
|
|
|
|
window->mapped, window->minimized);
|
|
|
|
meta_window_change_workspace (window,
|
|
|
|
window->screen->active_workspace);
|
2011-06-08 08:27:27 +00:00
|
|
|
}
|
|
|
|
}
|
2013-10-03 21:13:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ReparentNotify:
|
|
|
|
{
|
|
|
|
MetaScreen *screen;
|
2013-07-22 16:57:12 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
screen = meta_display_screen_for_root (display,
|
|
|
|
event->xconfigure.event);
|
|
|
|
if (screen)
|
|
|
|
meta_stack_tracker_reparent_event (screen->stack_tracker,
|
|
|
|
&event->xreparent);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ConfigureNotify:
|
|
|
|
if (event->xconfigure.event != event->xconfigure.window)
|
|
|
|
{
|
|
|
|
MetaScreen *screen;
|
2006-03-03 15:53:10 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
screen = meta_display_screen_for_root (display,
|
|
|
|
event->xconfigure.event);
|
|
|
|
if (screen)
|
|
|
|
meta_stack_tracker_configure_event (screen->stack_tracker,
|
|
|
|
&event->xconfigure);
|
|
|
|
}
|
2011-06-08 08:27:27 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
if (window && window->override_redirect)
|
|
|
|
meta_window_configure_notify (window, &event->xconfigure);
|
2011-06-08 08:27:27 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
break;
|
|
|
|
case ConfigureRequest:
|
|
|
|
/* This comment and code is found in both twm and fvwm */
|
|
|
|
/*
|
|
|
|
* According to the July 27, 1988 ICCCM draft, we should ignore size and
|
|
|
|
* position fields in the WM_NORMAL_HINTS property when we map a window.
|
|
|
|
* Instead, we'll read the current geometry. Therefore, we should respond
|
|
|
|
* to configuration requests for windows which have never been mapped.
|
|
|
|
*/
|
|
|
|
if (window == NULL)
|
|
|
|
{
|
|
|
|
unsigned int xwcm;
|
|
|
|
XWindowChanges xwc;
|
|
|
|
|
|
|
|
xwcm = event->xconfigurerequest.value_mask &
|
|
|
|
(CWX | CWY | CWWidth | CWHeight | CWBorderWidth);
|
|
|
|
|
|
|
|
xwc.x = event->xconfigurerequest.x;
|
|
|
|
xwc.y = event->xconfigurerequest.y;
|
|
|
|
xwc.width = event->xconfigurerequest.width;
|
|
|
|
xwc.height = event->xconfigurerequest.height;
|
|
|
|
xwc.border_width = event->xconfigurerequest.border_width;
|
|
|
|
|
|
|
|
meta_verbose ("Configuring withdrawn window to %d,%d %dx%d border %d (some values may not be in mask)\n",
|
|
|
|
xwc.x, xwc.y, xwc.width, xwc.height, xwc.border_width);
|
|
|
|
meta_error_trap_push (display);
|
|
|
|
XConfigureWindow (display->xdisplay, event->xconfigurerequest.window,
|
|
|
|
xwcm, &xwc);
|
|
|
|
meta_error_trap_pop (display);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!frame_was_receiver)
|
2014-01-23 21:33:53 +00:00
|
|
|
meta_window_x11_configure_request (window, event);
|
2013-10-03 21:13:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GravityNotify:
|
|
|
|
break;
|
|
|
|
case ResizeRequest:
|
|
|
|
break;
|
|
|
|
case CirculateNotify:
|
|
|
|
break;
|
|
|
|
case CirculateRequest:
|
|
|
|
break;
|
|
|
|
case PropertyNotify:
|
|
|
|
{
|
|
|
|
MetaGroup *group;
|
|
|
|
MetaScreen *screen;
|
|
|
|
|
|
|
|
if (window && !frame_was_receiver)
|
2014-01-23 21:33:53 +00:00
|
|
|
meta_window_x11_property_notify (window, event);
|
2013-10-03 21:13:48 +00:00
|
|
|
else if (property_for_window && !frame_was_receiver)
|
2014-01-23 21:33:53 +00:00
|
|
|
meta_window_x11_property_notify (property_for_window, event);
|
2013-10-03 21:13:48 +00:00
|
|
|
|
|
|
|
group = meta_display_lookup_group (display,
|
|
|
|
event->xproperty.window);
|
|
|
|
if (group != NULL)
|
|
|
|
meta_group_property_notify (group, event);
|
|
|
|
|
|
|
|
screen = NULL;
|
|
|
|
if (window == NULL &&
|
|
|
|
group == NULL) /* window/group != NULL means it wasn't a root window */
|
|
|
|
screen = meta_display_screen_for_root (display,
|
|
|
|
event->xproperty.window);
|
|
|
|
|
|
|
|
if (screen != NULL)
|
2011-06-08 08:27:27 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
if (event->xproperty.atom ==
|
|
|
|
display->atom__NET_DESKTOP_LAYOUT)
|
|
|
|
meta_screen_update_workspace_layout (screen);
|
|
|
|
else if (event->xproperty.atom ==
|
|
|
|
display->atom__NET_DESKTOP_NAMES)
|
|
|
|
meta_screen_update_workspace_names (screen);
|
|
|
|
else if (meta_is_wayland_compositor () &&
|
|
|
|
event->xproperty.atom ==
|
|
|
|
display->atom__XKB_RULES_NAMES)
|
|
|
|
reload_xkb_rules (screen);
|
2012-04-24 22:02:33 +00:00
|
|
|
#if 0
|
2013-10-03 21:13:48 +00:00
|
|
|
else if (event->xproperty.atom ==
|
|
|
|
display->atom__NET_RESTACK_WINDOW)
|
|
|
|
handle_net_restack_window (display, event);
|
2012-04-24 22:02:33 +00:00
|
|
|
#endif
|
2003-05-30 20:24:00 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
/* we just use this property as a sentinel to avoid
|
|
|
|
* certain race conditions. See the comment for the
|
|
|
|
* sentinel_counter variable declaration in display.h
|
|
|
|
*/
|
|
|
|
if (event->xproperty.atom ==
|
|
|
|
display->atom__MUTTER_SENTINEL)
|
|
|
|
{
|
|
|
|
meta_display_decrement_focus_sentinel (display);
|
2011-06-08 08:27:27 +00:00
|
|
|
}
|
2002-12-01 03:58:04 +00:00
|
|
|
}
|
2013-10-03 21:13:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SelectionClear:
|
|
|
|
/* do this here instead of at end of function
|
|
|
|
* so we can return
|
|
|
|
*/
|
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 17:27:24 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
/* FIXME: Clearing display->current_time here makes no sense to
|
|
|
|
* me; who put this here and why?
|
|
|
|
*/
|
|
|
|
display->current_time = CurrentTime;
|
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 17:27:24 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
process_selection_clear (display, event);
|
|
|
|
/* Note that processing that may have resulted in
|
|
|
|
* closing the display... so return right away.
|
|
|
|
*/
|
|
|
|
return FALSE;
|
|
|
|
case SelectionRequest:
|
|
|
|
process_selection_request (display, event);
|
|
|
|
break;
|
|
|
|
case SelectionNotify:
|
|
|
|
break;
|
|
|
|
case ColormapNotify:
|
|
|
|
if (window && !frame_was_receiver)
|
|
|
|
window->colormap = event->xcolormap.colormap;
|
|
|
|
break;
|
|
|
|
case ClientMessage:
|
|
|
|
if (window)
|
|
|
|
{
|
|
|
|
if (!frame_was_receiver)
|
2014-01-23 21:33:53 +00:00
|
|
|
meta_window_x11_client_message (window, event);
|
2013-10-03 21:13:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
MetaScreen *screen;
|
2001-06-10 03:17:15 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
screen = meta_display_screen_for_root (display,
|
|
|
|
event->xclient.window);
|
|
|
|
|
|
|
|
if (screen)
|
|
|
|
{
|
|
|
|
if (event->xclient.message_type ==
|
|
|
|
display->atom__NET_CURRENT_DESKTOP)
|
2001-10-07 23:06:19 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
int space;
|
|
|
|
MetaWorkspace *workspace;
|
|
|
|
guint32 time;
|
|
|
|
|
|
|
|
space = event->xclient.data.l[0];
|
|
|
|
time = event->xclient.data.l[1];
|
|
|
|
|
|
|
|
meta_verbose ("Request to change current workspace to %d with "
|
|
|
|
"specified timestamp of %u\n",
|
|
|
|
space, time);
|
|
|
|
|
|
|
|
workspace =
|
|
|
|
meta_screen_get_workspace_by_index (screen,
|
|
|
|
space);
|
|
|
|
|
|
|
|
/* Handle clients using the older version of the spec... */
|
|
|
|
if (time == 0 && workspace)
|
2011-06-08 08:27:27 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
meta_warning ("Received a NET_CURRENT_DESKTOP message "
|
|
|
|
"from a broken (outdated) client who sent "
|
|
|
|
"a 0 timestamp\n");
|
|
|
|
time = meta_display_get_current_time_roundtrip (display);
|
2011-06-08 08:27:27 +00:00
|
|
|
}
|
2013-10-03 21:13:48 +00:00
|
|
|
|
|
|
|
if (workspace)
|
|
|
|
meta_workspace_activate (workspace, time);
|
|
|
|
else
|
|
|
|
meta_verbose ("Don't know about workspace %d\n", space);
|
|
|
|
}
|
|
|
|
else if (event->xclient.message_type ==
|
|
|
|
display->atom__NET_NUMBER_OF_DESKTOPS)
|
|
|
|
{
|
|
|
|
int num_spaces;
|
|
|
|
|
|
|
|
num_spaces = event->xclient.data.l[0];
|
|
|
|
|
|
|
|
meta_verbose ("Request to set number of workspaces to %d\n",
|
|
|
|
num_spaces);
|
|
|
|
|
|
|
|
meta_prefs_set_num_workspaces (num_spaces);
|
|
|
|
}
|
|
|
|
else if (event->xclient.message_type ==
|
|
|
|
display->atom__NET_SHOWING_DESKTOP)
|
|
|
|
{
|
|
|
|
gboolean showing_desktop;
|
|
|
|
guint32 timestamp;
|
|
|
|
|
|
|
|
showing_desktop = event->xclient.data.l[0] != 0;
|
|
|
|
/* FIXME: Braindead protocol doesn't have a timestamp */
|
|
|
|
timestamp = meta_display_get_current_time_roundtrip (display);
|
|
|
|
meta_verbose ("Request to %s desktop\n",
|
|
|
|
showing_desktop ? "show" : "hide");
|
|
|
|
|
|
|
|
if (showing_desktop)
|
|
|
|
meta_screen_show_desktop (screen, timestamp);
|
|
|
|
else
|
2011-06-08 08:27:27 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
meta_screen_unshow_desktop (screen);
|
|
|
|
meta_workspace_focus_default_window (screen->active_workspace, NULL, timestamp);
|
2011-06-08 08:27:27 +00:00
|
|
|
}
|
2013-10-03 21:13:48 +00:00
|
|
|
}
|
|
|
|
else if (event->xclient.message_type ==
|
|
|
|
display->atom_WM_PROTOCOLS)
|
|
|
|
{
|
|
|
|
meta_verbose ("Received WM_PROTOCOLS message\n");
|
|
|
|
|
|
|
|
if ((Atom)event->xclient.data.l[0] == display->atom__NET_WM_PING)
|
2011-06-08 08:27:27 +00:00
|
|
|
{
|
2013-11-21 19:01:40 +00:00
|
|
|
guint32 timestamp = event->xclient.data.l[1];
|
|
|
|
|
2014-02-15 16:33:12 +00:00
|
|
|
meta_display_pong_for_serial (display, timestamp);
|
2013-10-03 21:13:48 +00:00
|
|
|
|
|
|
|
/* We don't want ping reply events going into
|
|
|
|
* the GTK+ event loop because gtk+ will treat
|
|
|
|
* them as ping requests and send more replies.
|
|
|
|
*/
|
|
|
|
bypass_gtk = TRUE;
|
2011-06-08 08:27:27 +00:00
|
|
|
}
|
|
|
|
}
|
2013-10-03 21:13:48 +00:00
|
|
|
}
|
2004-01-10 17:16:07 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
if (event->xclient.message_type ==
|
|
|
|
display->atom__NET_REQUEST_FRAME_EXTENTS)
|
|
|
|
{
|
|
|
|
meta_verbose ("Received _NET_REQUEST_FRAME_EXTENTS message\n");
|
|
|
|
process_request_frame_extents (display, event);
|
2004-01-10 17:16:07 +00:00
|
|
|
}
|
2013-10-03 21:13:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MappingNotify:
|
|
|
|
{
|
|
|
|
gboolean ignore_current;
|
|
|
|
|
|
|
|
ignore_current = FALSE;
|
|
|
|
|
|
|
|
/* Check whether the next event is an identical MappingNotify
|
|
|
|
* event. If it is, ignore the current event, we'll update
|
|
|
|
* when we get the next one.
|
|
|
|
*/
|
|
|
|
if (XPending (display->xdisplay))
|
2011-06-08 08:27:27 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
XEvent next_event;
|
2002-11-06 16:00:56 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
XPeekEvent (display->xdisplay, &next_event);
|
2011-06-08 08:27:27 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
if (next_event.type == MappingNotify &&
|
|
|
|
next_event.xmapping.request == event->xmapping.request)
|
|
|
|
ignore_current = TRUE;
|
2002-11-06 16:00:56 +00:00
|
|
|
}
|
2013-10-03 21:13:48 +00:00
|
|
|
|
|
|
|
if (!ignore_current)
|
|
|
|
{
|
|
|
|
/* Let XLib know that there is a new keyboard mapping.
|
|
|
|
*/
|
|
|
|
XRefreshKeyboardMapping (&event->xmapping);
|
|
|
|
meta_display_process_mapping_event (display, event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
2003-01-28 15:07:43 +00:00
|
|
|
#ifdef HAVE_XKB
|
2013-10-03 21:13:48 +00:00
|
|
|
if (event->type == display->xkb_base_event_type)
|
|
|
|
{
|
|
|
|
XkbAnyEvent *xkb_ev = (XkbAnyEvent *) event;
|
2011-06-08 08:27:27 +00:00
|
|
|
|
2013-10-03 21:13:48 +00:00
|
|
|
switch (xkb_ev->xkb_type)
|
|
|
|
{
|
|
|
|
case XkbBellNotify:
|
|
|
|
if (XSERVER_TIME_IS_BEFORE(display->last_bell_time,
|
|
|
|
xkb_ev->time - 100))
|
2006-01-20 22:08:52 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
display->last_bell_time = xkb_ev->time;
|
|
|
|
meta_bell_notify (display, xkb_ev);
|
2006-01-20 22:08:52 +00:00
|
|
|
}
|
2013-10-03 21:13:48 +00:00
|
|
|
break;
|
|
|
|
case XkbNewKeyboardNotify:
|
|
|
|
case XkbMapNotify:
|
|
|
|
if (xkb_ev->device == META_VIRTUAL_CORE_KEYBOARD_ID)
|
|
|
|
meta_display_process_mapping_event (display, event);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-01-28 15:07:43 +00:00
|
|
|
#endif
|
2013-10-03 21:13:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
out:
|
|
|
|
return bypass_gtk;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* meta_display_handle_xevent:
|
|
|
|
* @display: The MetaDisplay that events are coming from
|
|
|
|
* @event: The event that just happened
|
|
|
|
*
|
|
|
|
* This is the most important function in the whole program. It is the heart,
|
|
|
|
* it is the nexus, it is the Grand Central Station of Mutter's world.
|
|
|
|
* When we create a #MetaDisplay, we ask GDK to pass *all* events for *all*
|
|
|
|
* windows to this function. So every time anything happens that we might
|
|
|
|
* want to know about, this function gets called. You see why it gets a bit
|
|
|
|
* busy around here. Most of this function is a ginormous switch statement
|
|
|
|
* dealing with all the kinds of events that might turn up.
|
|
|
|
*/
|
2013-11-19 01:50:56 +00:00
|
|
|
static gboolean
|
2013-10-03 21:13:48 +00:00
|
|
|
meta_display_handle_xevent (MetaDisplay *display,
|
|
|
|
XEvent *event)
|
|
|
|
{
|
|
|
|
Window modified;
|
|
|
|
gboolean bypass_compositor = FALSE, bypass_gtk = FALSE;
|
|
|
|
XIEvent *input_event;
|
|
|
|
MetaMonitorManager *monitor;
|
|
|
|
MetaScreen *screen;
|
|
|
|
|
|
|
|
#ifdef WITH_VERBOSE_MODE
|
|
|
|
if (dump_events)
|
|
|
|
meta_spew_event (display, event);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_STARTUP_NOTIFICATION
|
|
|
|
sn_display_process_event (display->sn_display, event);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Intercept XRandR events early and don't attempt any
|
|
|
|
processing for them. We still let them through to Gdk though,
|
|
|
|
so it can update its own internal state.
|
|
|
|
*/
|
|
|
|
monitor = meta_monitor_manager_get ();
|
|
|
|
if (meta_monitor_manager_handle_xevent (monitor, event))
|
|
|
|
{
|
|
|
|
bypass_compositor = TRUE;
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
|
|
|
display->current_time = event_get_time (display, event);
|
|
|
|
display->monitor_cache_invalidated = TRUE;
|
|
|
|
|
2013-12-16 21:01:04 +00:00
|
|
|
if (display->focused_by_us &&
|
|
|
|
event->xany.serial > display->focus_serial &&
|
2013-10-03 21:13:48 +00:00
|
|
|
display->focus_window &&
|
2013-11-25 20:13:48 +00:00
|
|
|
!window_has_xwindow (display->focus_window, display->server_focus_window))
|
2013-10-03 21:13:48 +00:00
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_FOCUS, "Earlier attempt to focus %s failed\n",
|
|
|
|
display->focus_window->desc);
|
|
|
|
update_focus_window (display,
|
|
|
|
meta_display_lookup_x_window (display, display->server_focus_window),
|
|
|
|
display->server_focus_window,
|
2013-12-16 21:01:04 +00:00
|
|
|
display->server_focus_serial,
|
|
|
|
FALSE);
|
2013-10-03 21:13:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
screen = meta_display_screen_for_root (display, event->xany.window);
|
|
|
|
if (screen)
|
|
|
|
{
|
|
|
|
if (meta_screen_handle_xevent (screen, event))
|
|
|
|
{
|
|
|
|
bypass_gtk = bypass_compositor = TRUE;
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
modified = event_get_modified_window (display, event);
|
|
|
|
|
|
|
|
input_event = get_input_event (display, event);
|
|
|
|
|
|
|
|
if (event->type == UnmapNotify)
|
|
|
|
{
|
|
|
|
if (meta_ui_window_should_not_cause_focus (display->xdisplay,
|
|
|
|
modified))
|
|
|
|
{
|
|
|
|
meta_display_add_ignored_crossing_serial (display, event->xany.serial);
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Adding EnterNotify serial %lu to ignored focus serials\n",
|
|
|
|
event->xany.serial);
|
2011-06-08 08:27:27 +00:00
|
|
|
}
|
2001-06-03 01:33:27 +00:00
|
|
|
}
|
2013-10-03 21:13:48 +00:00
|
|
|
else if (input_event &&
|
|
|
|
input_event->evtype == XI_Leave &&
|
|
|
|
((XILeaveEvent *)input_event)->mode == XINotifyUngrab &&
|
|
|
|
modified == display->ungrab_should_not_cause_focus_window)
|
|
|
|
{
|
|
|
|
meta_display_add_ignored_crossing_serial (display, event->xany.serial);
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Adding LeaveNotify serial %lu to ignored focus serials\n",
|
|
|
|
event->xany.serial);
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_XI23
|
|
|
|
if (meta_display_process_barrier_event (display, input_event))
|
|
|
|
{
|
|
|
|
bypass_gtk = bypass_compositor = TRUE;
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
#endif /* HAVE_XI23 */
|
|
|
|
|
|
|
|
/* libXi does not properly copy the serial to XI2 events, so pull it
|
|
|
|
* from the parent XAnyEvent and pass it to handle_input_xevent.
|
|
|
|
* See: https://bugs.freedesktop.org/show_bug.cgi?id=64687
|
|
|
|
*/
|
|
|
|
if (handle_input_xevent (display, input_event, event->xany.serial))
|
|
|
|
{
|
|
|
|
bypass_gtk = bypass_compositor = TRUE;
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (handle_other_xevent (display, event))
|
|
|
|
{
|
|
|
|
bypass_gtk = TRUE;
|
|
|
|
goto out;
|
|
|
|
}
|
2001-06-20 03:01:26 +00:00
|
|
|
|
2013-10-03 20:12:34 +00:00
|
|
|
out:
|
2009-08-11 23:41:50 +00:00
|
|
|
if (display->compositor && !bypass_compositor)
|
2006-02-16 20:26:05 +00:00
|
|
|
{
|
2013-10-03 21:13:48 +00:00
|
|
|
MetaWindow *window = modified != None ? meta_display_lookup_x_window (display, modified) : NULL;
|
|
|
|
|
|
|
|
if (meta_compositor_process_event (display->compositor, event, window))
|
2013-10-03 20:56:24 +00:00
|
|
|
bypass_gtk = TRUE;
|
2006-02-16 20:26:05 +00:00
|
|
|
}
|
2003-12-26 00:05:26 +00:00
|
|
|
|
2002-01-03 23:28:19 +00:00
|
|
|
display->current_time = CurrentTime;
|
2013-10-03 20:56:24 +00:00
|
|
|
return bypass_gtk;
|
2001-05-30 15:36:31 +00:00
|
|
|
}
|
|
|
|
|
2013-05-03 17:51:22 +00:00
|
|
|
static gboolean
|
2013-10-03 19:29:44 +00:00
|
|
|
xevent_callback (XEvent *event,
|
|
|
|
gpointer data)
|
2013-05-03 17:51:22 +00:00
|
|
|
{
|
|
|
|
MetaDisplay *display = data;
|
|
|
|
|
2013-08-29 13:07:50 +00:00
|
|
|
return meta_display_handle_xevent (display, event);
|
2013-05-03 17:51:22 +00:00
|
|
|
}
|
|
|
|
|
2013-10-03 19:29:44 +00:00
|
|
|
static gboolean
|
|
|
|
event_callback (const ClutterEvent *event,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
MetaDisplay *display = data;
|
|
|
|
|
|
|
|
return meta_display_handle_event (display, event);
|
|
|
|
}
|
|
|
|
|
2013-10-03 19:23:24 +00:00
|
|
|
static Window
|
|
|
|
xievent_get_modified_window (MetaDisplay *display,
|
|
|
|
XIEvent *input_event)
|
|
|
|
{
|
|
|
|
switch (input_event->evtype)
|
|
|
|
{
|
|
|
|
case XI_Motion:
|
|
|
|
case XI_ButtonPress:
|
|
|
|
case XI_ButtonRelease:
|
|
|
|
case XI_KeyPress:
|
|
|
|
case XI_KeyRelease:
|
|
|
|
return ((XIDeviceEvent *) input_event)->event;
|
|
|
|
case XI_FocusIn:
|
|
|
|
case XI_FocusOut:
|
|
|
|
case XI_Enter:
|
|
|
|
case XI_Leave:
|
|
|
|
return ((XIEnterEvent *) input_event)->event;
|
|
|
|
#ifdef HAVE_XI23
|
|
|
|
case XI_BarrierHit:
|
|
|
|
case XI_BarrierLeave:
|
|
|
|
return ((XIBarrierEvent *) input_event)->event;
|
|
|
|
#endif /* HAVE_XI23 */
|
|
|
|
}
|
|
|
|
|
|
|
|
return None;
|
|
|
|
}
|
|
|
|
|
2001-06-03 01:33:27 +00:00
|
|
|
/* Return the window this has to do with, if any, rather
|
|
|
|
* than the frame or root window that was selecting
|
|
|
|
* for substructure
|
|
|
|
*/
|
|
|
|
static Window
|
|
|
|
event_get_modified_window (MetaDisplay *display,
|
|
|
|
XEvent *event)
|
|
|
|
{
|
2012-11-15 21:35:42 +00:00
|
|
|
XIEvent *input_event = get_input_event (display, event);
|
|
|
|
|
|
|
|
if (input_event)
|
2013-10-03 19:23:24 +00:00
|
|
|
return xievent_get_modified_window (display, input_event);
|
2012-11-15 21:35:42 +00:00
|
|
|
|
2001-06-03 01:33:27 +00:00
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case KeymapNotify:
|
|
|
|
case Expose:
|
|
|
|
case GraphicsExpose:
|
|
|
|
case NoExpose:
|
|
|
|
case VisibilityNotify:
|
|
|
|
case ResizeRequest:
|
|
|
|
case PropertyNotify:
|
|
|
|
case SelectionClear:
|
|
|
|
case SelectionRequest:
|
|
|
|
case SelectionNotify:
|
|
|
|
case ColormapNotify:
|
|
|
|
case ClientMessage:
|
|
|
|
return event->xany.window;
|
2001-06-04 04:58:22 +00:00
|
|
|
|
2001-06-03 01:33:27 +00:00
|
|
|
case CreateNotify:
|
|
|
|
return event->xcreatewindow.window;
|
|
|
|
|
|
|
|
case DestroyNotify:
|
|
|
|
return event->xdestroywindow.window;
|
|
|
|
|
|
|
|
case UnmapNotify:
|
|
|
|
return event->xunmap.window;
|
|
|
|
|
|
|
|
case MapNotify:
|
|
|
|
return event->xmap.window;
|
|
|
|
|
|
|
|
case MapRequest:
|
|
|
|
return event->xmaprequest.window;
|
|
|
|
|
|
|
|
case ReparentNotify:
|
|
|
|
return event->xreparent.window;
|
|
|
|
|
|
|
|
case ConfigureNotify:
|
|
|
|
return event->xconfigure.window;
|
|
|
|
|
|
|
|
case ConfigureRequest:
|
|
|
|
return event->xconfigurerequest.window;
|
|
|
|
|
|
|
|
case GravityNotify:
|
|
|
|
return event->xgravity.window;
|
|
|
|
|
|
|
|
case CirculateNotify:
|
|
|
|
return event->xcirculate.window;
|
|
|
|
|
|
|
|
case CirculateRequest:
|
|
|
|
return event->xcirculaterequest.window;
|
|
|
|
|
|
|
|
case MappingNotify:
|
|
|
|
return None;
|
|
|
|
|
|
|
|
default:
|
2003-01-05 07:51:02 +00:00
|
|
|
#ifdef HAVE_SHAPE
|
|
|
|
if (META_DISPLAY_HAS_SHAPE (display) &&
|
|
|
|
event->type == (display->shape_event_base + ShapeNotify))
|
|
|
|
{
|
|
|
|
XShapeEvent *sev = (XShapeEvent*) event;
|
|
|
|
return sev->window;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2001-06-03 01:33:27 +00:00
|
|
|
return None;
|
|
|
|
}
|
|
|
|
}
|
2001-06-10 19:23:28 +00:00
|
|
|
|
2002-01-03 23:28:19 +00:00
|
|
|
static guint32
|
|
|
|
event_get_time (MetaDisplay *display,
|
|
|
|
XEvent *event)
|
|
|
|
{
|
2012-11-15 21:35:42 +00:00
|
|
|
XIEvent *input_event = get_input_event (display, event);
|
|
|
|
|
|
|
|
if (input_event)
|
|
|
|
return input_event->time;
|
|
|
|
|
2002-01-03 23:28:19 +00:00
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case PropertyNotify:
|
|
|
|
return event->xproperty.time;
|
|
|
|
|
|
|
|
case SelectionClear:
|
|
|
|
case SelectionRequest:
|
|
|
|
case SelectionNotify:
|
|
|
|
return event->xselection.time;
|
|
|
|
|
|
|
|
case KeymapNotify:
|
|
|
|
case Expose:
|
|
|
|
case GraphicsExpose:
|
|
|
|
case NoExpose:
|
|
|
|
case MapNotify:
|
|
|
|
case UnmapNotify:
|
|
|
|
case VisibilityNotify:
|
|
|
|
case ResizeRequest:
|
|
|
|
case ColormapNotify:
|
|
|
|
case ClientMessage:
|
|
|
|
case CreateNotify:
|
|
|
|
case DestroyNotify:
|
|
|
|
case MapRequest:
|
|
|
|
case ReparentNotify:
|
|
|
|
case ConfigureNotify:
|
|
|
|
case ConfigureRequest:
|
|
|
|
case GravityNotify:
|
|
|
|
case CirculateNotify:
|
|
|
|
case CirculateRequest:
|
|
|
|
case MappingNotify:
|
|
|
|
default:
|
|
|
|
return CurrentTime;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-12-10 03:23:04 +00:00
|
|
|
#ifdef WITH_VERBOSE_MODE
|
2002-01-06 03:15:49 +00:00
|
|
|
const char*
|
2002-03-02 15:26:07 +00:00
|
|
|
meta_event_detail_to_string (int d)
|
2001-06-10 19:23:28 +00:00
|
|
|
{
|
2001-06-18 06:11:53 +00:00
|
|
|
const char *detail = "???";
|
2001-06-10 19:23:28 +00:00
|
|
|
switch (d)
|
|
|
|
{
|
2002-01-06 03:15:49 +00:00
|
|
|
/* We are an ancestor in the A<->B focus change relationship */
|
2012-12-17 02:53:19 +00:00
|
|
|
case XINotifyAncestor:
|
2001-06-10 19:23:28 +00:00
|
|
|
detail = "NotifyAncestor";
|
|
|
|
break;
|
2012-12-17 02:53:19 +00:00
|
|
|
case XINotifyDetailNone:
|
2001-06-10 19:23:28 +00:00
|
|
|
detail = "NotifyDetailNone";
|
|
|
|
break;
|
2002-01-06 03:15:49 +00:00
|
|
|
/* We are a descendant in the A<->B focus change relationship */
|
2012-12-17 02:53:19 +00:00
|
|
|
case XINotifyInferior:
|
2001-06-10 19:23:28 +00:00
|
|
|
detail = "NotifyInferior";
|
2002-01-06 03:15:49 +00:00
|
|
|
break;
|
2012-12-17 02:53:19 +00:00
|
|
|
case XINotifyNonlinear:
|
2001-06-10 19:23:28 +00:00
|
|
|
detail = "NotifyNonlinear";
|
|
|
|
break;
|
2012-12-17 02:53:19 +00:00
|
|
|
case XINotifyNonlinearVirtual:
|
2001-06-10 19:23:28 +00:00
|
|
|
detail = "NotifyNonlinearVirtual";
|
|
|
|
break;
|
2012-12-17 02:53:19 +00:00
|
|
|
case XINotifyPointer:
|
2001-06-10 19:23:28 +00:00
|
|
|
detail = "NotifyPointer";
|
|
|
|
break;
|
2012-12-17 02:53:19 +00:00
|
|
|
case XINotifyPointerRoot:
|
2001-06-10 19:23:28 +00:00
|
|
|
detail = "NotifyPointerRoot";
|
|
|
|
break;
|
2012-12-17 02:53:19 +00:00
|
|
|
case XINotifyVirtual:
|
2001-06-10 19:23:28 +00:00
|
|
|
detail = "NotifyVirtual";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return detail;
|
|
|
|
}
|
2002-12-10 03:23:04 +00:00
|
|
|
#endif /* WITH_VERBOSE_MODE */
|
2001-06-10 19:23:28 +00:00
|
|
|
|
2002-12-10 03:23:04 +00:00
|
|
|
#ifdef WITH_VERBOSE_MODE
|
2002-01-06 03:15:49 +00:00
|
|
|
const char*
|
2002-03-02 15:26:07 +00:00
|
|
|
meta_event_mode_to_string (int m)
|
2001-06-10 19:23:28 +00:00
|
|
|
{
|
2001-06-18 06:11:53 +00:00
|
|
|
const char *mode = "???";
|
2001-06-10 19:23:28 +00:00
|
|
|
switch (m)
|
|
|
|
{
|
2012-12-17 02:53:19 +00:00
|
|
|
case XINotifyNormal:
|
2001-06-10 19:23:28 +00:00
|
|
|
mode = "NotifyNormal";
|
|
|
|
break;
|
2012-12-17 02:53:19 +00:00
|
|
|
case XINotifyGrab:
|
2001-06-10 19:23:28 +00:00
|
|
|
mode = "NotifyGrab";
|
|
|
|
break;
|
2012-12-17 02:53:19 +00:00
|
|
|
case XINotifyUngrab:
|
2001-06-10 19:23:28 +00:00
|
|
|
mode = "NotifyUngrab";
|
|
|
|
break;
|
2012-12-17 02:53:19 +00:00
|
|
|
case XINotifyWhileGrabbed:
|
2002-01-06 03:15:49 +00:00
|
|
|
mode = "NotifyWhileGrabbed";
|
|
|
|
break;
|
2001-06-10 19:23:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return mode;
|
|
|
|
}
|
2002-12-10 03:23:04 +00:00
|
|
|
#endif /* WITH_VERBOSE_MODE */
|
2001-06-10 19:23:28 +00:00
|
|
|
|
2002-12-10 03:23:04 +00:00
|
|
|
#ifdef WITH_VERBOSE_MODE
|
2002-03-12 04:34:17 +00:00
|
|
|
static const char*
|
2002-03-10 18:36:08 +00:00
|
|
|
stack_mode_to_string (int mode)
|
|
|
|
{
|
|
|
|
switch (mode)
|
|
|
|
{
|
|
|
|
case Above:
|
|
|
|
return "Above";
|
|
|
|
case Below:
|
|
|
|
return "Below";
|
|
|
|
case TopIf:
|
|
|
|
return "TopIf";
|
|
|
|
case BottomIf:
|
|
|
|
return "BottomIf";
|
|
|
|
case Opposite:
|
|
|
|
return "Opposite";
|
|
|
|
}
|
|
|
|
|
|
|
|
return "Unknown";
|
|
|
|
}
|
2002-12-10 03:23:04 +00:00
|
|
|
#endif /* WITH_VERBOSE_MODE */
|
2002-03-10 18:36:08 +00:00
|
|
|
|
2002-12-10 03:23:04 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
#ifdef WITH_VERBOSE_MODE
|
|
|
|
static gint64
|
|
|
|
sync_value_to_64 (const XSyncValue *value)
|
|
|
|
{
|
|
|
|
gint64 v;
|
|
|
|
|
|
|
|
v = XSyncValueLow32 (*value);
|
|
|
|
v |= (((gint64)XSyncValueHigh32 (*value)) << 32);
|
|
|
|
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif /* WITH_VERBOSE_MODE */
|
|
|
|
|
|
|
|
#ifdef WITH_VERBOSE_MODE
|
|
|
|
static const char*
|
|
|
|
alarm_state_to_string (XSyncAlarmState state)
|
|
|
|
{
|
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case XSyncAlarmActive:
|
|
|
|
return "Active";
|
|
|
|
case XSyncAlarmInactive:
|
|
|
|
return "Inactive";
|
|
|
|
case XSyncAlarmDestroyed:
|
|
|
|
return "Destroyed";
|
|
|
|
default:
|
|
|
|
return "(unknown)";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* WITH_VERBOSE_MODE */
|
2001-07-26 03:58:24 +00:00
|
|
|
|
2002-12-10 03:23:04 +00:00
|
|
|
#endif /* HAVE_XSYNC */
|
|
|
|
|
|
|
|
#ifdef WITH_VERBOSE_MODE
|
2001-05-30 15:36:31 +00:00
|
|
|
static void
|
2012-11-20 23:35:41 +00:00
|
|
|
meta_spew_xi2_event (MetaDisplay *display,
|
|
|
|
XIEvent *input_event,
|
|
|
|
const char **name_p,
|
|
|
|
char **extra_p)
|
2001-05-30 15:36:31 +00:00
|
|
|
{
|
2002-02-08 03:34:26 +00:00
|
|
|
const char *name = NULL;
|
|
|
|
char *extra = NULL;
|
|
|
|
|
2012-11-20 23:35:41 +00:00
|
|
|
XIDeviceEvent *device_event = (XIDeviceEvent *) input_event;
|
2013-02-15 20:52:34 +00:00
|
|
|
XIEnterEvent *enter_event = (XIEnterEvent *) input_event;
|
2012-11-20 23:35:41 +00:00
|
|
|
|
|
|
|
switch (input_event->evtype)
|
|
|
|
{
|
|
|
|
case XI_Motion:
|
|
|
|
name = "XI_Motion";
|
|
|
|
break;
|
|
|
|
case XI_ButtonPress:
|
|
|
|
name = "XI_ButtonPress";
|
|
|
|
break;
|
|
|
|
case XI_ButtonRelease:
|
|
|
|
name = "XI_ButtonRelease";
|
|
|
|
break;
|
|
|
|
case XI_KeyPress:
|
|
|
|
name = "XI_KeyPress";
|
|
|
|
break;
|
|
|
|
case XI_KeyRelease:
|
|
|
|
name = "XI_KeyRelease";
|
|
|
|
break;
|
|
|
|
case XI_FocusIn:
|
|
|
|
name = "XI_FocusIn";
|
|
|
|
break;
|
|
|
|
case XI_FocusOut:
|
|
|
|
name = "XI_FocusOut";
|
|
|
|
break;
|
|
|
|
case XI_Enter:
|
|
|
|
name = "XI_Enter";
|
|
|
|
break;
|
|
|
|
case XI_Leave:
|
|
|
|
name = "XI_Leave";
|
|
|
|
break;
|
2012-07-30 18:57:53 +00:00
|
|
|
#ifdef HAVE_XI23
|
|
|
|
case XI_BarrierHit:
|
|
|
|
name = "XI_BarrierHit";
|
|
|
|
break;
|
|
|
|
case XI_BarrierLeave:
|
|
|
|
name = "XI_BarrierLeave";
|
|
|
|
break;
|
|
|
|
#endif /* HAVE_XI23 */
|
2012-11-20 23:35:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (input_event->evtype)
|
|
|
|
{
|
|
|
|
case XI_Motion:
|
|
|
|
extra = g_strdup_printf ("win: 0x%lx x: %g y: %g",
|
|
|
|
device_event->event,
|
|
|
|
device_event->root_x,
|
|
|
|
device_event->root_y);
|
|
|
|
break;
|
|
|
|
case XI_ButtonPress:
|
|
|
|
case XI_ButtonRelease:
|
|
|
|
extra = g_strdup_printf ("button %u x %g y %g root 0x%lx",
|
|
|
|
device_event->detail,
|
|
|
|
device_event->root_x,
|
|
|
|
device_event->root_y,
|
|
|
|
device_event->root);
|
|
|
|
break;
|
|
|
|
case XI_KeyPress:
|
|
|
|
case XI_KeyRelease:
|
|
|
|
{
|
|
|
|
KeySym keysym;
|
|
|
|
const char *str;
|
2003-03-23 21:54:48 +00:00
|
|
|
|
2012-11-20 23:35:41 +00:00
|
|
|
keysym = XKeycodeToKeysym (display->xdisplay, device_event->detail, 0);
|
2012-11-03 19:26:21 +00:00
|
|
|
|
2012-11-20 23:35:41 +00:00
|
|
|
str = XKeysymToString (keysym);
|
|
|
|
|
|
|
|
extra = g_strdup_printf ("Key '%s' state 0x%x",
|
|
|
|
str ? str : "none", device_event->mods.effective);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case XI_FocusIn:
|
|
|
|
case XI_FocusOut:
|
|
|
|
extra = g_strdup_printf ("detail: %s mode: %s\n",
|
|
|
|
meta_event_detail_to_string (enter_event->detail),
|
|
|
|
meta_event_mode_to_string (enter_event->mode));
|
|
|
|
break;
|
|
|
|
case XI_Enter:
|
|
|
|
case XI_Leave:
|
|
|
|
extra = g_strdup_printf ("win: 0x%lx root: 0x%lx mode: %s detail: %s focus: %d x: %g y: %g",
|
|
|
|
enter_event->event,
|
|
|
|
enter_event->root,
|
|
|
|
meta_event_mode_to_string (enter_event->mode),
|
|
|
|
meta_event_detail_to_string (enter_event->detail),
|
|
|
|
enter_event->focus,
|
|
|
|
enter_event->root_x,
|
|
|
|
enter_event->root_y);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
*name_p = name;
|
|
|
|
*extra_p = extra;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_spew_core_event (MetaDisplay *display,
|
|
|
|
XEvent *event,
|
|
|
|
const char **name_p,
|
|
|
|
char **extra_p)
|
|
|
|
{
|
|
|
|
const char *name = NULL;
|
|
|
|
char *extra = NULL;
|
2012-11-03 19:26:21 +00:00
|
|
|
|
2002-02-08 03:34:26 +00:00
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case KeymapNotify:
|
|
|
|
name = "KeymapNotify";
|
|
|
|
break;
|
|
|
|
case Expose:
|
|
|
|
name = "Expose";
|
|
|
|
break;
|
|
|
|
case GraphicsExpose:
|
|
|
|
name = "GraphicsExpose";
|
|
|
|
break;
|
|
|
|
case NoExpose:
|
|
|
|
name = "NoExpose";
|
|
|
|
break;
|
|
|
|
case VisibilityNotify:
|
|
|
|
name = "VisibilityNotify";
|
|
|
|
break;
|
|
|
|
case CreateNotify:
|
|
|
|
name = "CreateNotify";
|
2003-12-26 02:42:38 +00:00
|
|
|
extra = g_strdup_printf ("parent: 0x%lx window: 0x%lx",
|
|
|
|
event->xcreatewindow.parent,
|
|
|
|
event->xcreatewindow.window);
|
2002-02-08 03:34:26 +00:00
|
|
|
break;
|
|
|
|
case DestroyNotify:
|
|
|
|
name = "DestroyNotify";
|
2003-12-26 02:42:38 +00:00
|
|
|
extra = g_strdup_printf ("event: 0x%lx window: 0x%lx",
|
|
|
|
event->xdestroywindow.event,
|
|
|
|
event->xdestroywindow.window);
|
2002-02-08 03:34:26 +00:00
|
|
|
break;
|
|
|
|
case UnmapNotify:
|
|
|
|
name = "UnmapNotify";
|
2002-09-23 01:43:20 +00:00
|
|
|
extra = g_strdup_printf ("event: 0x%lx window: 0x%lx from_configure: %d",
|
|
|
|
event->xunmap.event,
|
|
|
|
event->xunmap.window,
|
|
|
|
event->xunmap.from_configure);
|
2002-02-08 03:34:26 +00:00
|
|
|
break;
|
|
|
|
case MapNotify:
|
|
|
|
name = "MapNotify";
|
2002-09-23 01:43:20 +00:00
|
|
|
extra = g_strdup_printf ("event: 0x%lx window: 0x%lx override_redirect: %d",
|
|
|
|
event->xmap.event,
|
|
|
|
event->xmap.window,
|
|
|
|
event->xmap.override_redirect);
|
2002-02-08 03:34:26 +00:00
|
|
|
break;
|
|
|
|
case MapRequest:
|
|
|
|
name = "MapRequest";
|
2003-01-21 22:40:25 +00:00
|
|
|
extra = g_strdup_printf ("window: 0x%lx parent: 0x%lx\n",
|
|
|
|
event->xmaprequest.window,
|
|
|
|
event->xmaprequest.parent);
|
2002-02-08 03:34:26 +00:00
|
|
|
break;
|
|
|
|
case ReparentNotify:
|
|
|
|
name = "ReparentNotify";
|
2003-12-26 02:42:38 +00:00
|
|
|
extra = g_strdup_printf ("window: 0x%lx parent: 0x%lx event: 0x%lx\n",
|
|
|
|
event->xreparent.window,
|
|
|
|
event->xreparent.parent,
|
|
|
|
event->xreparent.event);
|
2002-02-08 03:34:26 +00:00
|
|
|
break;
|
|
|
|
case ConfigureNotify:
|
|
|
|
name = "ConfigureNotify";
|
2002-09-23 01:43:20 +00:00
|
|
|
extra = g_strdup_printf ("x: %d y: %d w: %d h: %d above: 0x%lx override_redirect: %d",
|
2002-02-08 03:34:26 +00:00
|
|
|
event->xconfigure.x,
|
|
|
|
event->xconfigure.y,
|
|
|
|
event->xconfigure.width,
|
|
|
|
event->xconfigure.height,
|
2002-09-23 01:43:20 +00:00
|
|
|
event->xconfigure.above,
|
|
|
|
event->xconfigure.override_redirect);
|
2002-02-08 03:34:26 +00:00
|
|
|
break;
|
|
|
|
case ConfigureRequest:
|
|
|
|
name = "ConfigureRequest";
|
2002-03-12 04:34:17 +00:00
|
|
|
extra = g_strdup_printf ("parent: 0x%lx window: 0x%lx x: %d %sy: %d %sw: %d %sh: %d %sborder: %d %sabove: %lx %sstackmode: %s %s",
|
2002-02-08 03:34:26 +00:00
|
|
|
event->xconfigurerequest.parent,
|
|
|
|
event->xconfigurerequest.window,
|
|
|
|
event->xconfigurerequest.x,
|
|
|
|
event->xconfigurerequest.value_mask &
|
|
|
|
CWX ? "" : "(unset) ",
|
|
|
|
event->xconfigurerequest.y,
|
|
|
|
event->xconfigurerequest.value_mask &
|
|
|
|
CWY ? "" : "(unset) ",
|
|
|
|
event->xconfigurerequest.width,
|
|
|
|
event->xconfigurerequest.value_mask &
|
|
|
|
CWWidth ? "" : "(unset) ",
|
|
|
|
event->xconfigurerequest.height,
|
|
|
|
event->xconfigurerequest.value_mask &
|
|
|
|
CWHeight ? "" : "(unset) ",
|
|
|
|
event->xconfigurerequest.border_width,
|
|
|
|
event->xconfigurerequest.value_mask &
|
2002-03-10 18:36:08 +00:00
|
|
|
CWBorderWidth ? "" : "(unset)",
|
|
|
|
event->xconfigurerequest.above,
|
|
|
|
event->xconfigurerequest.value_mask &
|
|
|
|
CWSibling ? "" : "(unset)",
|
|
|
|
stack_mode_to_string (event->xconfigurerequest.detail),
|
|
|
|
event->xconfigurerequest.value_mask &
|
|
|
|
CWStackMode ? "" : "(unset)");
|
2002-02-08 03:34:26 +00:00
|
|
|
break;
|
|
|
|
case GravityNotify:
|
|
|
|
name = "GravityNotify";
|
|
|
|
break;
|
|
|
|
case ResizeRequest:
|
|
|
|
name = "ResizeRequest";
|
2002-03-10 15:48:38 +00:00
|
|
|
extra = g_strdup_printf ("width = %d height = %d",
|
|
|
|
event->xresizerequest.width,
|
|
|
|
event->xresizerequest.height);
|
2002-02-08 03:34:26 +00:00
|
|
|
break;
|
|
|
|
case CirculateNotify:
|
|
|
|
name = "CirculateNotify";
|
|
|
|
break;
|
|
|
|
case CirculateRequest:
|
|
|
|
name = "CirculateRequest";
|
|
|
|
break;
|
|
|
|
case PropertyNotify:
|
|
|
|
{
|
|
|
|
char *str;
|
|
|
|
const char *state;
|
2001-06-11 03:24:20 +00:00
|
|
|
|
2002-02-08 03:34:26 +00:00
|
|
|
name = "PropertyNotify";
|
2001-06-11 03:24:20 +00:00
|
|
|
|
2002-02-08 03:34:26 +00:00
|
|
|
meta_error_trap_push (display);
|
|
|
|
str = XGetAtomName (display->xdisplay,
|
|
|
|
event->xproperty.atom);
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop (display);
|
2002-02-08 03:34:26 +00:00
|
|
|
|
|
|
|
if (event->xproperty.state == PropertyNewValue)
|
|
|
|
state = "PropertyNewValue";
|
|
|
|
else if (event->xproperty.state == PropertyDelete)
|
|
|
|
state = "PropertyDelete";
|
|
|
|
else
|
|
|
|
state = "???";
|
2001-06-11 03:24:20 +00:00
|
|
|
|
2002-02-08 03:34:26 +00:00
|
|
|
extra = g_strdup_printf ("atom: %s state: %s",
|
|
|
|
str ? str : "(unknown atom)",
|
|
|
|
state);
|
2002-06-08 23:55:27 +00:00
|
|
|
meta_XFree (str);
|
2002-02-08 03:34:26 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SelectionClear:
|
|
|
|
name = "SelectionClear";
|
|
|
|
break;
|
|
|
|
case SelectionRequest:
|
|
|
|
name = "SelectionRequest";
|
|
|
|
break;
|
|
|
|
case SelectionNotify:
|
|
|
|
name = "SelectionNotify";
|
|
|
|
break;
|
|
|
|
case ColormapNotify:
|
|
|
|
name = "ColormapNotify";
|
|
|
|
break;
|
|
|
|
case ClientMessage:
|
|
|
|
{
|
|
|
|
char *str;
|
|
|
|
name = "ClientMessage";
|
|
|
|
meta_error_trap_push (display);
|
|
|
|
str = XGetAtomName (display->xdisplay,
|
|
|
|
event->xclient.message_type);
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop (display);
|
2002-02-08 03:34:26 +00:00
|
|
|
extra = g_strdup_printf ("type: %s format: %d\n",
|
|
|
|
str ? str : "(unknown atom)",
|
|
|
|
event->xclient.format);
|
2002-06-08 23:55:27 +00:00
|
|
|
meta_XFree (str);
|
2002-02-08 03:34:26 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MappingNotify:
|
|
|
|
name = "MappingNotify";
|
|
|
|
break;
|
|
|
|
default:
|
2002-12-10 03:23:04 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
if (META_DISPLAY_HAS_XSYNC (display) &&
|
|
|
|
event->type == (display->xsync_event_base + XSyncAlarmNotify))
|
|
|
|
{
|
|
|
|
XSyncAlarmNotifyEvent *aevent = (XSyncAlarmNotifyEvent*) event;
|
|
|
|
|
|
|
|
name = "XSyncAlarmNotify";
|
|
|
|
extra =
|
|
|
|
g_strdup_printf ("alarm: 0x%lx"
|
|
|
|
" counter_value: %" G_GINT64_FORMAT
|
|
|
|
" alarm_value: %" G_GINT64_FORMAT
|
|
|
|
" time: %u alarm state: %s",
|
|
|
|
aevent->alarm,
|
|
|
|
(gint64) sync_value_to_64 (&aevent->counter_value),
|
|
|
|
(gint64) sync_value_to_64 (&aevent->alarm_value),
|
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 16:32:33 +00:00
|
|
|
(unsigned int)aevent->time,
|
2002-12-10 03:23:04 +00:00
|
|
|
alarm_state_to_string (aevent->state));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
#endif /* HAVE_XSYNC */
|
2003-01-05 07:51:02 +00:00
|
|
|
#ifdef HAVE_SHAPE
|
|
|
|
if (META_DISPLAY_HAS_SHAPE (display) &&
|
|
|
|
event->type == (display->shape_event_base + ShapeNotify))
|
|
|
|
{
|
|
|
|
XShapeEvent *sev = (XShapeEvent*) event;
|
|
|
|
|
|
|
|
name = "ShapeNotify";
|
|
|
|
|
|
|
|
extra =
|
|
|
|
g_strdup_printf ("kind: %s "
|
2006-01-20 22:03:56 +00:00
|
|
|
"x: %d y: %d w: %u h: %u "
|
2003-01-05 07:51:02 +00:00
|
|
|
"shaped: %d",
|
|
|
|
sev->kind == ShapeBounding ?
|
|
|
|
"ShapeBounding" :
|
|
|
|
(sev->kind == ShapeClip ?
|
2012-11-20 23:35:41 +00:00
|
|
|
"ShapeClip" : "(unknown)"),
|
2003-01-05 07:51:02 +00:00
|
|
|
sev->x, sev->y, sev->width, sev->height,
|
|
|
|
sev->shaped);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
#endif /* HAVE_SHAPE */
|
2012-11-20 23:35:41 +00:00
|
|
|
{
|
|
|
|
name = "(Unknown event)";
|
|
|
|
extra = g_strdup_printf ("type: %d", event->xany.type);
|
|
|
|
}
|
2002-02-08 03:34:26 +00:00
|
|
|
break;
|
|
|
|
}
|
2001-05-30 15:36:31 +00:00
|
|
|
|
2012-11-20 23:35:41 +00:00
|
|
|
*name_p = name;
|
|
|
|
*extra_p = extra;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_spew_event (MetaDisplay *display,
|
|
|
|
XEvent *event)
|
|
|
|
{
|
|
|
|
const char *name = NULL;
|
|
|
|
char *extra = NULL;
|
|
|
|
char *winname;
|
|
|
|
MetaScreen *screen;
|
|
|
|
XIEvent *input_event;
|
|
|
|
|
|
|
|
if (!meta_is_verbose())
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* filter overnumerous events */
|
|
|
|
if (event->type == Expose || event->type == MotionNotify ||
|
|
|
|
event->type == NoExpose)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (event->type == (display->damage_event_base + XDamageNotify))
|
|
|
|
return;
|
|
|
|
|
2013-06-30 00:07:28 +00:00
|
|
|
if (event->type == (display->xsync_event_base + XSyncAlarmNotify))
|
|
|
|
return;
|
|
|
|
|
2013-06-30 00:09:30 +00:00
|
|
|
if (event->type == PropertyNotify && event->xproperty.atom == display->atom__NET_WM_USER_TIME)
|
|
|
|
return;
|
|
|
|
|
2012-11-20 23:35:41 +00:00
|
|
|
input_event = get_input_event (display, event);
|
|
|
|
|
|
|
|
if (input_event)
|
|
|
|
meta_spew_xi2_event (display, input_event, &name, &extra);
|
|
|
|
else
|
|
|
|
meta_spew_core_event (display, event, &name, &extra);
|
|
|
|
|
2002-02-08 03:34:26 +00:00
|
|
|
screen = meta_display_screen_for_root (display, event->xany.window);
|
2001-05-30 15:36:31 +00:00
|
|
|
|
2002-02-08 03:34:26 +00:00
|
|
|
if (screen)
|
|
|
|
winname = g_strdup_printf ("root %d", screen->number);
|
|
|
|
else
|
|
|
|
winname = g_strdup_printf ("0x%lx", event->xany.window);
|
2012-11-20 23:35:41 +00:00
|
|
|
|
2002-02-08 03:34:26 +00:00
|
|
|
meta_topic (META_DEBUG_EVENTS,
|
2002-03-02 15:26:07 +00:00
|
|
|
"%s on %s%s %s %sserial %lu\n", name, winname,
|
2002-02-08 03:34:26 +00:00
|
|
|
extra ? ":" : "", extra ? extra : "",
|
2002-03-02 15:26:07 +00:00
|
|
|
event->xany.send_event ? "SEND " : "",
|
2002-02-08 03:34:26 +00:00
|
|
|
event->xany.serial);
|
2001-05-30 15:36:31 +00:00
|
|
|
|
2002-02-08 03:34:26 +00:00
|
|
|
g_free (winname);
|
2001-05-30 15:36:31 +00:00
|
|
|
|
2002-02-08 03:34:26 +00:00
|
|
|
if (extra)
|
|
|
|
g_free (extra);
|
2001-05-30 15:36:31 +00:00
|
|
|
}
|
2002-12-10 03:23:04 +00:00
|
|
|
#endif /* WITH_VERBOSE_MODE */
|
2001-05-30 15:36:31 +00:00
|
|
|
|
|
|
|
MetaWindow*
|
2001-05-31 06:42:58 +00:00
|
|
|
meta_display_lookup_x_window (MetaDisplay *display,
|
|
|
|
Window xwindow)
|
2001-05-30 15:36:31 +00:00
|
|
|
{
|
2013-02-06 22:02:59 +00:00
|
|
|
return g_hash_table_lookup (display->xids, &xwindow);
|
2001-05-30 15:36:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-05-31 06:42:58 +00:00
|
|
|
meta_display_register_x_window (MetaDisplay *display,
|
|
|
|
Window *xwindowp,
|
|
|
|
MetaWindow *window)
|
2001-05-30 15:36:31 +00:00
|
|
|
{
|
2013-02-06 22:02:59 +00:00
|
|
|
g_return_if_fail (g_hash_table_lookup (display->xids, xwindowp) == NULL);
|
2001-05-30 15:36:31 +00:00
|
|
|
|
2013-02-06 22:02:59 +00:00
|
|
|
g_hash_table_insert (display->xids, xwindowp, window);
|
2001-05-31 06:42:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_display_unregister_x_window (MetaDisplay *display,
|
|
|
|
Window xwindow)
|
|
|
|
{
|
2013-02-06 22:02:59 +00:00
|
|
|
g_return_if_fail (g_hash_table_lookup (display->xids, &xwindow) != NULL);
|
2001-05-31 06:42:58 +00:00
|
|
|
|
2013-02-06 22:02:59 +00:00
|
|
|
g_hash_table_remove (display->xids, &xwindow);
|
2014-02-15 16:33:12 +00:00
|
|
|
|
|
|
|
/* Remove any pending pings */
|
|
|
|
remove_pending_pings_for_window (display, xwindow);
|
2001-05-30 15:36:31 +00:00
|
|
|
}
|
2001-06-06 04:47:37 +00:00
|
|
|
|
2013-09-16 09:24:01 +00:00
|
|
|
void
|
|
|
|
meta_display_register_wayland_window (MetaDisplay *display,
|
|
|
|
MetaWindow *window)
|
|
|
|
{
|
|
|
|
g_hash_table_add (display->wayland_windows, window);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_display_unregister_wayland_window (MetaDisplay *display,
|
|
|
|
MetaWindow *window)
|
|
|
|
{
|
|
|
|
g_hash_table_remove (display->wayland_windows, window);
|
|
|
|
}
|
|
|
|
|
2011-06-08 15:26:03 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
/* We store sync alarms in the window ID hash table, because they are
|
|
|
|
* just more types of XIDs in the same global space, but we have
|
|
|
|
* typesafe functions to register/unregister for readability.
|
|
|
|
*/
|
|
|
|
|
|
|
|
MetaWindow*
|
|
|
|
meta_display_lookup_sync_alarm (MetaDisplay *display,
|
|
|
|
XSyncAlarm alarm)
|
|
|
|
{
|
|
|
|
return g_hash_table_lookup (display->xids, &alarm);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_display_register_sync_alarm (MetaDisplay *display,
|
|
|
|
XSyncAlarm *alarmp,
|
|
|
|
MetaWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (g_hash_table_lookup (display->xids, alarmp) == NULL);
|
|
|
|
|
|
|
|
g_hash_table_insert (display->xids, alarmp, window);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_display_unregister_sync_alarm (MetaDisplay *display,
|
|
|
|
XSyncAlarm alarm)
|
|
|
|
{
|
|
|
|
g_return_if_fail (g_hash_table_lookup (display->xids, &alarm) != NULL);
|
|
|
|
|
|
|
|
g_hash_table_remove (display->xids, &alarm);
|
|
|
|
}
|
|
|
|
#endif /* HAVE_XSYNC */
|
|
|
|
|
2009-10-13 14:34:34 +00:00
|
|
|
void
|
|
|
|
meta_display_notify_window_created (MetaDisplay *display,
|
|
|
|
MetaWindow *window)
|
|
|
|
{
|
|
|
|
g_signal_emit (display, display_signals[WINDOW_CREATED], 0, window);
|
|
|
|
}
|
|
|
|
|
2009-08-20 18:16:19 +00:00
|
|
|
/**
|
|
|
|
* meta_display_xwindow_is_a_no_focus_window:
|
|
|
|
* @display: A #MetaDisplay
|
|
|
|
* @xwindow: An X11 window
|
|
|
|
*
|
2013-02-15 18:42:08 +00:00
|
|
|
* Returns: %TRUE iff window is one of mutter's internal "no focus" windows
|
2009-08-20 18:16:19 +00:00
|
|
|
* (there is one per screen) which will have the focus when there is no
|
|
|
|
* actual client window focused.
|
|
|
|
*/
|
2005-12-28 06:24:30 +00:00
|
|
|
gboolean
|
|
|
|
meta_display_xwindow_is_a_no_focus_window (MetaDisplay *display,
|
|
|
|
Window xwindow)
|
|
|
|
{
|
|
|
|
gboolean is_a_no_focus_window = FALSE;
|
|
|
|
GSList *temp = display->screens;
|
|
|
|
while (temp != NULL) {
|
|
|
|
MetaScreen *screen = temp->data;
|
|
|
|
if (screen->no_focus_window == xwindow) {
|
|
|
|
is_a_no_focus_window = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
temp = temp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return is_a_no_focus_window;
|
|
|
|
}
|
|
|
|
|
2013-11-19 00:34:04 +00:00
|
|
|
static MetaCursor
|
|
|
|
meta_cursor_for_grab_op (MetaGrabOp op)
|
2001-07-26 03:14:45 +00:00
|
|
|
{
|
2002-02-24 19:58:27 +00:00
|
|
|
switch (op)
|
2001-07-26 03:14:45 +00:00
|
|
|
{
|
|
|
|
case META_GRAB_OP_RESIZING_SE:
|
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 04:27:23 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_SE:
|
2013-11-19 00:34:04 +00:00
|
|
|
return META_CURSOR_SE_RESIZE;
|
2001-07-26 03:14:45 +00:00
|
|
|
break;
|
|
|
|
case META_GRAB_OP_RESIZING_S:
|
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 04:27:23 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_S:
|
2013-11-19 00:34:04 +00:00
|
|
|
return META_CURSOR_SOUTH_RESIZE;
|
2001-07-26 03:14:45 +00:00
|
|
|
break;
|
|
|
|
case META_GRAB_OP_RESIZING_SW:
|
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 04:27:23 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_SW:
|
2013-11-19 00:34:04 +00:00
|
|
|
return META_CURSOR_SW_RESIZE;
|
2001-07-26 03:14:45 +00:00
|
|
|
break;
|
|
|
|
case META_GRAB_OP_RESIZING_N:
|
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 04:27:23 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_N:
|
2013-11-19 00:34:04 +00:00
|
|
|
return META_CURSOR_NORTH_RESIZE;
|
2001-07-26 03:14:45 +00:00
|
|
|
break;
|
|
|
|
case META_GRAB_OP_RESIZING_NE:
|
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 04:27:23 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_NE:
|
2013-11-19 00:34:04 +00:00
|
|
|
return META_CURSOR_NE_RESIZE;
|
2001-07-26 03:14:45 +00:00
|
|
|
break;
|
|
|
|
case META_GRAB_OP_RESIZING_NW:
|
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 04:27:23 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_NW:
|
2013-11-19 00:34:04 +00:00
|
|
|
return META_CURSOR_NW_RESIZE;
|
2001-07-26 03:14:45 +00:00
|
|
|
break;
|
|
|
|
case META_GRAB_OP_RESIZING_W:
|
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 04:27:23 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_W:
|
2013-11-19 00:34:04 +00:00
|
|
|
return META_CURSOR_WEST_RESIZE;
|
2001-07-26 03:14:45 +00:00
|
|
|
break;
|
|
|
|
case META_GRAB_OP_RESIZING_E:
|
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 04:27:23 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_E:
|
2013-11-19 00:34:04 +00:00
|
|
|
return META_CURSOR_EAST_RESIZE;
|
2001-07-26 03:14:45 +00:00
|
|
|
break;
|
2003-08-16 14:36:56 +00:00
|
|
|
case META_GRAB_OP_MOVING:
|
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 04:27:23 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_MOVING:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN:
|
2013-11-19 00:34:04 +00:00
|
|
|
return META_CURSOR_MOVE_OR_RESIZE_WINDOW;
|
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 04:27:23 +00:00
|
|
|
break;
|
2001-07-26 03:14:45 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-11-19 00:34:04 +00:00
|
|
|
return META_CURSOR_DEFAULT;
|
2001-07-26 03:14:45 +00:00
|
|
|
}
|
|
|
|
|
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 04:27:23 +00:00
|
|
|
void
|
|
|
|
meta_display_set_grab_op_cursor (MetaDisplay *display,
|
2002-08-14 16:51:13 +00: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 04:27:23 +00:00
|
|
|
MetaGrabOp op,
|
|
|
|
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 16:32:33 +00: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 04:27:23 +00:00
|
|
|
{
|
2012-11-20 22:08:31 +00:00
|
|
|
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
|
|
|
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
2013-12-05 21:45:29 +00:00
|
|
|
MetaCursor cursor = meta_cursor_for_grab_op (op);
|
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 04:27:23 +00:00
|
|
|
|
2012-11-20 22:08:31 +00:00
|
|
|
XISetMask (mask.mask, XI_ButtonPress);
|
|
|
|
XISetMask (mask.mask, XI_ButtonRelease);
|
|
|
|
XISetMask (mask.mask, XI_Enter);
|
|
|
|
XISetMask (mask.mask, XI_Leave);
|
|
|
|
XISetMask (mask.mask, XI_Motion);
|
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 04:27:23 +00:00
|
|
|
|
2012-11-20 22:08:31 +00:00
|
|
|
g_assert (screen != NULL);
|
Patch to provide extra cues to the user when using window menu move and
2002-08-08 Craig Black <blackc@speakeasy.net>
Patch to provide extra cues to the user when using
window menu move and resize, #85724.
* src/common.h: add new cursors
* src/display.c: (grab_op_is_mouse)
(meta_display_create_x_cursor), (xcursor_for_op),
(meta_display_set_grab_op_cursor),
(meta_display_begin_grab_op):
The keyboard move and resize grab ops now also use the mouse.
Allow the grab cursor to be changed during the grab op.
Hold onto the initial grab position in case of reset.
* src/display.h: save the initial grab position
* src/keybindings.c: (process_keyboard_move_grab),
(process_keyboard_resize_grab), (handle_begin_move),
(handle_begin_resize):
The keyboard move and resize grab ops now also use the mouse.
* src/window.c: (meta_window_client_message), (menu_callback),
(update_move), (update_resize),
(meta_window_handle_mouse_grab_op_event), (warp_pointer),
(meta_window_warp_pointer), (meta_window_begin_grab_op),
(meta_window_update_resize_grab_op):
When moving or resizing a window use the last grab position
in computing change increment.
Provide support for warping the mouse pointer.
* src/window.h: new warp pointer and grab op helper functions
2002-08-09 04:27:23 +00:00
|
|
|
|
2012-11-20 22:08:31 +00:00
|
|
|
meta_error_trap_push (display);
|
|
|
|
if (XIGrabDevice (display->xdisplay,
|
|
|
|
META_VIRTUAL_CORE_POINTER_ID,
|
|
|
|
grab_xwindow,
|
|
|
|
timestamp,
|
2013-12-05 21:45:29 +00:00
|
|
|
meta_display_create_x_cursor (display, cursor),
|
2012-11-20 23:06:09 +00:00
|
|
|
XIGrabModeAsync, XIGrabModeAsync,
|
2012-11-20 22:08:31 +00:00
|
|
|
False, /* owner_events */
|
|
|
|
&mask) == Success)
|
|
|
|
{
|
|
|
|
display->grab_have_pointer = TRUE;
|
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 04:27:23 +00:00
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
2012-11-20 22:08:31 +00:00
|
|
|
"XIGrabDevice() returned GrabSuccess time %u\n",
|
|
|
|
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 04:27:23 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-11-20 22:08:31 +00:00
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"XIGrabDevice() failed time %u\n",
|
|
|
|
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 04:27:23 +00:00
|
|
|
}
|
2013-11-19 00:34:04 +00:00
|
|
|
|
2012-11-20 22:08:31 +00:00
|
|
|
meta_error_trap_pop (display);
|
2013-11-19 00:34:04 +00:00
|
|
|
|
2013-12-05 21:45:29 +00:00
|
|
|
meta_cursor_tracker_set_grab_cursor (screen->cursor_tracker, 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 04:27:23 +00:00
|
|
|
}
|
|
|
|
|
2001-07-11 06:22:00 +00:00
|
|
|
gboolean
|
|
|
|
meta_display_begin_grab_op (MetaDisplay *display,
|
2002-06-27 05:08:32 +00:00
|
|
|
MetaScreen *screen,
|
2001-07-11 06:22:00 +00:00
|
|
|
MetaWindow *window,
|
|
|
|
MetaGrabOp op,
|
|
|
|
gboolean pointer_already_grabbed,
|
2006-10-13 00:28:34 +00:00
|
|
|
gboolean frame_action,
|
2001-07-11 06:22:00 +00: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 16:32:33 +00:00
|
|
|
guint32 timestamp,
|
2001-07-11 06:22:00 +00:00
|
|
|
int root_x,
|
|
|
|
int root_y)
|
|
|
|
{
|
2011-01-04 16:42:51 +00:00
|
|
|
MetaWindow *grab_window = NULL;
|
2002-03-02 15:26:07 +00:00
|
|
|
Window grab_xwindow;
|
2001-07-26 03:14:45 +00:00
|
|
|
|
2002-02-24 19:58:27 +00:00
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
2006-01-20 22:03:56 +00:00
|
|
|
"Doing grab op %u on window %s button %d pointer already grabbed: %d pointer pos %d,%d\n",
|
2003-10-12 06:25:38 +00:00
|
|
|
op, window ? window->desc : "none", button, pointer_already_grabbed,
|
|
|
|
root_x, root_y);
|
2001-07-11 06:22:00 +00:00
|
|
|
|
|
|
|
if (display->grab_op != META_GRAB_OP_NONE)
|
|
|
|
{
|
2008-11-23 18:53:55 +00:00
|
|
|
if (window)
|
|
|
|
meta_warning ("Attempt to perform window operation %u on window %s when operation %u on %s already in effect\n",
|
|
|
|
op, window->desc, display->grab_op,
|
|
|
|
display->grab_window ? display->grab_window->desc : "none");
|
2001-07-11 06:22:00 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2001-07-26 03:14:45 +00: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 19:35:03 +00:00
|
|
|
if (window &&
|
|
|
|
(meta_grab_op_is_moving (op) || meta_grab_op_is_resizing (op)))
|
|
|
|
{
|
|
|
|
if (meta_prefs_get_raise_on_click ())
|
|
|
|
meta_window_raise (window);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
display->grab_initial_x = root_x;
|
|
|
|
display->grab_initial_y = root_y;
|
|
|
|
display->grab_threshold_movement_reached = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-04 16:42:51 +00:00
|
|
|
/* If window is a modal dialog attached to its parent,
|
|
|
|
* grab the parent instead for moving.
|
|
|
|
*/
|
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 14:14:52 +00:00
|
|
|
if (window && meta_window_is_attached_dialog (window) &&
|
2011-01-04 16:42:51 +00:00
|
|
|
meta_grab_op_is_moving (op))
|
|
|
|
grab_window = meta_window_get_transient_for (window);
|
|
|
|
|
|
|
|
if (grab_window == NULL)
|
|
|
|
grab_window = window;
|
|
|
|
|
2002-07-01 03:20:29 +00:00
|
|
|
/* FIXME:
|
|
|
|
* If we have no MetaWindow we do our best
|
|
|
|
* and try to do the grab on the RootWindow.
|
|
|
|
* This will fail if anyone else has any
|
|
|
|
* key grab on the RootWindow.
|
|
|
|
*/
|
2011-01-04 16:42:51 +00:00
|
|
|
if (grab_window)
|
2013-12-06 05:57:11 +00:00
|
|
|
grab_xwindow = meta_window_get_toplevel_xwindow (grab_window);
|
2002-06-27 05:08:32 +00:00
|
|
|
else
|
|
|
|
grab_xwindow = screen->xroot;
|
2003-10-11 04:27:06 +00:00
|
|
|
|
|
|
|
display->grab_have_pointer = FALSE;
|
2002-03-02 15:26:07 +00:00
|
|
|
|
2001-07-11 06:22:00 +00:00
|
|
|
if (pointer_already_grabbed)
|
2001-07-26 03:14:45 +00:00
|
|
|
display->grab_have_pointer = TRUE;
|
2003-10-12 06:25:38 +00:00
|
|
|
|
2012-11-20 22:08:31 +00:00
|
|
|
meta_display_set_grab_op_cursor (display, screen, op, grab_xwindow, timestamp);
|
2001-07-11 06:22:00 +00:00
|
|
|
|
2011-10-01 07:00:57 +00:00
|
|
|
if (!display->grab_have_pointer && !grab_op_is_keyboard (op))
|
2001-07-11 06:22:00 +00:00
|
|
|
{
|
2002-02-24 19:58:27 +00:00
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
2012-11-20 22:08:31 +00:00
|
|
|
"XIGrabDevice() failed\n");
|
2001-07-11 06:22:00 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2001-08-19 18:09:10 +00:00
|
|
|
|
2006-08-21 18:38:21 +00:00
|
|
|
/* Grab keys for keyboard ops and mouse move/resizes; see #126497 */
|
|
|
|
if (grab_op_is_keyboard (op) || grab_op_is_mouse_only (op))
|
2001-07-11 06:22:00 +00:00
|
|
|
{
|
2011-01-04 16:42:51 +00:00
|
|
|
if (grab_window)
|
2002-06-27 05:08:32 +00:00
|
|
|
display->grab_have_keyboard =
|
2011-01-04 16:42:51 +00:00
|
|
|
meta_window_grab_all_keys (grab_window, timestamp);
|
2002-06-27 05:08:32 +00:00
|
|
|
|
2002-07-01 03:20:29 +00:00
|
|
|
else
|
|
|
|
display->grab_have_keyboard =
|
2006-09-09 20:19:56 +00:00
|
|
|
meta_screen_grab_all_keys (screen, timestamp);
|
2001-08-19 18:09:10 +00:00
|
|
|
|
2001-07-11 06:22:00 +00:00
|
|
|
if (!display->grab_have_keyboard)
|
|
|
|
{
|
2002-02-24 19:58:27 +00:00
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
2002-07-01 03:20:29 +00:00
|
|
|
"grabbing all keys failed, ungrabbing pointer\n");
|
2012-11-20 22:08:31 +00:00
|
|
|
XIUngrabDevice (display->xdisplay, META_VIRTUAL_CORE_POINTER_ID, timestamp);
|
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 17:27:24 +00:00
|
|
|
display->grab_have_pointer = FALSE;
|
2001-07-11 06:22:00 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
2001-08-19 18:09:10 +00:00
|
|
|
|
2001-07-11 06:22:00 +00:00
|
|
|
display->grab_op = op;
|
2011-01-04 16:42:51 +00:00
|
|
|
display->grab_window = grab_window;
|
2002-06-27 05:08:32 +00:00
|
|
|
display->grab_screen = screen;
|
2002-03-02 15:26:07 +00:00
|
|
|
display->grab_xwindow = grab_xwindow;
|
2001-07-11 06:22:00 +00:00
|
|
|
display->grab_button = button;
|
2002-04-28 04:52:26 +00:00
|
|
|
display->grab_mask = modmask;
|
2011-01-22 01:19:51 +00:00
|
|
|
if (window)
|
2011-10-08 15:00:16 +00:00
|
|
|
{
|
|
|
|
display->grab_tile_mode = window->tile_mode;
|
|
|
|
display->grab_tile_monitor_number = window->tile_monitor_number;
|
|
|
|
}
|
2011-01-22 01:19:51 +00:00
|
|
|
else
|
2011-10-08 15:00:16 +00:00
|
|
|
{
|
|
|
|
display->grab_tile_mode = META_TILE_NONE;
|
|
|
|
display->grab_tile_monitor_number = -1;
|
|
|
|
}
|
2003-10-12 06:25:38 +00:00
|
|
|
display->grab_anchor_root_x = root_x;
|
|
|
|
display->grab_anchor_root_y = root_y;
|
2002-12-10 03:23:04 +00:00
|
|
|
display->grab_latest_motion_x = root_x;
|
|
|
|
display->grab_latest_motion_y = root_y;
|
2002-08-10 05:27:17 +00:00
|
|
|
display->grab_last_moveresize_time.tv_sec = 0;
|
|
|
|
display->grab_last_moveresize_time.tv_usec = 0;
|
2003-01-22 04:54:04 +00:00
|
|
|
display->grab_motion_notify_time = 0;
|
2005-01-24 17:39:26 +00:00
|
|
|
display->grab_old_window_stacking = NULL;
|
2002-12-10 03:23:04 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
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 14:58:50 +00:00
|
|
|
display->grab_last_user_action_was_snap = FALSE;
|
2002-12-10 03:23:04 +00:00
|
|
|
#endif
|
2006-10-13 00:28:34 +00:00
|
|
|
display->grab_frame_action = frame_action;
|
2010-09-18 20:28:30 +00:00
|
|
|
display->grab_resize_unmaximize = 0;
|
2012-12-13 22:06:00 +00:00
|
|
|
display->grab_timestamp = timestamp;
|
2006-10-13 00:28:34 +00:00
|
|
|
|
Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
2004-06-19 00:45:24 +00:00
|
|
|
if (display->grab_resize_timeout_id)
|
|
|
|
{
|
|
|
|
g_source_remove (display->grab_resize_timeout_id);
|
|
|
|
display->grab_resize_timeout_id = 0;
|
|
|
|
}
|
|
|
|
|
2002-06-27 05:08:32 +00:00
|
|
|
if (display->grab_window)
|
|
|
|
{
|
2007-04-09 03:43:55 +00:00
|
|
|
meta_window_get_client_root_coords (display->grab_window,
|
|
|
|
&display->grab_initial_window_pos);
|
2003-10-12 06:25:38 +00:00
|
|
|
display->grab_anchor_window_pos = display->grab_initial_window_pos;
|
2002-12-10 03:23:04 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_XSYNC
|
2009-05-07 17:53:47 +00:00
|
|
|
if ( meta_grab_op_is_resizing (display->grab_op) &&
|
2011-06-08 15:26:03 +00:00
|
|
|
display->grab_window->sync_request_counter != None)
|
2002-12-10 03:23:04 +00:00
|
|
|
{
|
2011-06-08 15:26:03 +00:00
|
|
|
meta_window_create_sync_request_alarm (display->grab_window);
|
2002-12-10 03:23:04 +00:00
|
|
|
}
|
|
|
|
#endif
|
2002-06-27 05:08:32 +00:00
|
|
|
}
|
2001-07-12 05:53:56 +00:00
|
|
|
|
2002-02-24 19:58:27 +00:00
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
2006-01-20 22:03:56 +00:00
|
|
|
"Grab op %u on window %s successful\n",
|
2002-06-27 05:08:32 +00:00
|
|
|
display->grab_op, window ? window->desc : "(null)");
|
2001-07-11 06:22:00 +00:00
|
|
|
|
2002-06-27 05:08:32 +00:00
|
|
|
g_assert (display->grab_window != NULL || display->grab_screen != NULL);
|
2001-07-11 06:22:00 +00:00
|
|
|
g_assert (display->grab_op != META_GRAB_OP_NONE);
|
2001-08-19 18:09:10 +00:00
|
|
|
|
2005-01-24 05:58:30 +00:00
|
|
|
/* Save the old stacking */
|
|
|
|
if (GRAB_OP_IS_WINDOW_SWITCH (display->grab_op))
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Saving old stack positions; old pointer was %p.\n",
|
|
|
|
display->grab_old_window_stacking);
|
|
|
|
display->grab_old_window_stacking =
|
|
|
|
meta_stack_get_positions (screen->stack);
|
|
|
|
}
|
|
|
|
|
2002-06-27 05:08:32 +00:00
|
|
|
if (display->grab_window)
|
2003-11-30 03:30:27 +00:00
|
|
|
{
|
|
|
|
meta_window_refresh_resize_popup (display->grab_window);
|
|
|
|
}
|
2012-02-10 15:27:14 +00:00
|
|
|
|
|
|
|
g_signal_emit (display, display_signals[GRAB_OP_BEGIN], 0,
|
|
|
|
screen, display->grab_window, display->grab_op);
|
2001-07-11 06:22:00 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 16:32:33 +00:00
|
|
|
guint32 timestamp)
|
2001-07-11 06:22:00 +00:00
|
|
|
{
|
2003-01-21 22:40:25 +00:00
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
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 16:32:33 +00:00
|
|
|
"Ending grab op %u at time %u\n", display->grab_op, timestamp);
|
2002-07-06 16:50:48 +00:00
|
|
|
|
2001-07-11 06:22:00 +00:00
|
|
|
if (display->grab_op == META_GRAB_OP_NONE)
|
|
|
|
return;
|
2001-08-19 18:09:10 +00:00
|
|
|
|
2012-02-10 15:27:14 +00:00
|
|
|
g_signal_emit (display, display_signals[GRAB_OP_END], 0,
|
|
|
|
display->grab_screen, display->grab_window, display->grab_op);
|
|
|
|
|
2003-06-12 05:55:06 +00:00
|
|
|
if (display->grab_window != NULL)
|
|
|
|
display->grab_window->shaken_loose = FALSE;
|
|
|
|
|
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 19:35:03 +00:00
|
|
|
if (display->grab_window != NULL &&
|
|
|
|
!meta_prefs_get_raise_on_click () &&
|
|
|
|
(meta_grab_op_is_moving (display->grab_op) ||
|
|
|
|
meta_grab_op_is_resizing (display->grab_op)))
|
|
|
|
{
|
|
|
|
/* Only raise the window in orthogonal raise
|
|
|
|
* ('do-not-raise-on-click') mode if the user didn't try to move
|
|
|
|
* or resize the given window by at least a threshold amount.
|
|
|
|
* For raise on click mode, the window was raised at the
|
|
|
|
* beginning of the grab_op.
|
|
|
|
*/
|
|
|
|
if (!display->grab_threshold_movement_reached)
|
|
|
|
meta_window_raise (display->grab_window);
|
|
|
|
}
|
|
|
|
|
2005-01-24 05:58:30 +00:00
|
|
|
if (GRAB_OP_IS_WINDOW_SWITCH (display->grab_op) ||
|
2002-06-09 04:04:19 +00:00
|
|
|
display->grab_op == META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING)
|
2001-08-19 18:09:10 +00:00
|
|
|
{
|
2009-04-27 14:01:30 +00:00
|
|
|
if (GRAB_OP_IS_WINDOW_SWITCH (display->grab_op))
|
2009-04-27 15:19:08 +00:00
|
|
|
meta_screen_tab_popup_destroy (display->grab_screen);
|
2009-04-27 14:01:30 +00:00
|
|
|
else
|
2009-04-27 15:19:08 +00:00
|
|
|
meta_screen_workspace_popup_destroy (display->grab_screen);
|
2002-03-02 15:26:07 +00:00
|
|
|
|
|
|
|
/* If the ungrab here causes an EnterNotify, ignore it for
|
|
|
|
* sloppy focus
|
|
|
|
*/
|
|
|
|
display->ungrab_should_not_cause_focus_window = display->grab_xwindow;
|
2001-08-19 18:09:10 +00:00
|
|
|
}
|
2001-07-11 06:22:00 +00: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 14:58:50 +00:00
|
|
|
/* If this was a move or resize clear out the edge cache */
|
|
|
|
if (meta_grab_op_is_resizing (display->grab_op) ||
|
|
|
|
meta_grab_op_is_moving (display->grab_op))
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Clearing out the edges for resistance/snapping");
|
|
|
|
meta_display_cleanup_edges (display);
|
|
|
|
}
|
|
|
|
|
2005-01-24 05:58:30 +00:00
|
|
|
if (display->grab_old_window_stacking != NULL)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Clearing out the old stack position, which was %p.\n",
|
|
|
|
display->grab_old_window_stacking);
|
|
|
|
g_list_free (display->grab_old_window_stacking);
|
|
|
|
display->grab_old_window_stacking = NULL;
|
|
|
|
}
|
|
|
|
|
2001-07-11 06:22:00 +00:00
|
|
|
if (display->grab_have_pointer)
|
2002-03-02 15:26:07 +00:00
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
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 16:32:33 +00:00
|
|
|
"Ungrabbing pointer with timestamp %u\n", timestamp);
|
2012-11-20 22:08:31 +00:00
|
|
|
XIUngrabDevice (display->xdisplay, META_VIRTUAL_CORE_POINTER_ID, timestamp);
|
2002-03-02 15:26:07 +00:00
|
|
|
}
|
2001-07-11 06:22:00 +00:00
|
|
|
|
|
|
|
if (display->grab_have_keyboard)
|
2002-03-02 15:26:07 +00:00
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
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 16:32:33 +00:00
|
|
|
"Ungrabbing all keys timestamp %u\n", timestamp);
|
2002-06-27 05:08:32 +00:00
|
|
|
if (display->grab_window)
|
2006-09-09 20:19:56 +00:00
|
|
|
meta_window_ungrab_all_keys (display->grab_window, timestamp);
|
2002-06-27 05:08:32 +00:00
|
|
|
else
|
2006-09-09 20:19:56 +00:00
|
|
|
meta_screen_ungrab_all_keys (display->grab_screen, timestamp);
|
2002-03-02 15:26:07 +00:00
|
|
|
}
|
2002-12-10 03:23:04 +00:00
|
|
|
|
2013-11-19 00:34:04 +00:00
|
|
|
meta_cursor_tracker_set_grab_cursor (display->grab_screen->cursor_tracker, META_CURSOR_DEFAULT);
|
|
|
|
|
2012-12-13 22:06:00 +00:00
|
|
|
display->grab_timestamp = 0;
|
2001-07-11 06:22:00 +00:00
|
|
|
display->grab_window = NULL;
|
2002-06-27 05:08:32 +00:00
|
|
|
display->grab_screen = NULL;
|
2002-03-02 15:26:07 +00:00
|
|
|
display->grab_xwindow = None;
|
2011-01-19 16:00:18 +00:00
|
|
|
display->grab_tile_mode = META_TILE_NONE;
|
2011-10-08 15:00:16 +00:00
|
|
|
display->grab_tile_monitor_number = -1;
|
2001-07-26 03:14:45 +00:00
|
|
|
display->grab_op = META_GRAB_OP_NONE;
|
2002-03-17 17:22:23 +00:00
|
|
|
|
|
|
|
if (display->grab_resize_popup)
|
|
|
|
{
|
|
|
|
meta_ui_resize_popup_free (display->grab_resize_popup);
|
|
|
|
display->grab_resize_popup = NULL;
|
|
|
|
}
|
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-19 00:45:24 +00:00
|
|
|
|
|
|
|
if (display->grab_resize_timeout_id)
|
|
|
|
{
|
|
|
|
g_source_remove (display->grab_resize_timeout_id);
|
|
|
|
display->grab_resize_timeout_id = 0;
|
|
|
|
}
|
2001-07-26 03:14:45 +00:00
|
|
|
}
|
|
|
|
|
2009-08-28 15:25:51 +00:00
|
|
|
/**
|
|
|
|
* meta_display_get_grab_op:
|
2013-02-15 18:42:08 +00:00
|
|
|
* @display: The #MetaDisplay that the window is on
|
|
|
|
|
2009-08-28 15:25:51 +00:00
|
|
|
* Gets the current grab operation, if any.
|
|
|
|
*
|
|
|
|
* Return value: the current grab operation, or %META_GRAB_OP_NONE if
|
|
|
|
* Mutter doesn't currently have a grab. %META_GRAB_OP_COMPOSITOR will
|
|
|
|
* be returned if a compositor-plugin modal operation is in effect
|
|
|
|
* (See mutter_begin_modal_for_plugin())
|
|
|
|
*/
|
|
|
|
MetaGrabOp
|
|
|
|
meta_display_get_grab_op (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return display->grab_op;
|
|
|
|
}
|
|
|
|
|
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 19:35:03 +00:00
|
|
|
void
|
|
|
|
meta_display_check_threshold_reached (MetaDisplay *display,
|
|
|
|
int x,
|
|
|
|
int y)
|
|
|
|
{
|
|
|
|
/* Don't bother doing the check again if we've already reached the threshold */
|
2006-01-24 01:07:41 +00:00
|
|
|
if (meta_prefs_get_raise_on_click () ||
|
|
|
|
display->grab_threshold_movement_reached)
|
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 19:35:03 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (ABS (display->grab_initial_x - x) >= 8 ||
|
|
|
|
ABS (display->grab_initial_y - y) >= 8)
|
|
|
|
display->grab_threshold_movement_reached = TRUE;
|
|
|
|
}
|
|
|
|
|
2001-10-26 04:00:38 +00:00
|
|
|
static void
|
|
|
|
meta_change_button_grab (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
|
|
|
gboolean grab,
|
2001-12-11 04:03:58 +00:00
|
|
|
gboolean sync,
|
2001-10-26 04:00:38 +00:00
|
|
|
int button,
|
|
|
|
int modmask)
|
|
|
|
{
|
2003-05-21 03:45:58 +00:00
|
|
|
unsigned int ignored_mask;
|
2003-10-13 20:15:40 +00:00
|
|
|
|
2012-11-20 23:06:09 +00:00
|
|
|
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
|
|
|
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
|
|
|
|
|
|
|
XISetMask (mask.mask, XI_ButtonPress);
|
|
|
|
XISetMask (mask.mask, XI_ButtonRelease);
|
|
|
|
XISetMask (mask.mask, XI_Motion);
|
|
|
|
|
2003-10-13 20:15:40 +00:00
|
|
|
meta_verbose ("%s 0x%lx sync = %d button = %d modmask 0x%x\n",
|
|
|
|
grab ? "Grabbing" : "Ungrabbing",
|
|
|
|
xwindow,
|
|
|
|
sync, button, modmask);
|
2002-10-21 21:44:35 +00:00
|
|
|
|
|
|
|
meta_error_trap_push (display);
|
|
|
|
|
2001-10-26 04:00:38 +00:00
|
|
|
ignored_mask = 0;
|
2003-05-21 03:45:58 +00:00
|
|
|
while (ignored_mask <= display->ignored_modifier_mask)
|
2001-10-26 04:00:38 +00:00
|
|
|
{
|
2012-11-20 23:06:09 +00:00
|
|
|
XIGrabModifiers mods;
|
|
|
|
|
2002-04-28 04:52:26 +00:00
|
|
|
if (ignored_mask & ~(display->ignored_modifier_mask))
|
2001-10-26 04:00:38 +00:00
|
|
|
{
|
2002-04-28 04:52:26 +00:00
|
|
|
/* Not a combination of ignored modifiers
|
2001-10-26 04:00:38 +00:00
|
|
|
* (it contains some non-ignored modifiers)
|
|
|
|
*/
|
|
|
|
++ignored_mask;
|
|
|
|
continue;
|
|
|
|
}
|
2002-10-21 21:44:35 +00:00
|
|
|
|
2012-11-20 23:06:09 +00:00
|
|
|
mods = (XIGrabModifiers) { modmask | ignored_mask, 0 };
|
|
|
|
|
2002-10-21 21:44:35 +00:00
|
|
|
if (meta_is_debugging ())
|
|
|
|
meta_error_trap_push_with_return (display);
|
2003-10-13 20:15:40 +00:00
|
|
|
|
|
|
|
/* GrabModeSync means freeze until XAllowEvents */
|
2002-10-21 21:44:35 +00:00
|
|
|
|
2001-10-26 04:00:38 +00:00
|
|
|
if (grab)
|
2012-11-20 23:06:09 +00:00
|
|
|
XIGrabButton (display->xdisplay,
|
|
|
|
META_VIRTUAL_CORE_POINTER_ID,
|
|
|
|
button, xwindow, None,
|
|
|
|
sync ? XIGrabModeSync : XIGrabModeAsync,
|
|
|
|
XIGrabModeAsync, False,
|
|
|
|
&mask, 1, &mods);
|
2001-10-26 04:00:38 +00:00
|
|
|
else
|
2012-11-20 23:06:09 +00:00
|
|
|
XIUngrabButton (display->xdisplay,
|
|
|
|
META_VIRTUAL_CORE_POINTER_ID,
|
|
|
|
button, xwindow, 1, &mods);
|
2001-10-26 04:00:38 +00:00
|
|
|
|
2002-10-21 21:44:35 +00:00
|
|
|
if (meta_is_debugging ())
|
|
|
|
{
|
|
|
|
int result;
|
|
|
|
|
2010-10-25 18:44:30 +00:00
|
|
|
result = meta_error_trap_pop_with_return (display);
|
2002-10-21 21:44:35 +00:00
|
|
|
|
|
|
|
if (result != Success)
|
|
|
|
meta_verbose ("Failed to %s button %d with mask 0x%x for window 0x%lx error code %d\n",
|
|
|
|
grab ? "grab" : "ungrab",
|
|
|
|
button, modmask | ignored_mask, xwindow, result);
|
|
|
|
}
|
2001-10-26 04:00:38 +00:00
|
|
|
|
|
|
|
++ignored_mask;
|
|
|
|
}
|
2002-10-21 21:44:35 +00:00
|
|
|
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop (display);
|
2001-10-26 04:00:38 +00:00
|
|
|
}
|
|
|
|
|
2001-07-26 03:14:45 +00:00
|
|
|
void
|
|
|
|
meta_display_grab_window_buttons (MetaDisplay *display,
|
|
|
|
Window xwindow)
|
2002-10-07 23:14:40 +00:00
|
|
|
{
|
2006-07-24 17:15:32 +00:00
|
|
|
/* Grab Alt + button1 for moving window.
|
|
|
|
* Grab Alt + button2 for resizing window.
|
|
|
|
* Grab Alt + button3 for popping up window menu.
|
|
|
|
* Grab Alt + Shift + button1 for snap-moving window.
|
2001-07-26 03:14:45 +00:00
|
|
|
*/
|
2001-07-26 03:58:24 +00:00
|
|
|
meta_verbose ("Grabbing window buttons for 0x%lx\n", xwindow);
|
2002-10-07 23:14:40 +00:00
|
|
|
|
2001-08-19 18:09:10 +00:00
|
|
|
/* FIXME If we ignored errors here instead of spewing, we could
|
|
|
|
* put one big error trap around the loop and avoid a bunch of
|
|
|
|
* XSync()
|
|
|
|
*/
|
2002-10-07 23:14:40 +00:00
|
|
|
|
|
|
|
if (display->window_grab_modifiers != 0)
|
|
|
|
{
|
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 10:29:20 +00:00
|
|
|
gboolean debug = g_getenv ("MUTTER_DEBUG_BUTTON_GRABS") != NULL;
|
2006-07-24 17:15:32 +00:00
|
|
|
int i;
|
|
|
|
for (i = 1; i < 4; i++)
|
2002-10-07 23:14:40 +00:00
|
|
|
{
|
2006-07-24 17:15:32 +00:00
|
|
|
meta_change_button_grab (display, xwindow,
|
2001-10-26 04:00:38 +00:00
|
|
|
TRUE,
|
2001-12-11 04:03:58 +00:00
|
|
|
FALSE,
|
2002-10-07 23:14:40 +00:00
|
|
|
i, display->window_grab_modifiers);
|
|
|
|
|
|
|
|
/* This is for debugging, since I end up moving the Xnest
|
|
|
|
* otherwise ;-)
|
|
|
|
*/
|
|
|
|
if (debug)
|
|
|
|
meta_change_button_grab (display, xwindow,
|
|
|
|
TRUE,
|
|
|
|
FALSE,
|
|
|
|
i, ControlMask);
|
|
|
|
}
|
2006-07-24 17:15:32 +00:00
|
|
|
|
|
|
|
/* In addition to grabbing Alt+Button1 for moving the window,
|
|
|
|
* grab Alt+Shift+Button1 for snap-moving the window. See bug
|
|
|
|
* 112478. Unfortunately, this doesn't work with
|
|
|
|
* Shift+Alt+Button1 for some reason; so at least part of the
|
|
|
|
* order still matters, which sucks (please FIXME).
|
|
|
|
*/
|
|
|
|
meta_change_button_grab (display, xwindow,
|
|
|
|
TRUE,
|
|
|
|
FALSE,
|
|
|
|
1, display->window_grab_modifiers | ShiftMask);
|
2002-10-07 23:14:40 +00:00
|
|
|
}
|
2001-07-11 06:22:00 +00:00
|
|
|
}
|
2001-07-26 03:14:45 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
meta_display_ungrab_window_buttons (MetaDisplay *display,
|
|
|
|
Window xwindow)
|
|
|
|
{
|
2002-10-07 23:14:40 +00:00
|
|
|
gboolean debug;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (display->window_grab_modifiers == 0)
|
|
|
|
return;
|
|
|
|
|
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 10:29:20 +00:00
|
|
|
debug = g_getenv ("MUTTER_DEBUG_BUTTON_GRABS") != NULL;
|
2002-10-07 23:14:40 +00:00
|
|
|
i = 1;
|
2001-08-19 18:09:10 +00:00
|
|
|
while (i < 4)
|
|
|
|
{
|
2001-10-26 04:00:38 +00:00
|
|
|
meta_change_button_grab (display, xwindow,
|
2002-10-07 23:14:40 +00:00
|
|
|
FALSE, FALSE, i,
|
|
|
|
display->window_grab_modifiers);
|
|
|
|
|
2001-10-26 04:00:38 +00:00
|
|
|
if (debug)
|
|
|
|
meta_change_button_grab (display, xwindow,
|
2001-12-11 04:03:58 +00:00
|
|
|
FALSE, FALSE, i, ControlMask);
|
2001-08-19 18:09:10 +00:00
|
|
|
|
|
|
|
++i;
|
|
|
|
}
|
2001-07-26 03:14:45 +00:00
|
|
|
}
|
|
|
|
|
2001-12-10 07:48:21 +00:00
|
|
|
/* Grab buttons we only grab while unfocused in click-to-focus mode */
|
2002-02-08 06:50:09 +00:00
|
|
|
#define MAX_FOCUS_BUTTON 4
|
2001-12-10 07:48:21 +00:00
|
|
|
void
|
2001-12-11 04:03:58 +00:00
|
|
|
meta_display_grab_focus_window_button (MetaDisplay *display,
|
2003-10-13 20:15:40 +00:00
|
|
|
MetaWindow *window)
|
2001-12-10 07:48:21 +00:00
|
|
|
{
|
|
|
|
/* Grab button 1 for activating unfocused windows */
|
2003-10-13 20:15:40 +00:00
|
|
|
meta_verbose ("Grabbing unfocused window buttons for %s\n", window->desc);
|
2012-04-24 22:02:33 +00:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* FIXME:115072 */
|
|
|
|
/* Don't grab at all unless in click to focus mode. In click to
|
|
|
|
* focus, we may sometimes be clever about intercepting and eating
|
|
|
|
* the focus click. But in mouse focus, we never do that since the
|
|
|
|
* focus window may not be raised, and who wants to think about
|
|
|
|
* mouse focus anyway.
|
|
|
|
*/
|
|
|
|
if (meta_prefs_get_focus_mode () != G_DESKTOP_FOCUS_MODE_CLICK)
|
|
|
|
{
|
|
|
|
meta_verbose (" (well, not grabbing since not in click to focus mode)\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
#endif
|
2003-10-13 20:15:40 +00:00
|
|
|
|
|
|
|
if (window->have_focus_click_grab)
|
|
|
|
{
|
|
|
|
meta_verbose (" (well, not grabbing since we already have the grab)\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-12-10 07:48:21 +00:00
|
|
|
/* FIXME If we ignored errors here instead of spewing, we could
|
|
|
|
* put one big error trap around the loop and avoid a bunch of
|
|
|
|
* XSync()
|
|
|
|
*/
|
|
|
|
|
|
|
|
{
|
|
|
|
int i = 1;
|
2002-02-08 06:50:09 +00:00
|
|
|
while (i < MAX_FOCUS_BUTTON)
|
2001-12-10 07:48:21 +00:00
|
|
|
{
|
|
|
|
meta_change_button_grab (display,
|
2003-10-13 20:15:40 +00:00
|
|
|
window->xwindow,
|
|
|
|
TRUE, TRUE,
|
|
|
|
i, 0);
|
2001-12-10 07:48:21 +00:00
|
|
|
|
|
|
|
++i;
|
|
|
|
}
|
2003-10-13 20:15:40 +00:00
|
|
|
|
|
|
|
window->have_focus_click_grab = TRUE;
|
2001-12-10 07:48:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-12-11 04:03:58 +00:00
|
|
|
meta_display_ungrab_focus_window_button (MetaDisplay *display,
|
2003-10-13 20:15:40 +00:00
|
|
|
MetaWindow *window)
|
2001-12-10 07:48:21 +00:00
|
|
|
{
|
2003-10-13 20:15:40 +00:00
|
|
|
meta_verbose ("Ungrabbing unfocused window buttons for %s\n", window->desc);
|
2001-12-10 07:48:21 +00:00
|
|
|
|
2003-10-13 20:15:40 +00:00
|
|
|
if (!window->have_focus_click_grab)
|
|
|
|
return;
|
|
|
|
|
2001-12-10 07:48:21 +00:00
|
|
|
{
|
|
|
|
int i = 1;
|
2002-02-08 06:50:09 +00:00
|
|
|
while (i < MAX_FOCUS_BUTTON)
|
2001-12-10 07:48:21 +00:00
|
|
|
{
|
2003-10-13 20:15:40 +00:00
|
|
|
meta_change_button_grab (display, window->xwindow,
|
|
|
|
FALSE, FALSE, i, 0);
|
2001-12-10 07:48:21 +00:00
|
|
|
|
|
|
|
++i;
|
|
|
|
}
|
2003-10-13 20:15:40 +00:00
|
|
|
|
|
|
|
window->have_focus_click_grab = FALSE;
|
2001-12-10 07:48:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-08-30 04:01:38 +00:00
|
|
|
void
|
|
|
|
meta_display_increment_event_serial (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
/* We just make some random X request */
|
|
|
|
XDeleteProperty (display->xdisplay, display->leader_window,
|
2008-05-02 18:49:01 +00:00
|
|
|
display->atom__MOTIF_WM_HINTS);
|
2001-08-30 04:01:38 +00:00
|
|
|
}
|
2001-10-07 23:06:19 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
meta_display_update_active_window_hint (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
GSList *tmp;
|
|
|
|
|
2007-04-03 22:26:47 +00:00
|
|
|
gulong data[1];
|
2001-10-07 23:06:19 +00:00
|
|
|
|
|
|
|
if (display->focus_window)
|
|
|
|
data[0] = display->focus_window->xwindow;
|
|
|
|
else
|
|
|
|
data[0] = None;
|
|
|
|
|
|
|
|
tmp = display->screens;
|
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaScreen *screen = tmp->data;
|
|
|
|
|
|
|
|
meta_error_trap_push (display);
|
|
|
|
XChangeProperty (display->xdisplay, screen->xroot,
|
2008-05-02 18:49:01 +00:00
|
|
|
display->atom__NET_ACTIVE_WINDOW,
|
2001-10-07 23:06:19 +00:00
|
|
|
XA_WINDOW,
|
2007-04-03 22:26:47 +00:00
|
|
|
32, PropModeReplace, (guchar*) data, 1);
|
|
|
|
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop (display);
|
2001-10-07 23:06:19 +00:00
|
|
|
|
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
}
|
2001-10-15 03:39:41 +00:00
|
|
|
|
2002-02-07 03:25:34 +00:00
|
|
|
void
|
|
|
|
meta_display_queue_retheme_all_windows (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
GSList* windows;
|
|
|
|
GSList *tmp;
|
|
|
|
|
2009-06-15 19:32:23 +00:00
|
|
|
windows = meta_display_list_windows (display, META_LIST_DEFAULT);
|
2002-02-07 03:25:34 +00:00
|
|
|
tmp = windows;
|
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaWindow *window = tmp->data;
|
|
|
|
|
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-11 01:15:33 +00:00
|
|
|
meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
|
2013-11-15 22:37:50 +00:00
|
|
|
meta_window_frame_size_changed (window);
|
2002-02-07 03:25:34 +00:00
|
|
|
if (window->frame)
|
2002-05-31 00:02:54 +00:00
|
|
|
{
|
|
|
|
meta_frame_queue_draw (window->frame);
|
2003-01-05 07:51:02 +00:00
|
|
|
}
|
2002-02-07 03:25:34 +00:00
|
|
|
|
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_slist_free (windows);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_display_retheme_all (void)
|
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
meta_display_queue_retheme_all_windows (meta_get_display ());
|
2002-02-07 03:25:34 +00:00
|
|
|
}
|
|
|
|
|
2005-07-11 13:25:08 +00:00
|
|
|
void
|
|
|
|
meta_display_set_cursor_theme (const char *theme,
|
|
|
|
int size)
|
|
|
|
{
|
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-25 03:39:13 +00:00
|
|
|
GSList *tmp;
|
2005-07-11 13:25:08 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
MetaDisplay *display = meta_get_display ();
|
2005-07-11 13:25:08 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
XcursorSetTheme (display->xdisplay, theme);
|
|
|
|
XcursorSetDefaultSize (display->xdisplay, size);
|
|
|
|
|
|
|
|
tmp = display->screens;
|
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaScreen *screen = tmp->data;
|
2005-07-11 13:25:08 +00:00
|
|
|
|
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-25 03:39:13 +00:00
|
|
|
meta_screen_update_cursor (screen);
|
2005-07-11 13:25:08 +00:00
|
|
|
|
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-02 15:34:45 +00:00
|
|
|
/*
|
2008-01-13 01:01:21 +00:00
|
|
|
* Stores whether syncing is currently enabled.
|
2008-01-06 21:23:33 +00:00
|
|
|
*/
|
2002-01-28 02:09:12 +00:00
|
|
|
static gboolean is_syncing = FALSE;
|
|
|
|
|
2008-01-13 01:01:21 +00:00
|
|
|
/**
|
2011-11-02 15:34:45 +00:00
|
|
|
* meta_is_syncing:
|
2008-01-06 21:23:33 +00:00
|
|
|
*
|
2011-11-02 15:34:45 +00:00
|
|
|
* Returns whether X synchronisation is currently enabled.
|
2008-01-06 21:23:33 +00:00
|
|
|
*
|
2011-11-02 15:34:45 +00:00
|
|
|
* FIXME: This is *only* called by meta_display_open(), but by that time
|
2008-01-06 21:23:33 +00:00
|
|
|
* we have already turned syncing on or off on startup, and we don't
|
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 10:29:20 +00:00
|
|
|
* have any way to do so while Mutter is running, so it's rather
|
2008-01-06 21:23:33 +00:00
|
|
|
* pointless.
|
2011-11-02 15:34:45 +00:00
|
|
|
*
|
|
|
|
* Returns: %TRUE if we must wait for events whenever we send X requests;
|
|
|
|
* %FALSE otherwise.
|
2008-01-06 21:23:33 +00:00
|
|
|
*/
|
2002-01-28 02:09:12 +00:00
|
|
|
gboolean
|
|
|
|
meta_is_syncing (void)
|
|
|
|
{
|
|
|
|
return is_syncing;
|
|
|
|
}
|
|
|
|
|
2008-01-13 01:01:21 +00:00
|
|
|
/**
|
2011-11-02 15:34:45 +00:00
|
|
|
* meta_set_syncing:
|
2013-02-15 18:42:08 +00:00
|
|
|
* @setting: whether to turn syncing on or off
|
2008-01-06 21:23:33 +00:00
|
|
|
*
|
2011-11-02 15:34:45 +00:00
|
|
|
* A handy way to turn on synchronisation on or off for every display.
|
2008-01-06 21:23:33 +00:00
|
|
|
*/
|
2002-01-28 02:09:12 +00:00
|
|
|
void
|
|
|
|
meta_set_syncing (gboolean setting)
|
|
|
|
{
|
|
|
|
if (setting != is_syncing)
|
|
|
|
{
|
|
|
|
is_syncing = setting;
|
2010-05-25 17:24:42 +00:00
|
|
|
if (meta_get_display ())
|
|
|
|
XSynchronize (meta_get_display ()->xdisplay, is_syncing);
|
2002-01-28 02:09:12 +00:00
|
|
|
}
|
|
|
|
}
|
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-27 02:05:39 +00:00
|
|
|
|
2014-02-15 16:33:12 +00:00
|
|
|
/*
|
|
|
|
* How long, in milliseconds, we should wait after pinging a window
|
|
|
|
* before deciding it's not going to get back to us.
|
|
|
|
*/
|
|
|
|
#define PING_TIMEOUT_DELAY 5000
|
|
|
|
|
|
|
|
/**
|
|
|
|
* meta_display_ping_timeout:
|
|
|
|
* @data: All the information about this ping. It is a #MetaPingData
|
|
|
|
* cast to a #gpointer in order to be passable to a timeout function.
|
|
|
|
* This function will also free this parameter.
|
|
|
|
*
|
|
|
|
* Does whatever it is we decided to do when a window didn't respond
|
|
|
|
* to a ping. We also remove the ping from the display's list of
|
|
|
|
* pending pings. This function is called by the event loop when the timeout
|
|
|
|
* times out which we created at the start of the ping.
|
|
|
|
*
|
|
|
|
* Returns: Always returns %FALSE, because this function is called as a
|
|
|
|
* timeout and we don't want to run the timer again.
|
|
|
|
*/
|
|
|
|
static gboolean
|
|
|
|
meta_display_ping_timeout (gpointer data)
|
|
|
|
{
|
|
|
|
MetaPingData *ping_data = data;
|
|
|
|
MetaDisplay *display = ping_data->window->display;
|
|
|
|
|
|
|
|
ping_data->ping_timeout_id = 0;
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_PING,
|
|
|
|
"Ping %u on window %s timed out\n",
|
|
|
|
ping_data->timestamp, ping_data->window->desc);
|
|
|
|
|
|
|
|
(* ping_data->ping_timeout_func) (ping_data->window, ping_data->timestamp, ping_data->user_data);
|
|
|
|
|
|
|
|
display->pending_pings = g_slist_remove (display->pending_pings, ping_data);
|
|
|
|
ping_data_free (ping_data);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* meta_display_ping_window:
|
|
|
|
* @display: The #MetaDisplay that the window is on
|
|
|
|
* @window: The #MetaWindow to send the ping to
|
|
|
|
* @timestamp: The timestamp of the ping. Used for uniqueness.
|
|
|
|
* Cannot be CurrentTime; use a real timestamp!
|
|
|
|
* @ping_reply_func: The callback to call if we get a response.
|
|
|
|
* @ping_timeout_func: The callback to call if we don't get a response.
|
|
|
|
* @user_data: Arbitrary data that will be passed to the callback
|
|
|
|
* function. (In practice it's often a pointer to
|
|
|
|
* the window.)
|
|
|
|
*
|
|
|
|
* Sends a ping request to a window. The window must respond to
|
|
|
|
* the request within a certain amount of time. If it does, we
|
|
|
|
* will call one callback; if the time passes and we haven't had
|
|
|
|
* a response, we call a different callback. The window must have
|
|
|
|
* the hint showing that it can respond to a ping; if it doesn't,
|
|
|
|
* we call the "got a response" callback immediately and return.
|
|
|
|
* This function returns straight away after setting things up;
|
|
|
|
* the callbacks will be called from the event loop.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
meta_display_ping_window (MetaWindow *window,
|
|
|
|
guint32 timestamp,
|
|
|
|
MetaWindowPingFunc ping_reply_func,
|
|
|
|
MetaWindowPingFunc ping_timeout_func,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
MetaDisplay *display = window->display;
|
|
|
|
MetaPingData *ping_data;
|
|
|
|
|
|
|
|
if (timestamp == CurrentTime)
|
|
|
|
{
|
|
|
|
meta_warning ("Tried to ping a window with CurrentTime! Not allowed.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-02-19 01:28:23 +00:00
|
|
|
if (!window->can_ping)
|
2014-02-15 16:33:12 +00:00
|
|
|
{
|
|
|
|
if (ping_reply_func)
|
|
|
|
(* ping_reply_func) (window, timestamp, user_data);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ping_data = g_new (MetaPingData, 1);
|
|
|
|
ping_data->window = window;
|
|
|
|
ping_data->timestamp = timestamp;
|
|
|
|
ping_data->ping_reply_func = ping_reply_func;
|
|
|
|
ping_data->ping_timeout_func = ping_timeout_func;
|
|
|
|
ping_data->user_data = user_data;
|
|
|
|
ping_data->ping_timeout_id = g_timeout_add (PING_TIMEOUT_DELAY,
|
|
|
|
meta_display_ping_timeout,
|
|
|
|
ping_data);
|
|
|
|
|
|
|
|
display->pending_pings = g_slist_prepend (display->pending_pings, ping_data);
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_PING,
|
|
|
|
"Sending ping with timestamp %u to window %s\n",
|
|
|
|
timestamp, window->desc);
|
|
|
|
|
|
|
|
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11)
|
|
|
|
meta_window_send_icccm_message (window,
|
|
|
|
display->atom__NET_WM_PING,
|
|
|
|
timestamp);
|
|
|
|
else
|
|
|
|
meta_wayland_surface_ping (window->surface, timestamp);
|
|
|
|
}
|
|
|
|
|
2004-01-10 17:16:07 +00:00
|
|
|
static void
|
|
|
|
process_request_frame_extents (MetaDisplay *display,
|
|
|
|
XEvent *event)
|
|
|
|
{
|
|
|
|
/* The X window whose frame extents will be set. */
|
|
|
|
Window xwindow = event->xclient.window;
|
|
|
|
unsigned long data[4] = { 0, 0, 0, 0 };
|
|
|
|
|
|
|
|
MotifWmHints *hints = NULL;
|
|
|
|
gboolean hints_set = FALSE;
|
|
|
|
|
|
|
|
meta_verbose ("Setting frame extents for 0x%lx\n", xwindow);
|
|
|
|
|
|
|
|
/* See if the window is decorated. */
|
|
|
|
hints_set = meta_prop_get_motif_hints (display,
|
|
|
|
xwindow,
|
2008-05-02 18:49:01 +00:00
|
|
|
display->atom__MOTIF_WM_HINTS,
|
2004-01-10 17:16:07 +00:00
|
|
|
&hints);
|
|
|
|
if ((hints_set && hints->decorations) || !hints_set)
|
|
|
|
{
|
2011-07-12 04:37:41 +00:00
|
|
|
MetaFrameBorders borders;
|
2004-01-10 17:16:07 +00:00
|
|
|
MetaScreen *screen;
|
|
|
|
|
|
|
|
screen = meta_display_screen_for_xwindow (display,
|
|
|
|
event->xclient.window);
|
|
|
|
if (screen == NULL)
|
|
|
|
{
|
|
|
|
meta_warning ("Received request to set _NET_FRAME_EXTENTS "
|
|
|
|
"on 0x%lx which is on a screen we are not managing\n",
|
|
|
|
event->xclient.window);
|
|
|
|
meta_XFree (hints);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return estimated frame extents for a normal window. */
|
|
|
|
meta_ui_theme_get_frame_borders (screen->ui,
|
|
|
|
META_FRAME_TYPE_NORMAL,
|
|
|
|
0,
|
2011-07-12 04:37:41 +00:00
|
|
|
&borders);
|
|
|
|
data[0] = borders.visible.left;
|
|
|
|
data[1] = borders.visible.right;
|
|
|
|
data[2] = borders.visible.top;
|
|
|
|
data[3] = borders.visible.bottom;
|
2004-01-10 17:16:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_GEOMETRY,
|
|
|
|
"Setting _NET_FRAME_EXTENTS on unmanaged window 0x%lx "
|
2006-01-20 22:03:56 +00:00
|
|
|
"to top = %lu, left = %lu, bottom = %lu, right = %lu\n",
|
2004-01-10 17:16:07 +00:00
|
|
|
xwindow, data[0], data[1], data[2], data[3]);
|
|
|
|
|
|
|
|
meta_error_trap_push (display);
|
|
|
|
XChangeProperty (display->xdisplay, xwindow,
|
2008-05-02 18:49:01 +00:00
|
|
|
display->atom__NET_FRAME_EXTENTS,
|
2004-01-10 17:16:07 +00:00
|
|
|
XA_CARDINAL,
|
|
|
|
32, PropModeReplace, (guchar*) data, 4);
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop (display);
|
2004-01-10 17:16:07 +00:00
|
|
|
|
|
|
|
meta_XFree (hints);
|
|
|
|
}
|
|
|
|
|
2014-02-15 16:33:12 +00:00
|
|
|
/**
|
|
|
|
* meta_display_pong_for_serial:
|
|
|
|
* @display: the display we got the pong from
|
|
|
|
* @serial: the serial in the pong repsonse
|
|
|
|
*
|
|
|
|
* Process the pong (the response message) from the ping we sent
|
|
|
|
* to the window. This involves removing the timeout, calling the
|
|
|
|
* reply handler function, and freeing memory.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
meta_display_pong_for_serial (MetaDisplay *display,
|
|
|
|
guint32 serial)
|
|
|
|
{
|
|
|
|
GSList *tmp;
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_PING, "Received a pong with serial %u\n", serial);
|
|
|
|
|
|
|
|
for (tmp = display->pending_pings; tmp; tmp = tmp->next)
|
|
|
|
{
|
|
|
|
MetaPingData *ping_data = tmp->data;
|
|
|
|
|
|
|
|
if (serial == ping_data->timestamp)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_PING,
|
|
|
|
"Matching ping found for pong %u\n",
|
|
|
|
ping_data->timestamp);
|
|
|
|
|
|
|
|
/* Remove the ping data from the list */
|
|
|
|
display->pending_pings = g_slist_remove (display->pending_pings,
|
|
|
|
ping_data);
|
|
|
|
|
|
|
|
/* Remove the timeout */
|
|
|
|
if (ping_data->ping_timeout_id != 0)
|
|
|
|
{
|
|
|
|
g_source_remove (ping_data->ping_timeout_id);
|
|
|
|
ping_data->ping_timeout_id = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Call callback */
|
|
|
|
(* ping_data->ping_reply_func) (ping_data->window,
|
|
|
|
ping_data->timestamp,
|
|
|
|
ping_data->user_data);
|
|
|
|
|
|
|
|
ping_data_free (ping_data);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-04-15 02:05:44 +00:00
|
|
|
MetaGroup*
|
|
|
|
get_focussed_group (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
if (display->focus_window)
|
|
|
|
return display->focus_window->group;
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define IN_TAB_CHAIN(w,t) (((t) == META_TAB_LIST_NORMAL && META_WINDOW_IN_NORMAL_TAB_CHAIN (w)) \
|
|
|
|
|| ((t) == META_TAB_LIST_DOCKS && META_WINDOW_IN_DOCK_TAB_CHAIN (w)) \
|
2012-03-12 22:00:12 +00:00
|
|
|
|| ((t) == META_TAB_LIST_GROUP && META_WINDOW_IN_GROUP_TAB_CHAIN (w, get_focussed_group(w->display))) \
|
|
|
|
|| ((t) == META_TAB_LIST_NORMAL_ALL && META_WINDOW_IN_NORMAL_TAB_CHAIN_TYPE (w)))
|
2002-04-05 15:52:49 +00:00
|
|
|
|
2002-03-12 04:34:17 +00:00
|
|
|
static MetaWindow*
|
|
|
|
find_tab_forward (MetaDisplay *display,
|
2002-04-05 15:52:49 +00:00
|
|
|
MetaTabList type,
|
2004-10-25 16:17:19 +00:00
|
|
|
MetaScreen *screen,
|
2002-03-12 04:34:17 +00:00
|
|
|
MetaWorkspace *workspace,
|
2004-10-25 16:17:19 +00:00
|
|
|
GList *start,
|
|
|
|
gboolean skip_first)
|
2002-03-12 04:34:17 +00:00
|
|
|
{
|
|
|
|
GList *tmp;
|
|
|
|
|
|
|
|
g_return_val_if_fail (start != NULL, NULL);
|
2003-08-15 22:09:55 +00:00
|
|
|
g_return_val_if_fail (workspace != NULL, NULL);
|
2002-05-11 06:59:54 +00:00
|
|
|
|
2004-10-25 16:17:19 +00:00
|
|
|
tmp = start;
|
|
|
|
if (skip_first)
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
2002-03-12 04:34:17 +00:00
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaWindow *window = tmp->data;
|
|
|
|
|
2002-05-11 06:59:54 +00:00
|
|
|
if (window->screen == screen &&
|
2003-08-15 22:09:55 +00:00
|
|
|
IN_TAB_CHAIN (window, type))
|
2002-03-12 04:34:17 +00:00
|
|
|
return window;
|
|
|
|
|
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
2003-08-15 22:09:55 +00:00
|
|
|
tmp = workspace->mru_list;
|
2002-03-12 04:34:17 +00:00
|
|
|
while (tmp != start)
|
|
|
|
{
|
|
|
|
MetaWindow *window = tmp->data;
|
|
|
|
|
2003-08-15 22:09:55 +00:00
|
|
|
if (IN_TAB_CHAIN (window, type))
|
2002-03-12 04:34:17 +00:00
|
|
|
return window;
|
|
|
|
|
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static MetaWindow*
|
|
|
|
find_tab_backward (MetaDisplay *display,
|
2002-04-05 15:52:49 +00:00
|
|
|
MetaTabList type,
|
2004-10-25 16:17:19 +00:00
|
|
|
MetaScreen *screen,
|
2002-03-12 04:34:17 +00:00
|
|
|
MetaWorkspace *workspace,
|
2004-10-25 16:17:19 +00:00
|
|
|
GList *start,
|
|
|
|
gboolean skip_last)
|
2002-03-12 04:34:17 +00:00
|
|
|
{
|
|
|
|
GList *tmp;
|
|
|
|
|
|
|
|
g_return_val_if_fail (start != NULL, NULL);
|
2003-08-15 22:09:55 +00:00
|
|
|
g_return_val_if_fail (workspace != NULL, NULL);
|
2004-10-25 16:17:19 +00:00
|
|
|
|
|
|
|
tmp = start;
|
|
|
|
if (skip_last)
|
|
|
|
tmp = tmp->prev;
|
2002-03-12 04:34:17 +00:00
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaWindow *window = tmp->data;
|
|
|
|
|
2002-05-11 06:59:54 +00:00
|
|
|
if (window->screen == screen &&
|
2003-08-15 22:09:55 +00:00
|
|
|
IN_TAB_CHAIN (window, type))
|
2002-03-12 04:34:17 +00:00
|
|
|
return window;
|
|
|
|
|
|
|
|
tmp = tmp->prev;
|
|
|
|
}
|
|
|
|
|
2003-08-15 22:09:55 +00:00
|
|
|
tmp = g_list_last (workspace->mru_list);
|
2002-03-12 04:34:17 +00:00
|
|
|
while (tmp != start)
|
|
|
|
{
|
|
|
|
MetaWindow *window = tmp->data;
|
|
|
|
|
2003-08-15 22:09:55 +00:00
|
|
|
if (IN_TAB_CHAIN (window, type))
|
2002-03-12 04:34:17 +00:00
|
|
|
return window;
|
|
|
|
|
|
|
|
tmp = tmp->prev;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-12-03 16:59:11 +00:00
|
|
|
static int
|
|
|
|
mru_cmp (gconstpointer a,
|
|
|
|
gconstpointer b)
|
|
|
|
{
|
|
|
|
guint32 time_a, time_b;
|
|
|
|
|
|
|
|
time_a = meta_window_get_user_time ((MetaWindow *)a);
|
|
|
|
time_b = meta_window_get_user_time ((MetaWindow *)b);
|
|
|
|
|
|
|
|
if (time_a > time_b)
|
|
|
|
return -1;
|
|
|
|
else if (time_a < time_b)
|
|
|
|
return 1;
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-09-01 19:39:53 +00:00
|
|
|
/**
|
|
|
|
* meta_display_get_tab_list:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
* @type: type of tab list
|
|
|
|
* @screen: a #MetaScreen
|
2012-12-03 16:59:11 +00:00
|
|
|
* @workspace: (allow-none): origin workspace
|
2010-09-01 19:39:53 +00:00
|
|
|
*
|
|
|
|
* Determine the list of windows that should be displayed for Alt-TAB
|
|
|
|
* functionality. The windows are returned in most recently used order.
|
2012-12-03 16:59:11 +00:00
|
|
|
* If @workspace is not %NULL, the list only conains windows that are on
|
|
|
|
* @workspace or have the demands-attention hint set; otherwise it contains
|
|
|
|
* all windows on @screen.
|
2010-09-01 19:39:53 +00:00
|
|
|
*
|
|
|
|
* Returns: (transfer container) (element-type Meta.Window): List of windows
|
|
|
|
*/
|
2003-03-15 02:16:21 +00:00
|
|
|
GList*
|
2002-03-12 04:34:17 +00:00
|
|
|
meta_display_get_tab_list (MetaDisplay *display,
|
2002-04-05 15:52:49 +00:00
|
|
|
MetaTabList type,
|
2002-03-12 04:34:17 +00:00
|
|
|
MetaScreen *screen,
|
|
|
|
MetaWorkspace *workspace)
|
|
|
|
{
|
2012-12-03 23:05:22 +00:00
|
|
|
GList *tab_list = NULL;
|
2012-12-03 16:59:11 +00:00
|
|
|
GList *global_mru_list = NULL;
|
|
|
|
GList *mru_list, *tmp;
|
2012-12-03 23:05:22 +00:00
|
|
|
GSList *windows = meta_display_list_windows (display, META_LIST_DEFAULT);
|
|
|
|
GSList *w;
|
2002-03-12 04:34:17 +00:00
|
|
|
|
2012-12-03 16:59:11 +00:00
|
|
|
if (workspace == NULL)
|
|
|
|
{
|
|
|
|
/* Yay for mixing GList and GSList in the API */
|
|
|
|
for (w = windows; w; w = w->next)
|
|
|
|
global_mru_list = g_list_prepend (global_mru_list, w->data);
|
|
|
|
global_mru_list = g_list_sort (global_mru_list, mru_cmp);
|
|
|
|
}
|
|
|
|
|
|
|
|
mru_list = workspace ? workspace->mru_list : global_mru_list;
|
2002-04-05 15:52:49 +00:00
|
|
|
|
2013-02-17 20:27:21 +00:00
|
|
|
/* Windows sellout mode - MRU order.
|
2002-10-24 05:15:28 +00:00
|
|
|
*/
|
2012-12-03 16:59:11 +00:00
|
|
|
for (tmp = mru_list; tmp; tmp = tmp->next)
|
2012-12-03 23:05:22 +00:00
|
|
|
{
|
|
|
|
MetaWindow *window = tmp->data;
|
2002-10-24 05:15:28 +00:00
|
|
|
|
2013-02-17 20:27:21 +00:00
|
|
|
if (window->screen == screen &&
|
2012-12-03 23:05:22 +00:00
|
|
|
IN_TAB_CHAIN (window, type))
|
|
|
|
tab_list = g_list_prepend (tab_list, window);
|
|
|
|
}
|
2008-02-02 04:05:16 +00:00
|
|
|
|
2012-12-03 23:05:22 +00:00
|
|
|
tab_list = g_list_reverse (tab_list);
|
2008-02-02 04:05:16 +00:00
|
|
|
|
2012-12-03 16:59:11 +00:00
|
|
|
/* If filtering by workspace, include windows from
|
|
|
|
* other workspaces that demand attention
|
|
|
|
*/
|
|
|
|
if (workspace)
|
|
|
|
for (w = windows; w; w = w->next)
|
|
|
|
{
|
|
|
|
MetaWindow *l_window = w->data;
|
2008-02-02 04:05:16 +00:00
|
|
|
|
2012-12-03 16:59:11 +00:00
|
|
|
if (l_window->wm_state_demands_attention &&
|
|
|
|
l_window->workspace != workspace &&
|
|
|
|
IN_TAB_CHAIN (l_window, type))
|
2012-12-03 23:05:22 +00:00
|
|
|
tab_list = g_list_prepend (tab_list, l_window);
|
2012-12-03 16:59:11 +00:00
|
|
|
}
|
2012-03-23 08:45:50 +00:00
|
|
|
|
2012-12-03 16:59:11 +00:00
|
|
|
g_list_free (global_mru_list);
|
2012-12-03 23:05:22 +00:00
|
|
|
g_slist_free (windows);
|
2002-10-24 05:15:28 +00:00
|
|
|
|
2002-03-12 04:34:17 +00:00
|
|
|
return tab_list;
|
|
|
|
}
|
|
|
|
|
2010-09-01 19:39:53 +00:00
|
|
|
/**
|
|
|
|
* meta_display_get_tab_next:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
* @type: type of tab list
|
|
|
|
* @screen: a #MetaScreen
|
|
|
|
* @workspace: origin workspace
|
|
|
|
* @window: (allow-none): starting window
|
|
|
|
* @backward: If %TRUE, look for the previous window.
|
|
|
|
*
|
|
|
|
* Determine the next window that should be displayed for Alt-TAB
|
|
|
|
* functionality.
|
|
|
|
*
|
|
|
|
* Returns: (transfer none): Next window
|
|
|
|
*
|
|
|
|
*/
|
2002-03-12 04:34:17 +00:00
|
|
|
MetaWindow*
|
|
|
|
meta_display_get_tab_next (MetaDisplay *display,
|
2002-04-05 15:52:49 +00:00
|
|
|
MetaTabList type,
|
2003-03-15 02:16:21 +00:00
|
|
|
MetaScreen *screen,
|
2002-03-12 04:34:17 +00:00
|
|
|
MetaWorkspace *workspace,
|
|
|
|
MetaWindow *window,
|
|
|
|
gboolean backward)
|
|
|
|
{
|
2004-10-25 16:17:19 +00:00
|
|
|
gboolean skip;
|
2003-03-15 02:16:21 +00:00
|
|
|
GList *tab_list;
|
2006-01-20 22:03:56 +00:00
|
|
|
MetaWindow *ret;
|
2003-03-15 02:16:21 +00:00
|
|
|
tab_list = meta_display_get_tab_list(display,
|
|
|
|
type,
|
|
|
|
screen,
|
|
|
|
workspace);
|
|
|
|
|
|
|
|
if (tab_list == NULL)
|
2002-03-12 04:34:17 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (window != NULL)
|
|
|
|
{
|
|
|
|
g_assert (window->display == display);
|
|
|
|
|
|
|
|
if (backward)
|
2006-01-20 22:03:56 +00:00
|
|
|
ret = find_tab_backward (display, type, screen, workspace,
|
2003-03-15 02:16:21 +00:00
|
|
|
g_list_find (tab_list,
|
2004-10-25 16:17:19 +00:00
|
|
|
window),
|
|
|
|
TRUE);
|
2006-01-20 22:03:56 +00:00
|
|
|
else
|
|
|
|
ret = find_tab_forward (display, type, screen, workspace,
|
|
|
|
g_list_find (tab_list,
|
|
|
|
window),
|
|
|
|
TRUE);
|
2002-03-12 04:34:17 +00:00
|
|
|
}
|
|
|
|
else
|
2006-01-20 22:03:56 +00:00
|
|
|
{
|
|
|
|
skip = display->focus_window != NULL &&
|
2009-02-07 23:05:42 +00:00
|
|
|
tab_list->data == display->focus_window;
|
2006-01-20 22:03:56 +00:00
|
|
|
if (backward)
|
|
|
|
ret = find_tab_backward (display, type, screen, workspace,
|
|
|
|
tab_list, skip);
|
|
|
|
else
|
|
|
|
ret = find_tab_forward (display, type, screen, workspace,
|
|
|
|
tab_list, skip);
|
|
|
|
}
|
2003-03-15 02:16:21 +00:00
|
|
|
|
|
|
|
g_list_free (tab_list);
|
2006-01-20 22:03:56 +00:00
|
|
|
return ret;
|
2002-03-12 04:34:17 +00:00
|
|
|
}
|
2002-03-17 17:22:23 +00:00
|
|
|
|
2010-09-01 19:39:53 +00:00
|
|
|
/**
|
|
|
|
* meta_display_get_tab_current:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
* @type: type of tab list
|
|
|
|
* @screen: a #MetaScreen
|
|
|
|
* @workspace: origin workspace
|
|
|
|
*
|
|
|
|
* Determine the active window that should be displayed for Alt-TAB.
|
|
|
|
*
|
|
|
|
* Returns: (transfer none): Current window
|
|
|
|
*
|
|
|
|
*/
|
2002-09-04 04:15:46 +00:00
|
|
|
MetaWindow*
|
|
|
|
meta_display_get_tab_current (MetaDisplay *display,
|
|
|
|
MetaTabList type,
|
|
|
|
MetaScreen *screen,
|
|
|
|
MetaWorkspace *workspace)
|
|
|
|
{
|
|
|
|
MetaWindow *window;
|
|
|
|
|
|
|
|
window = display->focus_window;
|
|
|
|
|
|
|
|
if (window != NULL &&
|
|
|
|
window->screen == screen &&
|
|
|
|
IN_TAB_CHAIN (window, type) &&
|
|
|
|
(workspace == NULL ||
|
2004-12-23 00:20:33 +00:00
|
|
|
meta_window_located_on_workspace (window, workspace)))
|
2002-09-04 04:15:46 +00:00
|
|
|
return window;
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2002-03-17 17:22:23 +00:00
|
|
|
int
|
|
|
|
meta_resize_gravity_from_grab_op (MetaGrabOp op)
|
|
|
|
{
|
|
|
|
int gravity;
|
|
|
|
|
|
|
|
gravity = -1;
|
|
|
|
switch (op)
|
|
|
|
{
|
|
|
|
case META_GRAB_OP_RESIZING_SE:
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_SE:
|
|
|
|
gravity = NorthWestGravity;
|
|
|
|
break;
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_S:
|
|
|
|
case META_GRAB_OP_RESIZING_S:
|
|
|
|
gravity = NorthGravity;
|
|
|
|
break;
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_SW:
|
|
|
|
case META_GRAB_OP_RESIZING_SW:
|
|
|
|
gravity = NorthEastGravity;
|
|
|
|
break;
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_N:
|
|
|
|
case META_GRAB_OP_RESIZING_N:
|
|
|
|
gravity = SouthGravity;
|
|
|
|
break;
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_NE:
|
|
|
|
case META_GRAB_OP_RESIZING_NE:
|
|
|
|
gravity = SouthWestGravity;
|
|
|
|
break;
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_NW:
|
|
|
|
case META_GRAB_OP_RESIZING_NW:
|
|
|
|
gravity = SouthEastGravity;
|
|
|
|
break;
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_E:
|
|
|
|
case META_GRAB_OP_RESIZING_E:
|
|
|
|
gravity = WestGravity;
|
|
|
|
break;
|
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_W:
|
|
|
|
case META_GRAB_OP_RESIZING_W:
|
|
|
|
gravity = EastGravity;
|
|
|
|
break;
|
2002-06-19 04:12:49 +00:00
|
|
|
case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN:
|
|
|
|
gravity = CenterGravity;
|
|
|
|
break;
|
2002-03-17 17:22:23 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return gravity;
|
|
|
|
}
|
2002-05-24 02:23:46 +00:00
|
|
|
|
2002-06-08 23:55:27 +00:00
|
|
|
static MetaScreen*
|
|
|
|
find_screen_for_selection (MetaDisplay *display,
|
|
|
|
Window owner,
|
|
|
|
Atom selection)
|
|
|
|
{
|
|
|
|
GSList *tmp;
|
|
|
|
|
|
|
|
tmp = display->screens;
|
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaScreen *screen = tmp->data;
|
|
|
|
|
|
|
|
if (screen->wm_sn_selection_window == owner &&
|
|
|
|
screen->wm_sn_atom == selection)
|
|
|
|
return screen;
|
|
|
|
|
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2002-07-10 14:41:19 +00:00
|
|
|
/* from fvwm2, Copyright Matthias Clasen, Dominik Vogt */
|
2002-06-08 23:55:27 +00:00
|
|
|
static gboolean
|
|
|
|
convert_property (MetaDisplay *display,
|
|
|
|
MetaScreen *screen,
|
|
|
|
Window w,
|
|
|
|
Atom target,
|
|
|
|
Atom property)
|
|
|
|
{
|
|
|
|
#define N_TARGETS 4
|
|
|
|
Atom conversion_targets[N_TARGETS];
|
|
|
|
long icccm_version[] = { 2, 0 };
|
|
|
|
|
2008-05-02 18:49:01 +00:00
|
|
|
conversion_targets[0] = display->atom_TARGETS;
|
|
|
|
conversion_targets[1] = display->atom_MULTIPLE;
|
|
|
|
conversion_targets[2] = display->atom_TIMESTAMP;
|
|
|
|
conversion_targets[3] = display->atom_VERSION;
|
2002-06-08 23:55:27 +00:00
|
|
|
|
2002-10-21 21:44:35 +00:00
|
|
|
meta_error_trap_push_with_return (display);
|
2008-05-02 18:49:01 +00:00
|
|
|
if (target == display->atom_TARGETS)
|
2002-06-08 23:55:27 +00:00
|
|
|
XChangeProperty (display->xdisplay, w, property,
|
|
|
|
XA_ATOM, 32, PropModeReplace,
|
|
|
|
(unsigned char *)conversion_targets, N_TARGETS);
|
2008-05-02 18:49:01 +00:00
|
|
|
else if (target == display->atom_TIMESTAMP)
|
2002-06-08 23:55:27 +00:00
|
|
|
XChangeProperty (display->xdisplay, w, property,
|
|
|
|
XA_INTEGER, 32, PropModeReplace,
|
|
|
|
(unsigned char *)&screen->wm_sn_timestamp, 1);
|
2008-05-02 18:49:01 +00:00
|
|
|
else if (target == display->atom_VERSION)
|
2002-06-08 23:55:27 +00:00
|
|
|
XChangeProperty (display->xdisplay, w, property,
|
|
|
|
XA_INTEGER, 32, PropModeReplace,
|
|
|
|
(unsigned char *)icccm_version, 2);
|
|
|
|
else
|
|
|
|
{
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop_with_return (display);
|
2002-06-08 23:55:27 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2010-10-25 18:44:30 +00:00
|
|
|
if (meta_error_trap_pop_with_return (display) != Success)
|
2002-06-08 23:55:27 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* Be sure the PropertyNotify has arrived so we
|
|
|
|
* can send SelectionNotify
|
|
|
|
*/
|
2002-10-21 21:44:35 +00:00
|
|
|
/* FIXME the error trap pop synced anyway, right? */
|
2008-01-28 14:52:34 +00:00
|
|
|
meta_topic (META_DEBUG_SYNC, "Syncing on %s\n", G_STRFUNC);
|
2002-06-08 23:55:27 +00:00
|
|
|
XSync (display->xdisplay, False);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2002-07-10 14:41:19 +00:00
|
|
|
/* from fvwm2, Copyright Matthias Clasen, Dominik Vogt */
|
2002-06-08 23:55:27 +00:00
|
|
|
static void
|
|
|
|
process_selection_request (MetaDisplay *display,
|
|
|
|
XEvent *event)
|
|
|
|
{
|
|
|
|
XSelectionEvent reply;
|
|
|
|
MetaScreen *screen;
|
|
|
|
|
|
|
|
screen = find_screen_for_selection (display,
|
|
|
|
event->xselectionrequest.owner,
|
|
|
|
event->xselectionrequest.selection);
|
|
|
|
|
|
|
|
if (screen == NULL)
|
|
|
|
{
|
|
|
|
char *str;
|
|
|
|
|
|
|
|
meta_error_trap_push (display);
|
|
|
|
str = XGetAtomName (display->xdisplay,
|
|
|
|
event->xselectionrequest.selection);
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop (display);
|
2002-06-08 23:55:27 +00:00
|
|
|
|
|
|
|
meta_verbose ("Selection request with selection %s window 0x%lx not a WM_Sn selection we recognize\n",
|
|
|
|
str ? str : "(bad atom)", event->xselectionrequest.owner);
|
|
|
|
|
|
|
|
meta_XFree (str);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
reply.type = SelectionNotify;
|
|
|
|
reply.display = display->xdisplay;
|
|
|
|
reply.requestor = event->xselectionrequest.requestor;
|
|
|
|
reply.selection = event->xselectionrequest.selection;
|
|
|
|
reply.target = event->xselectionrequest.target;
|
|
|
|
reply.property = None;
|
|
|
|
reply.time = event->xselectionrequest.time;
|
|
|
|
|
2008-05-02 18:49:01 +00:00
|
|
|
if (event->xselectionrequest.target == display->atom_MULTIPLE)
|
2002-06-08 23:55:27 +00:00
|
|
|
{
|
|
|
|
if (event->xselectionrequest.property != None)
|
|
|
|
{
|
|
|
|
Atom type, *adata;
|
|
|
|
int i, format;
|
|
|
|
unsigned long num, rest;
|
|
|
|
unsigned char *data;
|
|
|
|
|
2002-10-21 21:44:35 +00:00
|
|
|
meta_error_trap_push_with_return (display);
|
|
|
|
if (XGetWindowProperty (display->xdisplay,
|
|
|
|
event->xselectionrequest.requestor,
|
|
|
|
event->xselectionrequest.property, 0, 256, False,
|
2008-05-02 18:49:01 +00:00
|
|
|
display->atom_ATOM_PAIR,
|
2002-10-21 21:44:35 +00:00
|
|
|
&type, &format, &num, &rest, &data) != Success)
|
|
|
|
{
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop_with_return (display);
|
2002-10-21 21:44:35 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-10-25 18:44:30 +00:00
|
|
|
if (meta_error_trap_pop_with_return (display) == Success)
|
2002-06-08 23:55:27 +00:00
|
|
|
{
|
|
|
|
/* FIXME: to be 100% correct, should deal with rest > 0,
|
|
|
|
* but since we have 4 possible targets, we will hardly ever
|
|
|
|
* meet multiple requests with a length > 8
|
|
|
|
*/
|
|
|
|
adata = (Atom*)data;
|
|
|
|
i = 0;
|
|
|
|
while (i < (int) num)
|
|
|
|
{
|
|
|
|
if (!convert_property (display, screen,
|
|
|
|
event->xselectionrequest.requestor,
|
|
|
|
adata[i], adata[i+1]))
|
|
|
|
adata[i+1] = None;
|
|
|
|
i += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
meta_error_trap_push (display);
|
|
|
|
XChangeProperty (display->xdisplay,
|
|
|
|
event->xselectionrequest.requestor,
|
|
|
|
event->xselectionrequest.property,
|
2008-05-02 18:49:01 +00:00
|
|
|
display->atom_ATOM_PAIR,
|
2002-06-08 23:55:27 +00:00
|
|
|
32, PropModeReplace, data, num);
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop (display);
|
2002-06-08 23:55:27 +00:00
|
|
|
meta_XFree (data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (event->xselectionrequest.property == None)
|
|
|
|
event->xselectionrequest.property = event->xselectionrequest.target;
|
|
|
|
|
|
|
|
if (convert_property (display, screen,
|
|
|
|
event->xselectionrequest.requestor,
|
|
|
|
event->xselectionrequest.target,
|
|
|
|
event->xselectionrequest.property))
|
|
|
|
reply.property = event->xselectionrequest.property;
|
|
|
|
}
|
|
|
|
|
|
|
|
XSendEvent (display->xdisplay,
|
|
|
|
event->xselectionrequest.requestor,
|
|
|
|
False, 0L, (XEvent*)&reply);
|
|
|
|
|
|
|
|
meta_verbose ("Handled selection request\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
process_selection_clear (MetaDisplay *display,
|
|
|
|
XEvent *event)
|
|
|
|
{
|
|
|
|
/* We need to unmanage the screen on which we lost the selection */
|
|
|
|
MetaScreen *screen;
|
|
|
|
|
|
|
|
screen = find_screen_for_selection (display,
|
|
|
|
event->xselectionclear.window,
|
|
|
|
event->xselectionclear.selection);
|
|
|
|
|
|
|
|
|
|
|
|
if (screen != NULL)
|
|
|
|
{
|
|
|
|
meta_verbose ("Got selection clear for screen %d on display %s\n",
|
|
|
|
screen->number, display->name);
|
|
|
|
|
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 17:27:24 +00:00
|
|
|
meta_display_unmanage_screen (display,
|
|
|
|
screen,
|
|
|
|
event->xselectionclear.time);
|
2002-06-08 23:55:27 +00:00
|
|
|
|
|
|
|
/* display and screen may both be invalid memory... */
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
char *str;
|
|
|
|
|
|
|
|
meta_error_trap_push (display);
|
|
|
|
str = XGetAtomName (display->xdisplay,
|
|
|
|
event->xselectionclear.selection);
|
2010-10-25 18:44:30 +00:00
|
|
|
meta_error_trap_pop (display);
|
2002-06-08 23:55:27 +00:00
|
|
|
|
|
|
|
meta_verbose ("Selection clear with selection %s window 0x%lx not a WM_Sn selection we recognize\n",
|
|
|
|
str ? str : "(bad atom)", event->xselectionclear.window);
|
|
|
|
|
|
|
|
meta_XFree (str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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 17:27:24 +00:00
|
|
|
MetaScreen *screen,
|
|
|
|
guint32 timestamp)
|
2002-06-08 23:55:27 +00:00
|
|
|
{
|
|
|
|
meta_verbose ("Unmanaging screen %d on display %s\n",
|
|
|
|
screen->number, display->name);
|
|
|
|
|
|
|
|
g_return_if_fail (g_slist_find (display->screens, screen) != NULL);
|
|
|
|
|
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 17:27:24 +00:00
|
|
|
meta_screen_free (screen, timestamp);
|
2002-06-08 23:55:27 +00:00
|
|
|
display->screens = g_slist_remove (display->screens, screen);
|
|
|
|
|
|
|
|
if (display->screens == NULL)
|
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 17:27:24 +00:00
|
|
|
meta_display_close (display, timestamp);
|
2002-06-08 23:55:27 +00: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 17:27:24 +00:00
|
|
|
MetaScreen *screen,
|
|
|
|
guint32 timestamp)
|
2002-06-08 23:55:27 +00:00
|
|
|
{
|
|
|
|
GSList *tmp;
|
|
|
|
GSList *winlist;
|
|
|
|
|
2009-06-15 19:32:23 +00:00
|
|
|
winlist = meta_display_list_windows (display,
|
|
|
|
META_LIST_INCLUDE_OVERRIDE_REDIRECT);
|
2007-04-16 04:57:32 +00:00
|
|
|
winlist = g_slist_sort (winlist, meta_display_stack_cmp);
|
2012-01-19 19:06:57 +00:00
|
|
|
g_slist_foreach (winlist, (GFunc)g_object_ref, NULL);
|
2002-06-08 23:55:27 +00:00
|
|
|
|
|
|
|
/* Unmanage all windows */
|
|
|
|
tmp = winlist;
|
|
|
|
while (tmp != NULL)
|
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 17:27:24 +00:00
|
|
|
{
|
2012-01-19 19:06:57 +00:00
|
|
|
MetaWindow *window = tmp->data;
|
|
|
|
|
|
|
|
/* Check if already unmanaged for safety - in particular, catch
|
|
|
|
* the case where unmanaging a parent window can cause attached
|
|
|
|
* dialogs to be (temporarily) unmanaged.
|
|
|
|
*/
|
|
|
|
if (!window->unmanaging)
|
|
|
|
meta_window_unmanage (window, timestamp);
|
|
|
|
g_object_unref (window);
|
2002-06-08 23:55:27 +00:00
|
|
|
|
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
g_slist_free (winlist);
|
|
|
|
}
|
2002-10-07 23:14:40 +00:00
|
|
|
|
2007-04-16 04:57:32 +00:00
|
|
|
int
|
|
|
|
meta_display_stack_cmp (const void *a,
|
|
|
|
const void *b)
|
|
|
|
{
|
|
|
|
MetaWindow *aw = (void*) a;
|
|
|
|
MetaWindow *bw = (void*) b;
|
|
|
|
|
|
|
|
if (aw->screen == bw->screen)
|
|
|
|
return meta_stack_windows_cmp (aw->screen->stack, aw, bw);
|
|
|
|
/* Then assume screens are stacked by number */
|
|
|
|
else if (aw->screen->number < bw->screen->number)
|
|
|
|
return -1;
|
|
|
|
else if (aw->screen->number > bw->screen->number)
|
|
|
|
return 1;
|
|
|
|
else
|
|
|
|
return 0; /* not reached in theory, if windows on same display */
|
|
|
|
}
|
|
|
|
|
2010-04-24 21:18:01 +00:00
|
|
|
/**
|
|
|
|
* meta_display_sort_windows_by_stacking:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
* @windows: (element-type MetaWindow): Set of windows
|
|
|
|
*
|
|
|
|
* Sorts a set of windows according to their current stacking order. If windows
|
|
|
|
* from multiple screens are present in the set of input windows, then all the
|
|
|
|
* windows on screen 0 are sorted below all the windows on screen 1, and so forth.
|
|
|
|
* Since the stacking order of override-redirect windows isn't controlled by
|
|
|
|
* Metacity, if override-redirect windows are in the input, the result may not
|
|
|
|
* correspond to the actual stacking order in the X server.
|
|
|
|
*
|
|
|
|
* An example of using this would be to sort the list of transient dialogs for a
|
|
|
|
* window into their current stacking order.
|
|
|
|
*
|
2011-08-30 16:54:49 +00:00
|
|
|
* Returns: (transfer container) (element-type MetaWindow): Input windows sorted by stacking order, from lowest to highest
|
2010-04-24 21:18:01 +00:00
|
|
|
*/
|
|
|
|
GSList *
|
|
|
|
meta_display_sort_windows_by_stacking (MetaDisplay *display,
|
|
|
|
GSList *windows)
|
|
|
|
{
|
|
|
|
GSList *copy = g_slist_copy (windows);
|
|
|
|
|
|
|
|
copy = g_slist_sort (copy, meta_display_stack_cmp);
|
|
|
|
|
|
|
|
return copy;
|
|
|
|
}
|
|
|
|
|
2002-10-07 23:14:40 +00:00
|
|
|
void
|
|
|
|
meta_display_devirtualize_modifiers (MetaDisplay *display,
|
|
|
|
MetaVirtualModifier modifiers,
|
|
|
|
unsigned int *mask)
|
|
|
|
{
|
|
|
|
*mask = 0;
|
|
|
|
|
|
|
|
if (modifiers & META_VIRTUAL_SHIFT_MASK)
|
|
|
|
*mask |= ShiftMask;
|
|
|
|
if (modifiers & META_VIRTUAL_CONTROL_MASK)
|
|
|
|
*mask |= ControlMask;
|
|
|
|
if (modifiers & META_VIRTUAL_ALT_MASK)
|
|
|
|
*mask |= Mod1Mask;
|
|
|
|
if (modifiers & META_VIRTUAL_META_MASK)
|
|
|
|
*mask |= display->meta_mask;
|
|
|
|
if (modifiers & META_VIRTUAL_HYPER_MASK)
|
|
|
|
*mask |= display->hyper_mask;
|
|
|
|
if (modifiers & META_VIRTUAL_SUPER_MASK)
|
|
|
|
*mask |= display->super_mask;
|
|
|
|
if (modifiers & META_VIRTUAL_MOD2_MASK)
|
|
|
|
*mask |= Mod2Mask;
|
|
|
|
if (modifiers & META_VIRTUAL_MOD3_MASK)
|
|
|
|
*mask |= Mod3Mask;
|
|
|
|
if (modifiers & META_VIRTUAL_MOD4_MASK)
|
|
|
|
*mask |= Mod4Mask;
|
|
|
|
if (modifiers & META_VIRTUAL_MOD5_MASK)
|
|
|
|
*mask |= Mod5Mask;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
update_window_grab_modifiers (MetaDisplay *display)
|
|
|
|
|
|
|
|
{
|
|
|
|
MetaVirtualModifier virtual_mods;
|
|
|
|
unsigned int mods;
|
|
|
|
|
|
|
|
virtual_mods = meta_prefs_get_mouse_button_mods ();
|
|
|
|
meta_display_devirtualize_modifiers (display, virtual_mods,
|
|
|
|
&mods);
|
|
|
|
|
|
|
|
display->window_grab_modifiers = mods;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
prefs_changed_callback (MetaPreference pref,
|
|
|
|
void *data)
|
|
|
|
{
|
2006-02-16 20:26:05 +00:00
|
|
|
MetaDisplay *display = data;
|
|
|
|
|
2003-10-13 20:15:40 +00:00
|
|
|
/* It may not be obvious why we regrab on focus mode
|
|
|
|
* change; it's because we handle focus clicks a
|
|
|
|
* bit differently for the different focus modes.
|
|
|
|
*/
|
|
|
|
if (pref == META_PREF_MOUSE_BUTTON_MODS ||
|
|
|
|
pref == META_PREF_FOCUS_MODE)
|
2002-10-07 23:14:40 +00:00
|
|
|
{
|
|
|
|
MetaDisplay *display = data;
|
|
|
|
GSList *windows;
|
|
|
|
GSList *tmp;
|
2003-10-13 20:15:40 +00:00
|
|
|
|
2009-06-15 19:32:23 +00:00
|
|
|
windows = meta_display_list_windows (display, META_LIST_DEFAULT);
|
2002-10-07 23:14:40 +00:00
|
|
|
|
|
|
|
/* Ungrab all */
|
|
|
|
tmp = windows;
|
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaWindow *w = tmp->data;
|
|
|
|
meta_display_ungrab_window_buttons (display, w->xwindow);
|
2003-10-13 20:15:40 +00:00
|
|
|
meta_display_ungrab_focus_window_button (display, w);
|
2002-10-07 23:14:40 +00:00
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
2003-10-13 20:15:40 +00:00
|
|
|
|
2002-10-07 23:14:40 +00:00
|
|
|
/* change our modifier */
|
2003-10-13 20:15:40 +00:00
|
|
|
if (pref == META_PREF_MOUSE_BUTTON_MODS)
|
|
|
|
update_window_grab_modifiers (display);
|
2002-10-07 23:14:40 +00:00
|
|
|
|
|
|
|
/* Grab all */
|
|
|
|
tmp = windows;
|
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaWindow *w = tmp->data;
|
2008-10-06 01:34:17 +00:00
|
|
|
if (w->type != META_WINDOW_DOCK)
|
|
|
|
{
|
|
|
|
meta_display_grab_focus_window_button (display, w);
|
|
|
|
meta_display_grab_window_buttons (display, w->xwindow);
|
|
|
|
}
|
2002-10-07 23:14:40 +00:00
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_slist_free (windows);
|
|
|
|
}
|
2003-01-28 15:07:43 +00:00
|
|
|
else if (pref == META_PREF_AUDIBLE_BELL)
|
|
|
|
{
|
|
|
|
meta_bell_set_audible (display, meta_prefs_bell_is_audible ());
|
|
|
|
}
|
2002-10-07 23:14:40 +00:00
|
|
|
}
|
2003-05-30 20:24:00 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
meta_display_increment_focus_sentinel (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
unsigned long data[1];
|
|
|
|
|
|
|
|
data[0] = meta_display_get_current_time (display);
|
|
|
|
|
|
|
|
XChangeProperty (display->xdisplay,
|
|
|
|
((MetaScreen*) display->screens->data)->xroot,
|
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 10:29:20 +00:00
|
|
|
display->atom__MUTTER_SENTINEL,
|
2003-05-30 20:24:00 +00:00
|
|
|
XA_CARDINAL,
|
|
|
|
32, PropModeReplace, (guchar*) data, 1);
|
|
|
|
|
|
|
|
display->sentinel_counter += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_display_decrement_focus_sentinel (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
display->sentinel_counter -= 1;
|
|
|
|
|
|
|
|
if (display->sentinel_counter < 0)
|
|
|
|
display->sentinel_counter = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
meta_display_focus_sentinel_clear (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return (display->sentinel_counter == 0);
|
|
|
|
}
|
2004-10-04 21:09:08 +00: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 17:14:16 +00:00
|
|
|
static void
|
|
|
|
sanity_check_timestamps (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 16:32:33 +00:00
|
|
|
guint32 timestamp)
|
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 17:14:16 +00:00
|
|
|
{
|
|
|
|
if (XSERVER_TIME_IS_BEFORE (timestamp, display->last_focus_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 16:32:33 +00:00
|
|
|
meta_warning ("last_focus_time (%u) is greater than comparison "
|
|
|
|
"timestamp (%u). This most likely represents a buggy "
|
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 17:14:16 +00:00
|
|
|
"client sending inaccurate timestamps in messages such as "
|
|
|
|
"_NET_ACTIVE_WINDOW. Trying to work around...\n",
|
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 16:32:33 +00:00
|
|
|
display->last_focus_time, timestamp);
|
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 17:14:16 +00:00
|
|
|
display->last_focus_time = timestamp;
|
|
|
|
}
|
|
|
|
if (XSERVER_TIME_IS_BEFORE (timestamp, display->last_user_time))
|
|
|
|
{
|
|
|
|
GSList *windows;
|
|
|
|
GSList *tmp;
|
|
|
|
|
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 16:32:33 +00:00
|
|
|
meta_warning ("last_user_time (%u) is greater than comparison "
|
|
|
|
"timestamp (%u). This most likely represents a buggy "
|
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 17:14:16 +00:00
|
|
|
"client sending inaccurate timestamps in messages such as "
|
|
|
|
"_NET_ACTIVE_WINDOW. Trying to work around...\n",
|
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 16:32:33 +00:00
|
|
|
display->last_user_time, timestamp);
|
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 17:14:16 +00:00
|
|
|
display->last_user_time = timestamp;
|
|
|
|
|
2009-06-15 19:32:23 +00:00
|
|
|
windows = meta_display_list_windows (display, META_LIST_DEFAULT);
|
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 17:14:16 +00:00
|
|
|
tmp = windows;
|
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaWindow *window = tmp->data;
|
|
|
|
|
|
|
|
if (XSERVER_TIME_IS_BEFORE (timestamp, window->net_wm_user_time))
|
|
|
|
{
|
|
|
|
meta_warning ("%s appears to be one of the offending windows "
|
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 16:32:33 +00:00
|
|
|
"with a timestamp of %u. Working around...\n",
|
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 17:14:16 +00:00
|
|
|
window->desc, window->net_wm_user_time);
|
2009-09-04 00:58:19 +00:00
|
|
|
meta_window_set_user_time (window, timestamp);
|
Big patch to cover about 6 different issues in order to correct rare
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-20 17:14:16 +00:00
|
|
|
}
|
2009-09-04 00:58:19 +00: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 17:14:16 +00:00
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_slist_free (windows);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-12-23 06:44:56 +00: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 16:32:33 +00:00
|
|
|
guint32 timestamp)
|
2004-12-23 06:44:56 +00:00
|
|
|
{
|
2013-05-23 19:54:39 +00:00
|
|
|
request_xserver_input_focus_change (display,
|
|
|
|
window->screen,
|
2013-08-12 16:04:34 +00:00
|
|
|
window,
|
2013-05-23 19:54:39 +00:00
|
|
|
focus_frame ? window->frame->xwindow : window->xwindow,
|
|
|
|
timestamp);
|
2011-04-26 12:12:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_display_request_take_focus (MetaDisplay *display,
|
|
|
|
MetaWindow *window,
|
|
|
|
guint32 timestamp)
|
|
|
|
{
|
2013-05-23 19:54:39 +00:00
|
|
|
if (timestamp_too_old (display, ×tamp))
|
2011-04-26 12:12:04 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_FOCUS, "WM_TAKE_FOCUS(%s, %u)\n",
|
|
|
|
window->desc, timestamp);
|
|
|
|
|
|
|
|
meta_window_send_icccm_message (window,
|
|
|
|
display->atom_WM_TAKE_FOCUS,
|
|
|
|
timestamp);
|
2004-12-23 06:44:56 +00:00
|
|
|
}
|
|
|
|
|
2013-05-23 20:21:24 +00:00
|
|
|
void
|
2014-02-23 17:28:51 +00:00
|
|
|
meta_display_set_input_focus_xwindow (MetaDisplay *display,
|
|
|
|
MetaScreen *screen,
|
|
|
|
Window window,
|
|
|
|
guint32 timestamp)
|
2013-05-23 20:21:24 +00:00
|
|
|
{
|
|
|
|
request_xserver_input_focus_change (display,
|
|
|
|
screen,
|
2013-08-12 16:04:34 +00:00
|
|
|
NULL,
|
2013-05-23 20:21:24 +00:00
|
|
|
window,
|
|
|
|
timestamp);
|
|
|
|
}
|
|
|
|
|
2004-10-04 21:09:08 +00:00
|
|
|
void
|
2013-05-23 19:54:39 +00:00
|
|
|
meta_display_focus_the_no_focus_window (MetaDisplay *display,
|
2005-12-28 06:24:30 +00: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 16:32:33 +00:00
|
|
|
guint32 timestamp)
|
2004-10-04 21:09:08 +00:00
|
|
|
{
|
2013-05-23 19:54:39 +00:00
|
|
|
request_xserver_input_focus_change (display,
|
|
|
|
screen,
|
2013-08-12 16:04:34 +00:00
|
|
|
NULL,
|
2013-05-23 19:54:39 +00:00
|
|
|
screen->no_focus_window,
|
|
|
|
timestamp);
|
2004-10-04 21:09:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_display_remove_autoraise_callback (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
if (display->autoraise_timeout_id != 0)
|
|
|
|
{
|
|
|
|
g_source_remove (display->autoraise_timeout_id);
|
|
|
|
display->autoraise_timeout_id = 0;
|
|
|
|
display->autoraise_window = NULL;
|
|
|
|
}
|
|
|
|
}
|
2008-05-19 00:00:09 +00:00
|
|
|
|
2008-12-02 23:13:11 +00:00
|
|
|
void
|
|
|
|
meta_display_overlay_key_activate (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
g_signal_emit (display, display_signals[OVERLAY_KEY], 0);
|
|
|
|
}
|
|
|
|
|
2012-08-28 13:28:11 +00:00
|
|
|
void
|
2013-10-03 22:03:53 +00:00
|
|
|
meta_display_accelerator_activate (MetaDisplay *display,
|
|
|
|
guint action,
|
|
|
|
ClutterKeyEvent *event)
|
2012-08-28 13:28:11 +00:00
|
|
|
{
|
|
|
|
g_signal_emit (display, display_signals[ACCELERATOR_ACTIVATED],
|
2013-10-03 22:03:53 +00:00
|
|
|
0, action,
|
|
|
|
clutter_input_device_get_device_id (event->device),
|
|
|
|
event->time);
|
2012-08-28 13:28:11 +00:00
|
|
|
}
|
|
|
|
|
2013-04-10 11:34:26 +00:00
|
|
|
gboolean
|
|
|
|
meta_display_modifiers_accelerator_activate (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
gboolean freeze;
|
|
|
|
|
|
|
|
g_signal_emit (display, display_signals[MODIFIERS_ACCELERATOR_ACTIVATED], 0, &freeze);
|
|
|
|
|
|
|
|
return freeze;
|
|
|
|
}
|
|
|
|
|
2008-05-19 00:00:09 +00:00
|
|
|
void
|
|
|
|
meta_display_get_compositor_version (MetaDisplay *display,
|
|
|
|
int *major,
|
|
|
|
int *minor)
|
|
|
|
{
|
|
|
|
*major = display->composite_major_version;
|
|
|
|
*minor = display->composite_minor_version;
|
|
|
|
}
|
|
|
|
|
2012-12-21 02:30:49 +00:00
|
|
|
/**
|
|
|
|
* meta_display_get_xinput_opcode: (skip)
|
2013-02-15 18:42:08 +00:00
|
|
|
* @display: a #MetaDisplay
|
2012-12-21 02:30:49 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
meta_display_get_xinput_opcode (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return display->xinput_opcode;
|
|
|
|
}
|
|
|
|
|
2012-07-30 18:57:53 +00:00
|
|
|
/**
|
|
|
|
* meta_display_supports_extended_barriers:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
*
|
2013-02-15 18:42:08 +00:00
|
|
|
* Returns: whether the X server supports extended barrier
|
2012-07-30 18:57:53 +00:00
|
|
|
* features as defined in version 2.3 of the XInput 2
|
|
|
|
* specification.
|
|
|
|
*
|
|
|
|
* Clients should use this method to determine whether their
|
|
|
|
* interfaces should depend on new barrier features.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
meta_display_supports_extended_barriers (MetaDisplay *display)
|
|
|
|
{
|
2013-09-16 07:34:27 +00:00
|
|
|
return META_DISPLAY_HAS_XINPUT_23 (display) && !meta_is_wayland_compositor ();
|
2012-07-30 18:57:53 +00:00
|
|
|
}
|
|
|
|
|
2010-09-01 19:39:53 +00:00
|
|
|
/**
|
|
|
|
* meta_display_get_xdisplay: (skip)
|
2013-02-15 18:42:08 +00:00
|
|
|
* @display: a #MetaDisplay
|
2010-09-01 19:39:53 +00:00
|
|
|
*
|
|
|
|
*/
|
2008-05-19 00:00:09 +00:00
|
|
|
Display *
|
|
|
|
meta_display_get_xdisplay (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return display->xdisplay;
|
|
|
|
}
|
|
|
|
|
2010-09-01 19:39:53 +00:00
|
|
|
/**
|
|
|
|
* meta_display_get_compositor: (skip)
|
2013-02-15 18:42:08 +00:00
|
|
|
* @display: a #MetaDisplay
|
2010-09-01 19:39:53 +00:00
|
|
|
*
|
|
|
|
*/
|
2008-05-19 00:00:09 +00:00
|
|
|
MetaCompositor *
|
|
|
|
meta_display_get_compositor (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return display->compositor;
|
|
|
|
}
|
|
|
|
|
2010-09-01 19:39:53 +00:00
|
|
|
/**
|
|
|
|
* meta_display_get_screens:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
*
|
|
|
|
* Returns: (transfer none) (element-type Meta.Screen): Screens for this display
|
|
|
|
*/
|
2008-05-19 00:00:09 +00:00
|
|
|
GSList *
|
|
|
|
meta_display_get_screens (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return display->screens;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
meta_display_has_shape (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return META_DISPLAY_HAS_SHAPE (display);
|
|
|
|
}
|
|
|
|
|
2008-11-17 21:34:28 +00:00
|
|
|
/**
|
|
|
|
* meta_display_get_focus_window:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
*
|
2011-04-26 12:12:04 +00:00
|
|
|
* Get our best guess as to the "currently" focused window (that is,
|
|
|
|
* the window that we expect will be focused at the point when the X
|
|
|
|
* server processes our next request).
|
2008-11-17 21:34:28 +00:00
|
|
|
*
|
|
|
|
* Return Value: (transfer none): The current focus window
|
|
|
|
*/
|
2008-05-19 00:00:09 +00:00
|
|
|
MetaWindow *
|
|
|
|
meta_display_get_focus_window (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return display->focus_window;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
meta_display_get_damage_event_base (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return display->damage_event_base;
|
|
|
|
}
|
|
|
|
|
2008-06-29 03:23:08 +00:00
|
|
|
#ifdef HAVE_SHAPE
|
2008-05-19 00:00:09 +00:00
|
|
|
int
|
|
|
|
meta_display_get_shape_event_base (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return display->shape_event_base;
|
|
|
|
}
|
2008-06-02 22:27:54 +00:00
|
|
|
#endif
|
2008-08-18 14:10:13 +00:00
|
|
|
|
2010-03-17 09:15:55 +00:00
|
|
|
/**
|
|
|
|
* meta_display_get_leader_window:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
*
|
|
|
|
* Returns the window manager's leader window (as defined by the
|
|
|
|
* _NET_SUPPORTING_WM_CHECK mechanism of EWMH). For use by plugins that wish
|
|
|
|
* to attach additional custom properties to this window.
|
|
|
|
*
|
|
|
|
* Return value: (transfer none): xid of the leader window.
|
|
|
|
**/
|
|
|
|
Window
|
|
|
|
meta_display_get_leader_window (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
return display->leader_window;
|
|
|
|
}
|
2012-04-14 13:12:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* meta_display_clear_mouse_mode:
|
|
|
|
* @display: a #MetaDisplay
|
|
|
|
*
|
|
|
|
* Sets the mouse-mode flag to %FALSE, which means that motion events are
|
|
|
|
* no longer ignored in mouse or sloppy focus.
|
|
|
|
* This is an internal function. It should be used only for reimplementing
|
|
|
|
* keybindings, and only in a manner compatible with core code.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
meta_display_clear_mouse_mode (MetaDisplay *display)
|
|
|
|
{
|
|
|
|
display->mouse_mode = FALSE;
|
|
|
|
}
|