2006-10-01 22:30:10 +00:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
2008-08-18 10:25:17 +00:00
|
|
|
/**
|
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 10:29:20 +00:00
|
|
|
* \file window-private.h Windows which Mutter manages
|
2008-08-18 10:25:17 +00:00
|
|
|
*
|
|
|
|
* Managing X windows.
|
|
|
|
* This file contains methods on this class which are available to
|
|
|
|
* routines in core but not outside it. (See window.h for the routines
|
|
|
|
* which the rest of the world is allowed to use.)
|
|
|
|
*/
|
2001-05-30 15:36:31 +00:00
|
|
|
|
2014-05-02 13:34:02 +00:00
|
|
|
/*
|
2001-05-30 15:36:31 +00:00
|
|
|
* Copyright (C) 2001 Havoc Pennington
|
2002-12-10 03:23:04 +00:00
|
|
|
* Copyright (C) 2002 Red Hat, Inc.
|
2004-02-28 01:49:17 +00:00
|
|
|
* Copyright (C) 2003, 2004 Rob Adams
|
2006-01-10 19:43:21 +00:00
|
|
|
* Copyright (C) 2004-2006 Elijah Newren
|
2014-05-02 13:34:02 +00:00
|
|
|
*
|
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.
|
2014-05-02 13:34:02 +00:00
|
|
|
*
|
2001-05-30 15:36:31 +00:00
|
|
|
* 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
|
|
|
*/
|
|
|
|
|
2023-07-21 13:37:20 +00:00
|
|
|
#pragma once
|
2001-05-30 15:36:31 +00:00
|
|
|
|
2001-06-02 04:14:18 +00:00
|
|
|
#include <X11/Xutil.h>
|
2011-03-22 19:36:12 +00:00
|
|
|
#include <cairo.h>
|
2001-06-24 03:18:10 +00:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
2014-03-19 01:22:58 +00:00
|
|
|
|
2018-07-10 08:36:24 +00:00
|
|
|
#include "backends/meta-logical-monitor.h"
|
|
|
|
#include "clutter/clutter.h"
|
|
|
|
#include "core/stack.h"
|
|
|
|
#include "meta/compositor.h"
|
|
|
|
#include "meta/meta-close-dialog.h"
|
|
|
|
#include "meta/util.h"
|
|
|
|
#include "meta/window.h"
|
2014-03-19 02:01:31 +00:00
|
|
|
#include "wayland/meta-wayland-types.h"
|
2018-07-10 08:36:24 +00:00
|
|
|
#include "x11/group-private.h"
|
2014-03-19 02:01:31 +00:00
|
|
|
|
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-11 01:15:33 +00:00
|
|
|
typedef struct _MetaWindowQueue MetaWindowQueue;
|
2002-08-12 21:32:13 +00:00
|
|
|
|
2018-12-19 08:04:25 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2006-01-10 05:44:40 +00:00
|
|
|
META_CLIENT_TYPE_UNKNOWN = 0,
|
|
|
|
META_CLIENT_TYPE_APPLICATION = 1,
|
|
|
|
META_CLIENT_TYPE_PAGER = 2,
|
|
|
|
META_CLIENT_TYPE_MAX_RECOGNIZED = 2
|
|
|
|
} MetaClientType;
|
|
|
|
|
2022-01-28 23:49:50 +00:00
|
|
|
#define META_N_QUEUE_TYPES 2
|
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
|
|
|
|
2014-03-19 14:30:12 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2014-12-15 21:28:47 +00:00
|
|
|
META_MOVE_RESIZE_CONFIGURE_REQUEST = 1 << 0,
|
2017-06-21 09:30:09 +00:00
|
|
|
META_MOVE_RESIZE_USER_ACTION = 1 << 1,
|
|
|
|
META_MOVE_RESIZE_MOVE_ACTION = 1 << 2,
|
|
|
|
META_MOVE_RESIZE_RESIZE_ACTION = 1 << 3,
|
2018-10-22 14:41:12 +00:00
|
|
|
META_MOVE_RESIZE_WAYLAND_FINISH_MOVE_RESIZE = 1 << 4,
|
2017-06-21 09:30:09 +00:00
|
|
|
META_MOVE_RESIZE_STATE_CHANGED = 1 << 5,
|
|
|
|
META_MOVE_RESIZE_UNMAXIMIZE = 1 << 6,
|
2019-06-13 08:35:35 +00:00
|
|
|
META_MOVE_RESIZE_UNFULLSCREEN = 1 << 7,
|
|
|
|
META_MOVE_RESIZE_FORCE_MOVE = 1 << 8,
|
|
|
|
META_MOVE_RESIZE_WAYLAND_STATE_CHANGED = 1 << 9,
|
|
|
|
META_MOVE_RESIZE_FORCE_UPDATE_MONITOR = 1 << 10,
|
2020-02-14 09:41:38 +00:00
|
|
|
META_MOVE_RESIZE_PLACEMENT_CHANGED = 1 << 11,
|
2021-11-04 03:35:22 +00:00
|
|
|
META_MOVE_RESIZE_WAYLAND_CLIENT_RESIZE = 1 << 12,
|
2022-03-04 14:23:38 +00:00
|
|
|
META_MOVE_RESIZE_CONSTRAIN = 1 << 13,
|
2014-03-19 14:30:12 +00:00
|
|
|
} MetaMoveResizeFlags;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_MOVE_RESIZE_RESULT_MOVED = 1 << 0,
|
|
|
|
META_MOVE_RESIZE_RESULT_RESIZED = 1 << 1,
|
|
|
|
META_MOVE_RESIZE_RESULT_FRAME_SHAPE_CHANGED = 1 << 2,
|
window: Let implementations finish state changes
In the old, synchronous X.org world, we could assume that
a state change always meant a synchronizing the window
geometry right after. After firing an operation that
would change the window state, such as maximizing or
tiling the window,
With Wayland, however, this is not valid anymore, since
Wayland is asynchronous. In this scenario, we call
meta_window_move_resize_internal() twice: when the user
executes an state-changing operation, and when the server
ACKs this operation. This breaks the previous assumptions,
and as a consequence, it breaks the GNOME Shell animations
in Wayland.
The solution is giving the MetaWindow control over the time
when the window geometry is synchronized with the compositor.
That is done by introducing a new result flag. Wayland asks
for a compositor sync after receiving an ACK from the server,
while X11 asks for it right away.
Fixes #78
2018-04-18 02:42:33 +00:00
|
|
|
META_MOVE_RESIZE_RESULT_STATE_CHANGED = 1 << 3,
|
2014-03-19 14:30:12 +00:00
|
|
|
} MetaMoveResizeResultFlags;
|
2012-01-07 22:21:32 +00:00
|
|
|
|
2016-02-01 10:46:11 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_PLACEMENT_GRAVITY_NONE = 0,
|
|
|
|
META_PLACEMENT_GRAVITY_TOP = 1 << 0,
|
|
|
|
META_PLACEMENT_GRAVITY_BOTTOM = 1 << 1,
|
|
|
|
META_PLACEMENT_GRAVITY_LEFT = 1 << 2,
|
|
|
|
META_PLACEMENT_GRAVITY_RIGHT = 1 << 3,
|
|
|
|
} MetaPlacementGravity;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_PLACEMENT_ANCHOR_NONE = 0,
|
|
|
|
META_PLACEMENT_ANCHOR_TOP = 1 << 0,
|
|
|
|
META_PLACEMENT_ANCHOR_BOTTOM = 1 << 1,
|
|
|
|
META_PLACEMENT_ANCHOR_LEFT = 1 << 2,
|
|
|
|
META_PLACEMENT_ANCHOR_RIGHT = 1 << 3,
|
|
|
|
} MetaPlacementAnchor;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_NONE = 0,
|
|
|
|
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_SLIDE_X = 1 << 0,
|
|
|
|
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_SLIDE_Y = 1 << 1,
|
|
|
|
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_FLIP_X = 1 << 2,
|
|
|
|
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_FLIP_Y = 1 << 3,
|
|
|
|
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_RESIZE_X = 1 << 4,
|
|
|
|
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_RESIZE_Y = 1 << 5,
|
|
|
|
} MetaPlacementConstraintAdjustment;
|
|
|
|
|
2018-08-24 10:54:50 +00:00
|
|
|
typedef enum _MetaWindowUpdateMonitorFlags
|
|
|
|
{
|
|
|
|
META_WINDOW_UPDATE_MONITOR_FLAGS_NONE = 0,
|
|
|
|
META_WINDOW_UPDATE_MONITOR_FLAGS_USER_OP = 1 << 0,
|
2018-08-24 10:56:31 +00:00
|
|
|
META_WINDOW_UPDATE_MONITOR_FLAGS_FORCE = 1 << 1,
|
2018-08-24 10:54:50 +00:00
|
|
|
} MetaWindowUpdateMonitorFlags;
|
|
|
|
|
2023-05-24 12:37:18 +00:00
|
|
|
typedef enum _MetaWindowSuspendState
|
|
|
|
{
|
|
|
|
META_WINDOW_SUSPEND_STATE_ACTIVE = 1,
|
|
|
|
META_WINDOW_SUSPEND_STATE_HIDDEN,
|
|
|
|
META_WINDOW_SUSPEND_STATE_SUSPENDED,
|
|
|
|
} MetaWindowSuspendState;
|
|
|
|
|
2016-02-01 10:46:11 +00:00
|
|
|
typedef struct _MetaPlacementRule
|
|
|
|
{
|
|
|
|
MetaRectangle anchor_rect;
|
|
|
|
MetaPlacementGravity gravity;
|
|
|
|
MetaPlacementAnchor anchor;
|
|
|
|
MetaPlacementConstraintAdjustment constraint_adjustment;
|
|
|
|
int offset_x;
|
|
|
|
int offset_y;
|
|
|
|
int width;
|
|
|
|
int height;
|
2020-02-14 09:41:38 +00:00
|
|
|
|
|
|
|
gboolean is_reactive;
|
|
|
|
|
|
|
|
MetaRectangle parent_rect;
|
2016-02-01 10:46:11 +00:00
|
|
|
} MetaPlacementRule;
|
|
|
|
|
2018-10-19 11:33:13 +00:00
|
|
|
typedef enum _MetaPlacementState
|
|
|
|
{
|
|
|
|
META_PLACEMENT_STATE_UNCONSTRAINED,
|
2020-02-14 09:41:38 +00:00
|
|
|
META_PLACEMENT_STATE_CONSTRAINED_PENDING,
|
|
|
|
META_PLACEMENT_STATE_CONSTRAINED_CONFIGURED,
|
|
|
|
META_PLACEMENT_STATE_CONSTRAINED_FINISHED,
|
|
|
|
META_PLACEMENT_STATE_INVALIDATED,
|
2018-10-19 11:33:13 +00:00
|
|
|
} MetaPlacementState;
|
|
|
|
|
2017-08-17 03:43:21 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_EDGE_CONSTRAINT_NONE = 0,
|
|
|
|
META_EDGE_CONSTRAINT_WINDOW = 1,
|
|
|
|
META_EDGE_CONSTRAINT_MONITOR = 2,
|
|
|
|
} MetaEdgeConstraint;
|
|
|
|
|
2020-05-24 01:07:51 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_EDGE_RESISTANCE_DEFAULT = 0,
|
|
|
|
META_EDGE_RESISTANCE_SNAP = 1 << 0,
|
|
|
|
META_EDGE_RESISTANCE_KEYBOARD_OP = 1 << 1,
|
2020-05-23 18:06:14 +00:00
|
|
|
META_EDGE_RESISTANCE_WINDOWS = 1 << 2,
|
2020-05-24 01:07:51 +00:00
|
|
|
} MetaEdgeResistanceFlags;
|
|
|
|
|
2001-05-30 15:36:31 +00:00
|
|
|
struct _MetaWindow
|
|
|
|
{
|
2008-11-07 09:57:00 +00:00
|
|
|
GObject parent_instance;
|
2014-05-02 13:34:02 +00:00
|
|
|
|
2001-05-31 06:42:58 +00:00
|
|
|
MetaDisplay *display;
|
2018-09-21 15:49:36 +00:00
|
|
|
uint64_t id;
|
2014-09-09 01:20:14 +00:00
|
|
|
guint64 stamp;
|
2016-12-01 07:15:52 +00:00
|
|
|
MetaLogicalMonitor *monitor;
|
2023-03-06 05:43:13 +00:00
|
|
|
MetaLogicalMonitor *highest_scale_monitor;
|
Partially resolve the conflicting requirements of windows on multiple
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
2004-12-22 23:52:52 +00:00
|
|
|
MetaWorkspace *workspace;
|
2012-01-07 22:21:32 +00:00
|
|
|
MetaWindowClientType client_type;
|
2001-05-30 15:36:31 +00:00
|
|
|
Window xwindow;
|
2001-05-31 06:42:58 +00:00
|
|
|
/* may be NULL! not all windows get decorated */
|
|
|
|
MetaFrame *frame;
|
|
|
|
int depth;
|
|
|
|
Visual *xvisual;
|
2001-06-02 04:14:18 +00:00
|
|
|
char *desc; /* used in debug spew */
|
2001-06-01 03:00:01 +00:00
|
|
|
char *title;
|
2001-06-04 06:17:52 +00:00
|
|
|
|
2001-06-10 03:17:15 +00:00
|
|
|
MetaWindowType type;
|
2013-11-19 22:33:57 +00:00
|
|
|
|
2002-04-13 04:58:45 +00:00
|
|
|
/* NOTE these five are not in UTF-8, we just treat them as random
|
2001-06-09 21:58:30 +00:00
|
|
|
* binary data
|
|
|
|
*/
|
|
|
|
char *res_class;
|
|
|
|
char *res_name;
|
|
|
|
char *role;
|
|
|
|
char *sm_client_id;
|
2002-04-13 04:58:45 +00:00
|
|
|
char *wm_client_machine;
|
2011-11-25 23:42:41 +00:00
|
|
|
|
2002-12-01 03:58:04 +00:00
|
|
|
char *startup_id;
|
2010-01-18 10:12:17 +00:00
|
|
|
char *mutter_hints;
|
2017-09-26 21:22:43 +00:00
|
|
|
char *sandboxed_app_id;
|
2011-03-19 09:31:25 +00:00
|
|
|
char *gtk_theme_variant;
|
2012-01-17 18:27:10 +00:00
|
|
|
char *gtk_application_id;
|
|
|
|
char *gtk_unique_bus_name;
|
|
|
|
char *gtk_application_object_path;
|
|
|
|
char *gtk_window_object_path;
|
|
|
|
char *gtk_app_menu_object_path;
|
|
|
|
char *gtk_menubar_object_path;
|
2002-04-13 04:58:45 +00:00
|
|
|
|
2001-06-09 21:58:30 +00:00
|
|
|
Window xtransient_for;
|
|
|
|
Window xgroup_leader;
|
|
|
|
Window xclient_leader;
|
2013-09-16 12:44:37 +00:00
|
|
|
MetaWindow *transient_for;
|
2001-06-13 00:56:08 +00:00
|
|
|
|
|
|
|
/* Initial workspace property */
|
2014-05-02 13:34:02 +00:00
|
|
|
int initial_workspace;
|
|
|
|
|
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
|
|
|
/* Initial timestamp property */
|
2014-05-02 13:34:02 +00:00
|
|
|
guint32 initial_timestamp;
|
|
|
|
|
2017-09-27 12:53:54 +00:00
|
|
|
/* The current tile mode */
|
2018-10-24 09:54:44 +00:00
|
|
|
MetaTileMode tile_mode;
|
|
|
|
|
2016-01-10 14:16:09 +00:00
|
|
|
int tile_monitor_number;
|
2017-08-17 03:43:21 +00:00
|
|
|
|
2018-10-24 12:24:22 +00:00
|
|
|
struct {
|
|
|
|
MetaEdgeConstraint top;
|
|
|
|
MetaEdgeConstraint right;
|
|
|
|
MetaEdgeConstraint bottom;
|
|
|
|
MetaEdgeConstraint left;
|
|
|
|
} edge_constraints;
|
2010-06-24 18:41:28 +00:00
|
|
|
|
2017-09-27 12:37:57 +00:00
|
|
|
double tile_hfraction;
|
|
|
|
|
2018-10-17 14:55:18 +00:00
|
|
|
uint64_t preferred_output_winsys_id;
|
2017-08-17 03:43:21 +00:00
|
|
|
|
2008-11-17 02:57:20 +00:00
|
|
|
/* Area to cover when in fullscreen mode. If _NET_WM_FULLSCREEN_MONITORS has
|
|
|
|
* been overridden (via a client message), the window will cover the union of
|
|
|
|
* these monitors. If not, this is the single monitor which the window's
|
|
|
|
* origin is on. */
|
2016-11-29 09:50:17 +00:00
|
|
|
struct {
|
|
|
|
MetaLogicalMonitor *top;
|
|
|
|
MetaLogicalMonitor *bottom;
|
|
|
|
MetaLogicalMonitor *left;
|
|
|
|
MetaLogicalMonitor *right;
|
|
|
|
} fullscreen_monitors;
|
2014-05-02 13:34:02 +00:00
|
|
|
|
2022-11-06 11:33:45 +00:00
|
|
|
/* if non-NULL, the bounds of the window frame */
|
|
|
|
cairo_region_t *frame_bounds;
|
|
|
|
|
|
|
|
/* if non-NULL, the bounding shape region of the window. Relative to
|
|
|
|
* the server-side client window. */
|
|
|
|
cairo_region_t *shape_region;
|
|
|
|
|
|
|
|
/* if non-NULL, the opaque region _NET_WM_OPAQUE_REGION */
|
|
|
|
cairo_region_t *opaque_region;
|
|
|
|
|
|
|
|
/* the input shape region for picking */
|
|
|
|
cairo_region_t *input_region;
|
|
|
|
|
|
|
|
/* _NET_WM_WINDOW_OPACITY rescaled to 0xFF */
|
|
|
|
guint8 opacity;
|
|
|
|
|
|
|
|
/* Note: can be NULL */
|
|
|
|
GSList *struts;
|
|
|
|
|
|
|
|
/* Number of UnmapNotify that are caused by us, if
|
|
|
|
* we get UnmapNotify with none pending then the client
|
|
|
|
* is withdrawing the window.
|
|
|
|
*/
|
|
|
|
int unmaps_pending;
|
|
|
|
|
|
|
|
/* Number of XReparentWindow requests that we have queued.
|
|
|
|
*/
|
|
|
|
int reparents_pending;
|
|
|
|
|
|
|
|
/* See docs for meta_window_get_stable_sequence() */
|
|
|
|
guint32 stable_sequence;
|
|
|
|
|
|
|
|
/* set to the most recent user-interaction event timestamp that we
|
|
|
|
know about for this window */
|
|
|
|
guint32 net_wm_user_time;
|
|
|
|
|
|
|
|
/* window that gets updated net_wm_user_time values */
|
|
|
|
Window user_time_window;
|
|
|
|
|
|
|
|
gboolean has_custom_frame_extents;
|
2022-05-09 09:24:23 +00:00
|
|
|
MetaFrameBorder custom_frame_extents;
|
2022-11-06 11:33:45 +00:00
|
|
|
|
|
|
|
/* The rectangles here are in "frame rect" coordinates. See the
|
|
|
|
* comment at the top of meta_window_move_resize_internal() for more
|
|
|
|
* information. */
|
|
|
|
|
|
|
|
/* The current window geometry of the window. */
|
|
|
|
MetaRectangle rect;
|
|
|
|
|
|
|
|
/* The geometry to restore when we unmaximize. */
|
|
|
|
MetaRectangle saved_rect;
|
|
|
|
|
|
|
|
/* The geometry to restore when we unfullscreen. */
|
|
|
|
MetaRectangle saved_rect_fullscreen;
|
|
|
|
|
|
|
|
/* This is the geometry the window will have if no constraints have
|
|
|
|
* applied. We use this whenever we are moving implicitly (for example,
|
|
|
|
* if we move to avoid a panel, we can snap back to this position if
|
|
|
|
* the panel moves again).
|
|
|
|
*/
|
|
|
|
MetaRectangle unconstrained_rect;
|
|
|
|
|
|
|
|
/* The rectangle of the "server-side" geometry of the buffer,
|
|
|
|
* in root coordinates.
|
|
|
|
*
|
|
|
|
* For X11 windows, this matches XGetGeometry of the toplevel.
|
|
|
|
*
|
|
|
|
* For Wayland windows, the position matches the position of the
|
|
|
|
* surface associated with shell surface (xdg_surface, etc.)
|
|
|
|
* The size matches the size surface size as displayed in the stage.
|
|
|
|
*/
|
|
|
|
MetaRectangle buffer_rect;
|
|
|
|
|
|
|
|
/* Cached net_wm_icon_geometry */
|
|
|
|
MetaRectangle icon_geometry;
|
|
|
|
|
|
|
|
/* x/y/w/h here get filled with ConfigureRequest values */
|
|
|
|
XSizeHints size_hints;
|
|
|
|
|
|
|
|
/* Managed by stack.c */
|
|
|
|
MetaStackLayer layer;
|
|
|
|
int stack_position; /* see comment in stack.h */
|
|
|
|
|
|
|
|
/* Managed by delete.c */
|
|
|
|
MetaCloseDialog *close_dialog;
|
|
|
|
|
|
|
|
/* maintained by group.c */
|
|
|
|
MetaGroup *group;
|
|
|
|
|
|
|
|
GObject *compositor_private;
|
|
|
|
|
|
|
|
/* Focused window that is (directly or indirectly) attached to this one */
|
|
|
|
MetaWindow *attached_focus_window;
|
|
|
|
|
|
|
|
/* The currently complementary tiled window, if any */
|
|
|
|
MetaWindow *tile_match;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
MetaPlacementRule *rule;
|
|
|
|
MetaPlacementState state;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int rel_x;
|
|
|
|
int rel_y;
|
|
|
|
} pending;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
int rel_x;
|
|
|
|
int rel_y;
|
|
|
|
} current;
|
|
|
|
} placement;
|
|
|
|
|
|
|
|
guint unmanage_idle_id;
|
|
|
|
guint close_dialog_timeout_id;
|
|
|
|
|
|
|
|
pid_t client_pid;
|
|
|
|
|
|
|
|
gboolean has_valid_cgroup;
|
|
|
|
GFile *cgroup_path;
|
|
|
|
|
|
|
|
unsigned int events_during_ping;
|
|
|
|
|
|
|
|
/* Whether this is an override redirect window or not */
|
|
|
|
guint override_redirect : 1;
|
|
|
|
|
|
|
|
/* Whether we're maximized */
|
|
|
|
guint maximized_horizontally : 1;
|
|
|
|
guint maximized_vertically : 1;
|
|
|
|
|
|
|
|
/* Whether we have to maximize/minimize after placement */
|
|
|
|
guint maximize_horizontally_after_placement : 1;
|
|
|
|
guint maximize_vertically_after_placement : 1;
|
|
|
|
guint minimize_after_placement : 1;
|
|
|
|
|
|
|
|
/* The last "full" maximized/unmaximized state. We need to keep track of
|
|
|
|
* that to toggle between normal/tiled or maximized/tiled states. */
|
|
|
|
guint saved_maximize : 1;
|
|
|
|
|
|
|
|
/* Whether we're fullscreen */
|
|
|
|
guint fullscreen : 1;
|
|
|
|
|
|
|
|
/* Whether the window is marked as urgent */
|
|
|
|
guint urgent : 1;
|
|
|
|
|
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 14:58:50 +00:00
|
|
|
/* Whether we're trying to constrain the window to be fully onscreen */
|
|
|
|
guint require_fully_onscreen : 1;
|
|
|
|
|
2009-08-31 13:52:16 +00:00
|
|
|
/* Whether we're trying to constrain the window to be on a single monitor */
|
|
|
|
guint require_on_single_monitor : 1;
|
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 14:58:50 +00:00
|
|
|
|
2006-08-07 23:34:55 +00:00
|
|
|
/* Whether we're trying to constrain the window's titlebar to be onscreen */
|
|
|
|
guint require_titlebar_visible : 1;
|
|
|
|
|
2001-06-10 03:17:15 +00:00
|
|
|
/* Whether we're sticky in the multi-workspace sense
|
|
|
|
* (vs. the not-scroll-with-viewport sense, we don't
|
|
|
|
* have no stupid viewports)
|
|
|
|
*/
|
|
|
|
guint on_all_workspaces : 1;
|
2001-06-08 02:17:48 +00:00
|
|
|
|
2011-02-28 10:41:23 +00:00
|
|
|
/* This is true if the client requested sticky, and implies on_all_workspaces == TRUE,
|
|
|
|
* however on_all_workspaces can be set TRUE for other internal reasons too, such as
|
|
|
|
* being override_redirect or being on the non-primary monitor. */
|
|
|
|
guint on_all_workspaces_requested : 1;
|
|
|
|
|
2001-06-04 06:17:52 +00:00
|
|
|
/* Minimize is the state controlled by the minimize button */
|
|
|
|
guint minimized : 1;
|
2005-10-03 20:02:31 +00:00
|
|
|
guint tab_unminimized : 1;
|
2001-06-08 02:17:48 +00:00
|
|
|
|
2001-06-11 03:24:20 +00:00
|
|
|
/* Whether the window is mapped; actual server-side state
|
|
|
|
* see also unmaps_pending
|
|
|
|
*/
|
|
|
|
guint mapped : 1;
|
2014-05-02 13:34:02 +00:00
|
|
|
|
2008-10-24 09:07:24 +00:00
|
|
|
/* Whether window has been hidden from view by lowering it to the bottom
|
|
|
|
* of window stack.
|
|
|
|
*/
|
|
|
|
guint hidden : 1;
|
|
|
|
|
2014-03-28 17:50:45 +00:00
|
|
|
/* Whether the compositor thinks the window is visible.
|
|
|
|
* This should match up with calls to meta_compositor_show_window /
|
|
|
|
* meta_compositor_hide_window.
|
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 21:10:40 +00:00
|
|
|
*/
|
|
|
|
guint visible_to_compositor : 1;
|
|
|
|
|
2014-03-28 17:50:45 +00:00
|
|
|
/* Whether the compositor knows about the window.
|
|
|
|
* This should match up with calls to meta_compositor_add_window /
|
|
|
|
* meta_compositor_remove_window.
|
|
|
|
*/
|
|
|
|
guint known_to_compositor : 1;
|
|
|
|
|
Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.
Simplify this so that visibility is controlled by:
meta_compositor_show_window()
meta_compositor_hide_window()
With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)
The map state of the window is signalled separately by:
meta_compositor_map_window()
meta_compositor_unmap_window()
And is used only to control resource handling.
Other changes:
* The desired effect on show/hide is explicitly stored in
MetaWindow, avoiding the need for the was_minimized flag.
At idle, once we calculate the window state, we pass the
effect to the compositor if it matches the new window
state, and then clear the effect to start over for future
map state changes.
* meta_compositor_switch_workspace() is called before any windows
are hidden or shown, allowing the compositor to avoid hiding
or showing an effect for windows involved in the switch.
http://bugzilla.gnome.org/show_bug.cgi?id=582341
* Handling of post-effect cleanups for MutterWindow are
simplified - instead of trying to do different things based
on the individual needs of different effects, we just wait until
all effects complete and sync the window state to what it
should be.
* On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
that we've done so, so it can clean up and unbind. (The
unbinding doesn't seem to be working properly because of
ClutterGLXPixmap or video driver issues.)
http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-06-28 21:10:40 +00:00
|
|
|
/* When we next show or hide the window, what effect we should
|
|
|
|
* tell the compositor to perform.
|
|
|
|
*/
|
|
|
|
guint pending_compositor_effect : 4; /* MetaCompEffect */
|
|
|
|
|
2001-06-04 06:17:52 +00:00
|
|
|
/* Iconic is the state in WM_STATE; happens for workspaces/shading
|
|
|
|
* in addition to minimize
|
|
|
|
*/
|
2001-06-02 04:14:18 +00:00
|
|
|
guint iconic : 1;
|
2001-06-04 06:17:52 +00:00
|
|
|
/* initially_iconic is the WM_HINTS setting when we first manage
|
2001-06-06 04:47:37 +00:00
|
|
|
* the window. It's taken to mean initially minimized.
|
2001-06-04 06:17:52 +00:00
|
|
|
*/
|
|
|
|
guint initially_iconic : 1;
|
2001-06-24 06:47:54 +00:00
|
|
|
|
|
|
|
/* whether an initial workspace was explicitly set */
|
|
|
|
guint initial_workspace_set : 1;
|
2014-05-02 13:34:02 +00:00
|
|
|
|
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 15:47:05 +00:00
|
|
|
/* whether an initial timestamp was explicitly set */
|
|
|
|
guint initial_timestamp_set : 1;
|
2014-05-02 13:34:02 +00:00
|
|
|
|
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 15:47:05 +00:00
|
|
|
/* whether net_wm_user_time has been set yet */
|
|
|
|
guint net_wm_user_time_set : 1;
|
2013-02-01 10:32:53 +00:00
|
|
|
|
|
|
|
/* whether net_wm_icon_geometry has been set */
|
|
|
|
guint icon_geometry_set : 1;
|
2014-05-02 13:34:02 +00:00
|
|
|
|
2001-06-04 04:58:22 +00:00
|
|
|
/* Globally active / No input */
|
|
|
|
guint input : 1;
|
2014-05-02 13:34:02 +00:00
|
|
|
|
2001-06-23 18:30:27 +00:00
|
|
|
/* MWM hints about features of window */
|
|
|
|
guint mwm_decorated : 1;
|
2002-06-22 03:23:02 +00:00
|
|
|
guint mwm_border_only : 1;
|
2001-06-23 18:30:27 +00:00
|
|
|
guint mwm_has_close_func : 1;
|
|
|
|
guint mwm_has_minimize_func : 1;
|
|
|
|
guint mwm_has_maximize_func : 1;
|
|
|
|
guint mwm_has_move_func : 1;
|
|
|
|
guint mwm_has_resize_func : 1;
|
2014-05-02 13:34:02 +00:00
|
|
|
|
2001-06-23 18:30:27 +00:00
|
|
|
/* Computed features of window */
|
2001-06-08 06:39:38 +00:00
|
|
|
guint decorated : 1;
|
2002-06-22 03:23:02 +00:00
|
|
|
guint border_only : 1;
|
2002-05-26 15:54:38 +00:00
|
|
|
guint always_sticky : 1;
|
2001-06-08 06:39:38 +00:00
|
|
|
guint has_close_func : 1;
|
|
|
|
guint has_minimize_func : 1;
|
|
|
|
guint has_maximize_func : 1;
|
2001-06-23 18:30:27 +00:00
|
|
|
guint has_move_func : 1;
|
|
|
|
guint has_resize_func : 1;
|
2002-02-23 22:58:02 +00:00
|
|
|
guint has_fullscreen_func : 1;
|
2002-07-06 19:05:37 +00:00
|
|
|
|
|
|
|
/* Computed whether to skip taskbar or not */
|
|
|
|
guint skip_taskbar : 1;
|
|
|
|
guint skip_pager : 1;
|
wayland: Add API to launch trusted clients
Allowing code from inside mutter to create a child process and
delegate on it some of its tasks is something very useful. This can
be done easily with the g_subprocess and g_subprocess_launcher classes
already available in GLib and GObject.
Unfortunately, although the child process can be a graphical program,
currently it is not possible for the inner code to identify the
windows created by the child in a secure manner (this is: being able
to ensure that a malicious program won't be able to trick the inner
code into thinking it is a child process launched by it).
Under X11 this is not a problem because any program has full control
over their windows, but under Wayland it is a different story: a
program can't neither force their window to be kept at the top (like a
docker program does) or at the bottom (like a program for desktop icons
does), nor hide it from the list of windows. This means that it is not
possible for a "classic", non-priviledged program, to fulfill these
tasks, and it can be done only from code inside mutter (like a
gnome-shell extension).
This is a non desirable situation, because an extension runs in the
same main loop than the whole desktop itself, which means that a
complex extension can need to do too much work inside the main loop,
and freeze the whole desktop for too much time. Also, it is important
to note that javascript doesn't have access to fork(), or threads,
which means that, at most, all the parallel computing that can do is
those available in the _async calls in GLib/GObject.
Also, having to create an extension for any priviledged graphical
element is an stopper for a lot of programmers who already know
GTK+ but doesn't know Clutter.
This patch wants to offer a solution to this problem, by offering a
new class that allows to launch a trusted child process from inside
mutter, and make it to use an specific UNIX socket to communicate
with the compositor. It also allows to check whether an specific
MetaWindow was created by one of this trusted child processes or not.
This allows to create extensions that launch a child process, and
when that process creates a window, the extension can confirm in a
secure way that the window really belongs to that process
launched by it, so it can give to that window "superpowers" like
being kept at the bottom of the desktop, not being listed in the
list of windows or shown in the Activities panel... Also, in future
versions, it could easily implement protocol extensions that only
could be used by these trusted child processes.
Several examples of the usefulness of this are that, with it, it
is possible to write programs that implements:
- desktop icons
- a dock
- a top or bottom bar
...
all in a secure manner, avoiding insecure programs to do the same.
In fact, even if the same code is launched manually, it won't have
those privileges, only the specific process launched from inside
mutter.
Since this is only needed under Wayland, it won't work under X11.
Fixes https://gitlab.gnome.org/GNOME/mutter/issues/741
2020-08-04 08:42:29 +00:00
|
|
|
guint skip_from_window_list : 1;
|
2002-10-02 00:47:29 +00:00
|
|
|
|
|
|
|
/* TRUE if client set these */
|
|
|
|
guint wm_state_above : 1;
|
|
|
|
guint wm_state_below : 1;
|
Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 19:56:10 +00:00
|
|
|
|
|
|
|
/* EWHH demands attention flag */
|
|
|
|
guint wm_state_demands_attention : 1;
|
2014-05-02 13:34:02 +00:00
|
|
|
|
2011-04-26 12:12:04 +00:00
|
|
|
/* TRUE iff window == window->display->focus_window */
|
2001-06-04 04:58:22 +00:00
|
|
|
guint has_focus : 1;
|
2011-03-25 01:36:47 +00:00
|
|
|
|
2019-10-12 18:55:26 +00:00
|
|
|
/* TRUE if window appears focused at the moment */
|
|
|
|
guint appears_focused : 1;
|
|
|
|
|
2001-06-22 03:20:21 +00:00
|
|
|
/* Have we placed this window? */
|
|
|
|
guint placed : 1;
|
|
|
|
|
2005-02-11 19:20:44 +00:00
|
|
|
/* Is this not a transient of the focus window which is being denied focus? */
|
|
|
|
guint denied_focus_and_not_transient : 1;
|
|
|
|
|
2004-12-28 06:01:42 +00:00
|
|
|
/* Has this window not ever been shown yet? */
|
|
|
|
guint showing_for_first_time : 1;
|
|
|
|
|
2008-11-07 09:57:00 +00:00
|
|
|
/* Are we in meta_window_unmanage()? */
|
2001-06-22 03:20:21 +00:00
|
|
|
guint unmanaging : 1;
|
|
|
|
|
deleted and moved into window-props.c (meta_window_new_with_attrs): added
2006-03-25 Thomas Thurman <thomas@thurman.org.uk>
* src/window.c, src/window.h (update_net_wm_state,
update_mwm_hints, update_wm_class, update_transient_for):
deleted and moved into window-props.c
(meta_window_new_with_attrs): added constructing field
and four new initial properties (as above)
(meta_window_recalc_features,
meta_window_recalc_window_type): new functions
* src/window-props.c (init_net_wm_state, reload_net_wm_state
init_mwm_hints, reload_mwm_hints, init_wm_class,
reload_mwm_class, init_transient_for, reload_transient_for):
new functions, moved in from window.c
(meta_display_init_window_prop_hooks): initialise new properties
2006-03-25 22:57:22 +00:00
|
|
|
/* Are we in meta_window_new()? */
|
|
|
|
guint constructing : 1;
|
2014-05-02 13:34:02 +00:00
|
|
|
|
2001-06-23 05:49:35 +00:00
|
|
|
/* Used by keybindings.c */
|
2001-07-11 06:22:00 +00:00
|
|
|
guint keys_grabbed : 1; /* normal keybindings grabbed */
|
|
|
|
guint grab_on_frame : 1; /* grabs are on the frame */
|
2014-05-02 13:34:02 +00:00
|
|
|
|
2001-06-23 18:30:27 +00:00
|
|
|
/* Set if the reason for unmanaging the window is that
|
|
|
|
* it was withdrawn
|
|
|
|
*/
|
|
|
|
guint withdrawn : 1;
|
2001-06-24 08:09:10 +00:00
|
|
|
|
|
|
|
/* TRUE if constrain_position should calc placement.
|
|
|
|
* only relevant if !window->placed
|
|
|
|
*/
|
|
|
|
guint calc_placement : 1;
|
2002-01-10 06:31:31 +00:00
|
|
|
|
2003-10-13 20:15:40 +00:00
|
|
|
/* if TRUE we have a grab on the focus click buttons */
|
|
|
|
guint have_focus_click_grab : 1;
|
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
|
|
|
|
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 TRUE, window is attached to its parent */
|
|
|
|
guint attached : 1;
|
|
|
|
|
2013-02-20 20:17:21 +00:00
|
|
|
/* whether or not the window is from a program running on another machine */
|
|
|
|
guint is_remote : 1;
|
|
|
|
|
2018-08-21 22:58:06 +00:00
|
|
|
/* whether focus should be restored on map */
|
|
|
|
guint restore_focus_on_map : 1;
|
|
|
|
|
2021-09-03 21:38:12 +00:00
|
|
|
/* Whether the window is alive */
|
|
|
|
guint is_alive : 1;
|
|
|
|
|
2022-11-06 11:38:35 +00:00
|
|
|
guint in_workspace_change : 1;
|
2001-05-30 15:36:31 +00:00
|
|
|
};
|
|
|
|
|
2008-11-07 09:57:00 +00:00
|
|
|
struct _MetaWindowClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
2014-03-18 15:20:22 +00:00
|
|
|
|
2014-03-19 13:36:15 +00:00
|
|
|
void (*manage) (MetaWindow *window);
|
|
|
|
void (*unmanage) (MetaWindow *window);
|
2014-03-20 19:12:44 +00:00
|
|
|
void (*ping) (MetaWindow *window,
|
|
|
|
guint32 serial);
|
2014-03-20 19:07:44 +00:00
|
|
|
void (*delete) (MetaWindow *window,
|
|
|
|
guint32 timestamp);
|
|
|
|
void (*kill) (MetaWindow *window);
|
2014-03-20 19:16:57 +00:00
|
|
|
void (*focus) (MetaWindow *window,
|
|
|
|
guint32 timestamp);
|
2014-04-29 19:55:55 +00:00
|
|
|
void (*grab_op_began) (MetaWindow *window,
|
|
|
|
MetaGrabOp op);
|
|
|
|
void (*grab_op_ended) (MetaWindow *window,
|
|
|
|
MetaGrabOp op);
|
2014-05-20 19:46:21 +00:00
|
|
|
void (*current_workspace_changed) (MetaWindow *window);
|
2014-03-19 14:30:12 +00:00
|
|
|
void (*move_resize_internal) (MetaWindow *window,
|
2020-02-14 08:44:43 +00:00
|
|
|
MetaGravity gravity,
|
2014-05-21 17:59:13 +00:00
|
|
|
MetaRectangle unconstrained_rect,
|
2014-03-19 14:30:12 +00:00
|
|
|
MetaRectangle constrained_rect,
|
2020-02-14 09:41:38 +00:00
|
|
|
MetaRectangle temporary_rect,
|
2020-02-14 07:52:48 +00:00
|
|
|
int rel_x,
|
|
|
|
int rel_y,
|
2014-03-19 14:30:12 +00:00
|
|
|
MetaMoveResizeFlags flags,
|
|
|
|
MetaMoveResizeResultFlags *result);
|
2014-04-28 21:06:38 +00:00
|
|
|
gboolean (*update_struts) (MetaWindow *window);
|
2014-03-18 15:20:22 +00:00
|
|
|
void (*get_default_skip_hints) (MetaWindow *window,
|
|
|
|
gboolean *skip_taskbar_out,
|
|
|
|
gboolean *skip_pager_out);
|
2022-01-28 23:02:24 +00:00
|
|
|
|
|
|
|
cairo_surface_t * (*get_icon) (MetaWindow *window);
|
|
|
|
cairo_surface_t * (*get_mini_icon) (MetaWindow *window);
|
|
|
|
|
2020-04-08 14:13:38 +00:00
|
|
|
pid_t (*get_client_pid) (MetaWindow *window);
|
2018-08-24 10:54:50 +00:00
|
|
|
void (*update_main_monitor) (MetaWindow *window,
|
|
|
|
MetaWindowUpdateMonitorFlags flags);
|
2015-03-03 03:13:05 +00:00
|
|
|
void (*main_monitor_changed) (MetaWindow *window,
|
2016-11-25 06:31:38 +00:00
|
|
|
const MetaLogicalMonitor *old);
|
2019-08-22 08:55:17 +00:00
|
|
|
void (*adjust_fullscreen_monitor_rect) (MetaWindow *window,
|
|
|
|
MetaRectangle *monitor_rect);
|
2017-03-17 12:34:52 +00:00
|
|
|
void (*force_restore_shortcuts) (MetaWindow *window,
|
|
|
|
ClutterInputDevice *source);
|
|
|
|
gboolean (*shortcuts_inhibited) (MetaWindow *window,
|
|
|
|
ClutterInputDevice *source);
|
2018-11-13 07:56:53 +00:00
|
|
|
gboolean (*is_focusable) (MetaWindow *window);
|
2018-01-09 12:19:40 +00:00
|
|
|
gboolean (*is_stackable) (MetaWindow *window);
|
2019-01-30 19:41:11 +00:00
|
|
|
gboolean (*can_ping) (MetaWindow *window);
|
2018-09-14 17:03:38 +00:00
|
|
|
gboolean (*are_updates_frozen) (MetaWindow *window);
|
2021-02-11 16:53:59 +00:00
|
|
|
gboolean (*is_focus_async) (MetaWindow *window);
|
2018-12-30 12:55:52 +00:00
|
|
|
|
2019-11-26 19:53:24 +00:00
|
|
|
MetaStackLayer (*calculate_layer) (MetaWindow *window);
|
|
|
|
|
2022-05-18 11:51:44 +00:00
|
|
|
#ifdef HAVE_WAYLAND
|
|
|
|
MetaWaylandSurface * (*get_wayland_surface) (MetaWindow *window);
|
|
|
|
#endif
|
|
|
|
|
2018-12-30 12:55:52 +00:00
|
|
|
void (* map) (MetaWindow *window);
|
|
|
|
void (* unmap) (MetaWindow *window);
|
2008-11-07 09:57:00 +00:00
|
|
|
};
|
|
|
|
|
2003-06-12 05:55:06 +00:00
|
|
|
/* These differ from window->has_foo_func in that they consider
|
|
|
|
* the dynamic window state such as "maximized", not just the
|
|
|
|
* window's type
|
|
|
|
*/
|
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
|
|
|
#define META_WINDOW_MAXIMIZED(w) ((w)->maximized_horizontally && \
|
|
|
|
(w)->maximized_vertically)
|
2008-03-03 01:58:54 +00:00
|
|
|
#define META_WINDOW_MAXIMIZED_VERTICALLY(w) ((w)->maximized_vertically)
|
|
|
|
#define META_WINDOW_MAXIMIZED_HORIZONTALLY(w) ((w)->maximized_horizontally)
|
2016-01-10 14:16:09 +00:00
|
|
|
#define META_WINDOW_TILED_SIDE_BY_SIDE(w) ((w)->maximized_vertically && \
|
|
|
|
!(w)->maximized_horizontally && \
|
|
|
|
(w)->tile_mode != META_TILE_NONE)
|
|
|
|
#define META_WINDOW_TILED_LEFT(w) (META_WINDOW_TILED_SIDE_BY_SIDE(w) && \
|
|
|
|
(w)->tile_mode == META_TILE_LEFT)
|
|
|
|
#define META_WINDOW_TILED_RIGHT(w) (META_WINDOW_TILED_SIDE_BY_SIDE(w) && \
|
|
|
|
(w)->tile_mode == META_TILE_RIGHT)
|
|
|
|
#define META_WINDOW_TILED_MAXIMIZED(w)(META_WINDOW_MAXIMIZED(w) && \
|
|
|
|
(w)->tile_mode == META_TILE_MAXIMIZED)
|
2003-06-12 05:55:06 +00:00
|
|
|
#define META_WINDOW_ALLOWS_MOVE(w) ((w)->has_move_func && !(w)->fullscreen)
|
2023-03-03 12:24:42 +00:00
|
|
|
#define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w) ((w)->has_resize_func && !META_WINDOW_MAXIMIZED (w) && !(w)->fullscreen)
|
2002-07-03 02:32:40 +00:00
|
|
|
#define META_WINDOW_ALLOWS_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && \
|
|
|
|
(((w)->size_hints.min_width < (w)->size_hints.max_width) || \
|
|
|
|
((w)->size_hints.min_height < (w)->size_hints.max_height)))
|
|
|
|
#define META_WINDOW_ALLOWS_HORIZONTAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && (w)->size_hints.min_width < (w)->size_hints.max_width)
|
|
|
|
#define META_WINDOW_ALLOWS_VERTICAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && (w)->size_hints.min_height < (w)->size_hints.max_height)
|
|
|
|
|
2008-11-07 09:57:00 +00:00
|
|
|
void meta_window_unmanage (MetaWindow *window,
|
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 17:27:24 +00:00
|
|
|
guint32 timestamp);
|
2018-10-18 14:24:18 +00:00
|
|
|
void meta_window_unmanage_on_idle (MetaWindow *window);
|
Refactor thrice-duplicated queue code in window.c. Closes #376760.
2007-06-10 Thomas Thurman <thomas@thurman.org.uk>
Refactor thrice-duplicated queue code in window.c. Closes #376760.
* src/window.c (meta_window_queue, meta_window_unqueue):
New functions.
* src/window.[ch] (meta_window_unqueue_*, meta_window_queue_*):
Removed functions.
* src/window.c (meta_window_new_with_attrs, meta_window_free,
meta_window_flush_calc_showing, queue_calc_showing_func,
meta_window_minimize, meta_window_unminimize, meta_window_maximize,
meta_window_make_fullscreen, meta_window_shade,
meta_window_unshade, meta_window_move_resize_internal,
window_stick_impl, window_unstick_impl,
meta_window_client_message, process_property_notify): Modified to
use new queueing functions.
* src/window.c (idle_move_resize, idle_update_icon,
idle_calc_showing): update to receive queue number from pointer.
* src/window.h (MetaQueueType): new enum.
* src/window.h (MetaWindow): *_queued replaced with is_in_queue
bitfield.
* src/core.c (meta_core_queue_frame_resize):
* src/display.c (event_callback,
meta_display_queue_retheme_all_windows): Using new queueing functions.
* src/frame.c (meta_window_destroy_frame): Using new queueing functions.
* src/screen.c (queue_resize, meta_screen_resize_func,
queue_windows_showing): Using new queueing functions.
* src/window-props.c (reload_mwm_hints, reload_wm_hints,
reload_transient_for): Using new queueing functions.
* src/workspace.c (meta_workspace_add_window,
meta_workspace_remove_window, meta_workspace_queue_calc_showing,
meta_workspace_invalidate_work_area): Using new queueing functions.
svn path=/trunk/; revision=3236
2007-06-11 01:15:33 +00:00
|
|
|
void meta_window_queue (MetaWindow *window,
|
2023-02-23 19:06:45 +00:00
|
|
|
MetaQueueType queue_types);
|
2020-04-02 17:04:43 +00:00
|
|
|
META_EXPORT_TEST
|
|
|
|
void meta_window_untile (MetaWindow *window);
|
|
|
|
|
2019-11-01 12:38:25 +00:00
|
|
|
META_EXPORT_TEST
|
2017-09-27 13:11:54 +00:00
|
|
|
void meta_window_tile (MetaWindow *window,
|
|
|
|
MetaTileMode mode);
|
2019-06-13 13:49:26 +00:00
|
|
|
MetaTileMode meta_window_get_tile_mode (MetaWindow *window);
|
2017-09-27 12:37:57 +00:00
|
|
|
void meta_window_restore_tile (MetaWindow *window,
|
|
|
|
MetaTileMode mode,
|
|
|
|
int width,
|
|
|
|
int height);
|
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
|
|
|
void meta_window_maximize_internal (MetaWindow *window,
|
|
|
|
MetaMaximizeFlags directions,
|
|
|
|
MetaRectangle *saved_rect);
|
2001-06-06 04:47:37 +00:00
|
|
|
|
Fix several bugs with handling of fullscreen windows, causing them to not
2006-08-21 Elijah Newren <newren gmail com>
Fix several bugs with handling of fullscreen windows, causing them
to not actually be fullscreen. #343115 (and also #346927,
#350547, #351643, the recent additional WINE-related issue
mentioned on the mailing list, and probably others...)
* src/constraints.c (setup_constraint_info): if a window tries to
resize to fullscreen-size and it has a fullscreen function but
isn't actually marked as fullscreen then assist it by marking it
as such, (constrain_fully_onscreen, constrain_titlebar_visible):
ignore this constraint for fullscreen windows since such windows
have a separate specialized constraint
* src/stack.c (window_is_fullscreen_size, get_standalone_layer):
remove the old window_is_fullscreen_size() hack for detecting
windows to treat as fullscreen since it doesn't work well with the
new constraints framework (i.e. we needed a slightly different
hack)
* src/window.[ch] (meta_window_new_with_addrs): shuffle the order
of adding the window to the stack and moveresizing the window
since moveresizing can cause stack changes if the window's initial
size is fullscreen size, (meta_window_make_fullscreen,
meta_window_make_fullscreen_internal): split
meta_window_make_fullscreen() similar to meta_window_maximize() so
that constraints can make use of it
2006-08-21 18:08:05 +00:00
|
|
|
void meta_window_make_fullscreen_internal (MetaWindow *window);
|
2016-11-29 09:50:17 +00:00
|
|
|
void meta_window_update_fullscreen_monitors (MetaWindow *window,
|
|
|
|
MetaLogicalMonitor *top,
|
|
|
|
MetaLogicalMonitor *bottom,
|
|
|
|
MetaLogicalMonitor *left,
|
|
|
|
MetaLogicalMonitor *right);
|
|
|
|
|
|
|
|
gboolean meta_window_has_fullscreen_monitors (MetaWindow *window);
|
2001-10-29 07:00:46 +00:00
|
|
|
|
2019-08-22 08:55:17 +00:00
|
|
|
void meta_window_adjust_fullscreen_monitor_rect (MetaWindow *window,
|
|
|
|
MetaRectangle *monitor_rect);
|
|
|
|
|
2014-05-20 22:28:56 +00:00
|
|
|
void meta_window_resize_frame_with_gravity (MetaWindow *window,
|
|
|
|
gboolean user_op,
|
|
|
|
int w,
|
|
|
|
int h,
|
2020-02-14 08:44:43 +00:00
|
|
|
MetaGravity gravity);
|
2014-05-20 22:28:56 +00:00
|
|
|
|
2023-04-15 20:04:39 +00:00
|
|
|
gboolean meta_window_should_be_showing_on_workspace (MetaWindow *window,
|
|
|
|
MetaWorkspace *workspace);
|
|
|
|
|
2004-12-20 02:53:08 +00:00
|
|
|
/* Return whether the window should be currently mapped */
|
|
|
|
gboolean meta_window_should_be_showing (MetaWindow *window);
|
2006-01-10 18:33:53 +00:00
|
|
|
|
2003-06-26 03:09:38 +00:00
|
|
|
void meta_window_update_struts (MetaWindow *window);
|
|
|
|
|
2001-07-07 18:43:19 +00:00
|
|
|
/* gets position we need to set to stay in current position,
|
|
|
|
* assuming position will be gravity-compensated. i.e.
|
|
|
|
* this is the position a client would send in a configure
|
|
|
|
* request.
|
|
|
|
*/
|
|
|
|
void meta_window_get_gravity_position (MetaWindow *window,
|
2020-02-14 08:44:43 +00:00
|
|
|
MetaGravity gravity,
|
2001-07-07 18:43:19 +00:00
|
|
|
int *x,
|
|
|
|
int *y);
|
2001-07-28 06:35:19 +00:00
|
|
|
/* Get geometry for saving in the session; x/y are gravity
|
|
|
|
* position, and w/h are in resize inc above the base size.
|
|
|
|
*/
|
2014-05-21 17:49:24 +00:00
|
|
|
void meta_window_get_session_geometry (MetaWindow *window,
|
2001-07-28 06:35:19 +00:00
|
|
|
int *x,
|
|
|
|
int *y,
|
|
|
|
int *width,
|
|
|
|
int *height);
|
2005-05-26 19:58:17 +00:00
|
|
|
|
2001-12-10 07:48:21 +00:00
|
|
|
void meta_window_update_unfocused_button_grabs (MetaWindow *window);
|
2001-06-04 04:58:22 +00:00
|
|
|
|
2019-10-12 18:55:26 +00:00
|
|
|
void meta_window_update_appears_focused (MetaWindow *window);
|
|
|
|
|
2011-04-26 12:12:04 +00:00
|
|
|
void meta_window_set_focused_internal (MetaWindow *window,
|
|
|
|
gboolean focused);
|
2001-06-10 03:17:15 +00:00
|
|
|
|
2018-11-13 07:56:53 +00:00
|
|
|
gboolean meta_window_is_focusable (MetaWindow *window);
|
|
|
|
|
2019-01-30 19:41:11 +00:00
|
|
|
gboolean meta_window_can_ping (MetaWindow *window);
|
|
|
|
|
2019-11-26 19:53:24 +00:00
|
|
|
MetaStackLayer meta_window_calculate_layer (MetaWindow *window);
|
|
|
|
|
2022-05-18 11:51:44 +00:00
|
|
|
#ifdef HAVE_WAYLAND
|
|
|
|
META_EXPORT_TEST
|
|
|
|
MetaWaylandSurface * meta_window_get_wayland_surface (MetaWindow *window);
|
|
|
|
#endif
|
|
|
|
|
2014-05-20 19:46:21 +00:00
|
|
|
void meta_window_current_workspace_changed (MetaWindow *window);
|
2001-06-23 05:49:35 +00:00
|
|
|
|
2014-05-23 21:14:51 +00:00
|
|
|
void meta_window_show_menu (MetaWindow *window,
|
|
|
|
MetaWindowMenuType menu,
|
|
|
|
int x,
|
|
|
|
int y);
|
2001-06-23 05:49:35 +00:00
|
|
|
|
2003-06-26 03:09:38 +00:00
|
|
|
GList* meta_window_get_workspaces (MetaWindow *window);
|
|
|
|
|
2016-11-29 03:48:52 +00:00
|
|
|
void meta_window_get_work_area_for_logical_monitor (MetaWindow *window,
|
|
|
|
MetaLogicalMonitor *logical_monitor,
|
|
|
|
MetaRectangle *area);
|
|
|
|
|
2016-01-10 14:16:09 +00:00
|
|
|
int meta_window_get_current_tile_monitor_number (MetaWindow *window);
|
2017-09-27 12:53:54 +00:00
|
|
|
void meta_window_get_tile_area (MetaWindow *window,
|
|
|
|
MetaTileMode mode,
|
|
|
|
MetaRectangle *tile_area);
|
2016-01-10 14:16:09 +00:00
|
|
|
|
|
|
|
|
2002-01-27 05:50:34 +00:00
|
|
|
gboolean meta_window_same_application (MetaWindow *window,
|
|
|
|
MetaWindow *other_window);
|
|
|
|
|
2002-12-06 05:07:01 +00:00
|
|
|
#define META_WINDOW_IN_NORMAL_TAB_CHAIN_TYPE(w) \
|
2002-03-12 04:34:17 +00:00
|
|
|
((w)->type != META_WINDOW_DOCK && (w)->type != META_WINDOW_DESKTOP)
|
2002-12-06 05:07:01 +00:00
|
|
|
#define META_WINDOW_IN_NORMAL_TAB_CHAIN(w) \
|
2019-01-30 19:19:41 +00:00
|
|
|
(meta_window_is_focusable (w) && META_WINDOW_IN_NORMAL_TAB_CHAIN_TYPE (w) && (!(w)->skip_taskbar))
|
2002-04-05 15:52:49 +00:00
|
|
|
#define META_WINDOW_IN_DOCK_TAB_CHAIN(w) \
|
2019-01-30 19:19:41 +00:00
|
|
|
(meta_window_is_focusable (w) && (! META_WINDOW_IN_NORMAL_TAB_CHAIN_TYPE (w) || (w)->skip_taskbar))
|
2006-04-15 02:05:44 +00:00
|
|
|
#define META_WINDOW_IN_GROUP_TAB_CHAIN(w, g) \
|
2019-01-30 19:19:41 +00:00
|
|
|
(meta_window_is_focusable (w) && (!g || meta_window_get_group(w)==g))
|
2002-04-05 15:52:49 +00:00
|
|
|
|
2002-04-13 04:58:45 +00:00
|
|
|
void meta_window_free_delete_dialog (MetaWindow *window);
|
|
|
|
|
2019-11-26 20:01:37 +00:00
|
|
|
MetaStackLayer meta_window_get_default_layer (MetaWindow *window);
|
2002-09-24 21:22:06 +00:00
|
|
|
void meta_window_update_layer (MetaWindow *window);
|
|
|
|
|
deleted and moved into window-props.c (meta_window_new_with_attrs): added
2006-03-25 Thomas Thurman <thomas@thurman.org.uk>
* src/window.c, src/window.h (update_net_wm_state,
update_mwm_hints, update_wm_class, update_transient_for):
deleted and moved into window-props.c
(meta_window_new_with_attrs): added constructing field
and four new initial properties (as above)
(meta_window_recalc_features,
meta_window_recalc_window_type): new functions
* src/window-props.c (init_net_wm_state, reload_net_wm_state
init_mwm_hints, reload_mwm_hints, init_wm_class,
reload_mwm_class, init_transient_for, reload_transient_for):
new functions, moved in from window.c
(meta_display_init_window_prop_hooks): initialise new properties
2006-03-25 22:57:22 +00:00
|
|
|
void meta_window_recalc_features (MetaWindow *window);
|
2008-11-19 12:30:45 +00:00
|
|
|
|
2014-03-13 20:52:31 +00:00
|
|
|
void meta_window_set_type (MetaWindow *window,
|
|
|
|
MetaWindowType type);
|
2003-02-28 01:24:44 +00:00
|
|
|
|
2013-11-15 22:37:50 +00:00
|
|
|
void meta_window_frame_size_changed (MetaWindow *window);
|
|
|
|
|
2018-01-09 12:19:40 +00:00
|
|
|
gboolean meta_window_is_in_stack (MetaWindow *window);
|
|
|
|
|
Add support for _NET_WM_USER_TIME
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
2004-06-24 15:47:05 +00:00
|
|
|
void meta_window_stack_just_below (MetaWindow *window,
|
|
|
|
MetaWindow *below_this_one);
|
2003-02-28 01:24:44 +00:00
|
|
|
|
2017-09-29 14:57:22 +00:00
|
|
|
void meta_window_stack_just_above (MetaWindow *window,
|
|
|
|
MetaWindow *above_this_one);
|
|
|
|
|
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
|
|
|
void meta_window_set_user_time (MetaWindow *window,
|
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 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
|
|
|
|
2011-05-20 08:56:12 +00:00
|
|
|
void meta_window_update_for_monitors_changed (MetaWindow *window);
|
2014-08-16 17:22:05 +00:00
|
|
|
void meta_window_on_all_workspaces_changed (MetaWindow *window);
|
2009-01-27 05:03:06 +00:00
|
|
|
|
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 14:14:52 +00:00
|
|
|
gboolean meta_window_should_attach_to_parent (MetaWindow *window);
|
2016-01-10 14:16:08 +00:00
|
|
|
gboolean meta_window_can_tile_side_by_side (MetaWindow *window);
|
2016-01-10 14:16:09 +00:00
|
|
|
|
|
|
|
void meta_window_compute_tile_match (MetaWindow *window);
|
2012-02-24 16:08:55 +00:00
|
|
|
|
2011-06-13 21:53:23 +00:00
|
|
|
gboolean meta_window_updates_are_frozen (MetaWindow *window);
|
|
|
|
|
2013-08-30 07:40:36 +00:00
|
|
|
void meta_window_set_title (MetaWindow *window,
|
|
|
|
const char *title);
|
|
|
|
void meta_window_set_wm_class (MetaWindow *window,
|
|
|
|
const char *wm_class,
|
|
|
|
const char *wm_instance);
|
|
|
|
void meta_window_set_gtk_dbus_properties (MetaWindow *window,
|
|
|
|
const char *application_id,
|
|
|
|
const char *unique_bus_name,
|
|
|
|
const char *appmenu_path,
|
|
|
|
const char *menubar_path,
|
|
|
|
const char *application_object_path,
|
|
|
|
const char *window_object_path);
|
|
|
|
|
2019-11-26 22:06:09 +00:00
|
|
|
gboolean meta_window_has_transient_type (MetaWindow *window);
|
2021-12-11 02:04:24 +00:00
|
|
|
gboolean meta_window_has_modals (MetaWindow *window);
|
2019-11-26 22:06:09 +00:00
|
|
|
|
2013-09-16 12:44:37 +00:00
|
|
|
void meta_window_set_transient_for (MetaWindow *window,
|
|
|
|
MetaWindow *parent);
|
|
|
|
|
2013-12-06 18:44:31 +00:00
|
|
|
void meta_window_set_opacity (MetaWindow *window,
|
2014-04-10 06:41:22 +00:00
|
|
|
guint8 opacity);
|
2013-12-06 18:44:31 +00:00
|
|
|
|
2013-10-16 04:06:10 +00:00
|
|
|
void meta_window_handle_enter (MetaWindow *window,
|
|
|
|
guint32 timestamp,
|
|
|
|
guint root_x,
|
|
|
|
guint root_y);
|
2014-05-15 20:20:41 +00:00
|
|
|
void meta_window_handle_leave (MetaWindow *window);
|
2013-10-16 04:06:10 +00:00
|
|
|
|
2014-08-15 12:29:16 +00:00
|
|
|
void meta_window_handle_ungrabbed_event (MetaWindow *window,
|
|
|
|
const ClutterEvent *event);
|
2014-05-08 19:12:58 +00:00
|
|
|
|
2014-02-27 00:33:43 +00:00
|
|
|
void meta_window_get_client_area_rect (const MetaWindow *window,
|
|
|
|
cairo_rectangle_int_t *rect);
|
2014-05-22 20:48:58 +00:00
|
|
|
void meta_window_get_titlebar_rect (MetaWindow *window,
|
|
|
|
MetaRectangle *titlebar_rect);
|
2014-02-27 00:33:43 +00:00
|
|
|
|
2014-01-23 21:33:53 +00:00
|
|
|
void meta_window_activate_full (MetaWindow *window,
|
|
|
|
guint32 timestamp,
|
|
|
|
MetaClientType source_indication,
|
|
|
|
MetaWorkspace *workspace);
|
|
|
|
|
2020-04-02 14:11:09 +00:00
|
|
|
META_EXPORT_TEST
|
2022-08-03 20:55:56 +00:00
|
|
|
MetaLogicalMonitor * meta_window_find_monitor_from_frame_rect (MetaWindow *window);
|
2016-12-01 04:59:47 +00:00
|
|
|
|
2022-08-03 20:59:16 +00:00
|
|
|
MetaLogicalMonitor * meta_window_find_monitor_from_id (MetaWindow *window);
|
|
|
|
|
2016-12-02 07:38:08 +00:00
|
|
|
MetaLogicalMonitor * meta_window_get_main_logical_monitor (MetaWindow *window);
|
2023-03-06 05:43:13 +00:00
|
|
|
MetaLogicalMonitor * meta_window_get_highest_scale_monitor (MetaWindow *window);
|
2018-08-24 10:54:50 +00:00
|
|
|
void meta_window_update_monitor (MetaWindow *window,
|
|
|
|
MetaWindowUpdateMonitorFlags flags);
|
2014-03-18 14:36:00 +00:00
|
|
|
|
2022-01-28 23:02:24 +00:00
|
|
|
cairo_surface_t * meta_window_get_icon (MetaWindow *window);
|
|
|
|
|
|
|
|
cairo_surface_t * meta_window_get_mini_icon (MetaWindow *window);
|
|
|
|
|
2014-03-18 17:51:36 +00:00
|
|
|
void meta_window_set_urgent (MetaWindow *window,
|
|
|
|
gboolean urgent);
|
|
|
|
|
2014-04-28 21:44:45 +00:00
|
|
|
void meta_window_move_resize_internal (MetaWindow *window,
|
|
|
|
MetaMoveResizeFlags flags,
|
2020-02-14 08:44:43 +00:00
|
|
|
MetaGravity gravity,
|
2014-05-20 21:47:10 +00:00
|
|
|
MetaRectangle frame_rect);
|
2014-04-28 21:44:45 +00:00
|
|
|
|
2014-04-29 19:30:21 +00:00
|
|
|
void meta_window_grab_op_began (MetaWindow *window, MetaGrabOp op);
|
|
|
|
void meta_window_grab_op_ended (MetaWindow *window, MetaGrabOp op);
|
|
|
|
|
2014-05-20 18:48:08 +00:00
|
|
|
void meta_window_set_alive (MetaWindow *window, gboolean is_alive);
|
2021-09-03 21:38:12 +00:00
|
|
|
gboolean meta_window_get_alive (MetaWindow *window);
|
|
|
|
|
|
|
|
void meta_window_show_close_dialog (MetaWindow *window);
|
|
|
|
void meta_window_hide_close_dialog (MetaWindow *window);
|
|
|
|
void meta_window_ensure_close_dialog_timeout (MetaWindow *window);
|
2014-05-20 18:48:08 +00:00
|
|
|
|
2015-03-23 13:22:19 +00:00
|
|
|
void meta_window_emit_size_changed (MetaWindow *window);
|
|
|
|
|
2016-02-01 10:46:11 +00:00
|
|
|
MetaPlacementRule *meta_window_get_placement_rule (MetaWindow *window);
|
|
|
|
|
2017-06-21 11:30:22 +00:00
|
|
|
void meta_window_force_placement (MetaWindow *window,
|
|
|
|
gboolean force_move);
|
2016-02-01 10:46:11 +00:00
|
|
|
|
2017-03-17 12:34:52 +00:00
|
|
|
void meta_window_force_restore_shortcuts (MetaWindow *window,
|
|
|
|
ClutterInputDevice *source);
|
|
|
|
|
|
|
|
gboolean meta_window_shortcuts_inhibited (MetaWindow *window,
|
|
|
|
ClutterInputDevice *source);
|
2018-01-09 12:19:40 +00:00
|
|
|
gboolean meta_window_is_stackable (MetaWindow *window);
|
2021-02-11 16:53:59 +00:00
|
|
|
gboolean meta_window_is_focus_async (MetaWindow *window);
|
2021-08-05 14:35:18 +00:00
|
|
|
|
|
|
|
GFile *meta_window_get_unit_cgroup (MetaWindow *window);
|
|
|
|
gboolean meta_window_unit_cgroup_equal (MetaWindow *window1,
|
|
|
|
MetaWindow *window2);
|
2021-09-03 21:38:12 +00:00
|
|
|
|
|
|
|
void meta_window_check_alive_on_event (MetaWindow *window,
|
|
|
|
uint32_t timestamp);
|
|
|
|
|
2022-01-28 23:49:50 +00:00
|
|
|
void meta_window_update_visibility (MetaWindow *window);
|
|
|
|
|
|
|
|
void meta_window_clear_queued (MetaWindow *window);
|
|
|
|
|
|
|
|
void meta_window_update_layout (MetaWindow *window);
|
|
|
|
|
2021-12-17 20:42:35 +00:00
|
|
|
gboolean meta_window_calculate_bounds (MetaWindow *window,
|
|
|
|
int *bounds_width,
|
|
|
|
int *bounds_height);
|
|
|
|
|
x11: Integrate frames client into Mutter
Replace the in-process implementation of frames with the external
frames client.
When a client window is created and managed by Mutter, Mutter will
determine whether it is a window that requires decorations and
hint the creation of a frame for it by setting the _MUTTER_NEEDS_FRAME
property on the client window.
After the frames client created a window that has the _MUTTER_FRAME_FOR
property, Mutter will proceed to reparent the client window on the
frame window, and show them as a single unit.
Rendering and event handling on the frame window will be performed by
the external client, Mutter is still responsible for everything else,
namely resizing client and frame window in synchronization, and
managing updates on the MetaWindowActor.
In order to let the frame be managed by the external client, Mutter
needs to change the way some properties are forwarded to the client
and/or frame windows. Some properties are necessary to keep propagating
to the client window only, some others need to happen on the frame
window now, and some others needs to be propagated on both so they
are synchronized about the behavior.
Also, some events that were previously totally unexpected in frame
windows are now susceptible to happen, so must be allowed now.
MetaFrame in src/core/frame.c now acts as the wrapper of foreign
windows created by the frames client, from the Mutter side. Location,
size, and lifetime are still largely in control of Mutter, some
details like visible/invisible borders are obtained from the client
instead (through the _MUTTER_FRAME_EXTENTS and _GTK_FRAME_EXTENTS
properties, respectively).
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-09-08 08:35:47 +00:00
|
|
|
void meta_window_set_frame_xwindow (MetaWindow *window,
|
|
|
|
Window xframe);
|
|
|
|
|
2022-10-20 17:29:48 +00:00
|
|
|
void meta_window_maybe_apply_size_hints (MetaWindow *window,
|
|
|
|
MetaRectangle *target_rect);
|
2023-05-24 12:37:18 +00:00
|
|
|
|
|
|
|
void meta_window_inhibit_suspend_state (MetaWindow *window);
|
|
|
|
|
|
|
|
void meta_window_uninhibit_suspend_state (MetaWindow *window);
|
|
|
|
|
|
|
|
gboolean meta_window_is_suspended (MetaWindow *window);
|