2008-05-18 20:00:09 -04:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2008 Iain Holmes
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2014-01-11 20:42:06 -05:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2008-05-18 20:00:09 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef META_WINDOW_H
|
|
|
|
#define META_WINDOW_H
|
|
|
|
|
2008-11-07 04:57:00 -05:00
|
|
|
#include <glib-object.h>
|
2011-03-22 15:36:12 -04:00
|
|
|
#include <cairo.h>
|
2008-05-18 20:00:09 -04:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
|
2011-03-05 19:29:12 -05:00
|
|
|
#include <meta/boxes.h>
|
|
|
|
#include <meta/types.h>
|
2008-05-18 20:00:09 -04:00
|
|
|
|
2013-02-15 13:42:08 -05:00
|
|
|
/**
|
|
|
|
* MetaWindowType:
|
|
|
|
* @META_WINDOW_NORMAL: Normal
|
|
|
|
* @META_WINDOW_DESKTOP: Desktop
|
|
|
|
* @META_WINDOW_DOCK: Dock
|
|
|
|
* @META_WINDOW_DIALOG: Dialog
|
|
|
|
* @META_WINDOW_MODAL_DIALOG: Modal dialog
|
|
|
|
* @META_WINDOW_TOOLBAR: Toolbar
|
|
|
|
* @META_WINDOW_MENU: Menu
|
|
|
|
* @META_WINDOW_UTILITY: Utility
|
|
|
|
* @META_WINDOW_SPLASHSCREEN: Splashcreen
|
|
|
|
* @META_WINDOW_DROPDOWN_MENU: Dropdown menu
|
|
|
|
* @META_WINDOW_POPUP_MENU: Popup menu
|
|
|
|
* @META_WINDOW_TOOLTIP: Tooltip
|
|
|
|
* @META_WINDOW_NOTIFICATION: Notification
|
|
|
|
* @META_WINDOW_COMBO: Combobox
|
|
|
|
* @META_WINDOW_DND: Drag and drop
|
|
|
|
* @META_WINDOW_OVERRIDE_OTHER: Other override-redirect window type
|
|
|
|
*/
|
2008-08-18 10:42:38 -04:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_WINDOW_NORMAL,
|
|
|
|
META_WINDOW_DESKTOP,
|
|
|
|
META_WINDOW_DOCK,
|
|
|
|
META_WINDOW_DIALOG,
|
|
|
|
META_WINDOW_MODAL_DIALOG,
|
|
|
|
META_WINDOW_TOOLBAR,
|
|
|
|
META_WINDOW_MENU,
|
|
|
|
META_WINDOW_UTILITY,
|
|
|
|
META_WINDOW_SPLASHSCREEN,
|
2008-11-23 14:28:40 -05:00
|
|
|
|
|
|
|
/* override redirect window types: */
|
|
|
|
META_WINDOW_DROPDOWN_MENU,
|
|
|
|
META_WINDOW_POPUP_MENU,
|
|
|
|
META_WINDOW_TOOLTIP,
|
|
|
|
META_WINDOW_NOTIFICATION,
|
|
|
|
META_WINDOW_COMBO,
|
|
|
|
META_WINDOW_DND,
|
|
|
|
META_WINDOW_OVERRIDE_OTHER
|
2008-08-18 10:42:38 -04:00
|
|
|
} MetaWindowType;
|
|
|
|
|
2013-02-15 13:42:08 -05:00
|
|
|
/**
|
|
|
|
* MetaMaximizeFlags:
|
|
|
|
* @META_MAXIMIZE_HORIZONTAL: Horizontal
|
|
|
|
* @META_MAXIMIZE_VERTICAL: Vertical
|
2014-03-13 18:32:20 -04:00
|
|
|
* @META_MAXIMIZE_BOTH: Both
|
2013-02-15 13:42:08 -05:00
|
|
|
*/
|
2008-09-18 11:09:11 -04:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_MAXIMIZE_HORIZONTAL = 1 << 0,
|
2014-03-13 18:32:20 -04:00
|
|
|
META_MAXIMIZE_VERTICAL = 1 << 1,
|
|
|
|
META_MAXIMIZE_BOTH = (1 << 0 | 1 << 1),
|
2008-09-18 11:09:11 -04:00
|
|
|
} MetaMaximizeFlags;
|
|
|
|
|
2012-04-05 06:22:13 -04:00
|
|
|
/**
|
|
|
|
* MetaWindowClientType:
|
|
|
|
* @META_WINDOW_CLIENT_TYPE_WAYLAND: A Wayland based window
|
|
|
|
* @META_WINDOW_CLIENT_TYPE_X11: An X11 based window
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
META_WINDOW_CLIENT_TYPE_WAYLAND,
|
|
|
|
META_WINDOW_CLIENT_TYPE_X11
|
|
|
|
} MetaWindowClientType;
|
|
|
|
|
2008-11-07 04:57:00 -05:00
|
|
|
#define META_TYPE_WINDOW (meta_window_get_type ())
|
|
|
|
#define META_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_WINDOW, MetaWindow))
|
|
|
|
#define META_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_WINDOW, MetaWindowClass))
|
2009-06-10 00:43:43 -04:00
|
|
|
#define META_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_WINDOW))
|
2008-11-07 04:57:00 -05:00
|
|
|
#define META_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_WINDOW))
|
|
|
|
#define META_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_WINDOW, MetaWindowClass))
|
|
|
|
|
|
|
|
typedef struct _MetaWindowClass MetaWindowClass;
|
|
|
|
|
|
|
|
GType meta_window_get_type (void);
|
|
|
|
|
2008-05-18 20:00:09 -04:00
|
|
|
MetaFrame *meta_window_get_frame (MetaWindow *window);
|
|
|
|
gboolean meta_window_has_focus (MetaWindow *window);
|
2010-11-11 16:04:31 -05:00
|
|
|
gboolean meta_window_appears_focused (MetaWindow *window);
|
2008-05-18 20:00:09 -04:00
|
|
|
gboolean meta_window_is_shaded (MetaWindow *window);
|
2009-08-14 05:42:56 -04:00
|
|
|
gboolean meta_window_is_override_redirect (MetaWindow *window);
|
2009-08-28 12:39:55 -04:00
|
|
|
gboolean meta_window_is_skip_taskbar (MetaWindow *window);
|
window: Rename get_input_rect to get_buffer_rect
With get_input_region existing, get_input_rect is a misnomer. Really,
it's about the geometry of the output surface, and it's only used that
way in the compositor code.
Way back when in GNOME 3.2, get_input_rect was added when we added
invisible borders. get_outer_rect was always synonymous with server-side
geometry of the toplevel. get_outer_rect was used for both user-side
policy (the "frame rect") and to get the geometry of the window.
Invisible borders were meant to extend the input region of the frame
window silently. Since most users of get_outer_rect cared about the
frame rect, we kept that the same and added a new method, get_input_rect
to get the full rect of the framed window with all invisible borders for
input kept on.
As time went on and CSD and Wayland became a reality, the relationship
between the server-side geometry and the "frame rect" became more
complicated, as can be evidenced by the recent commits. Since clients
don't tend to be framed anymore, they set their own input region.
get_buffer_rect is also sort of a poor name, since X11 doesn't really
have buffers, but we don't really have many other alternatives.
This doesn't change any of the code, nor the meaning. It will always
refer to the rectangle where the toplevel should be placed.
2014-06-17 10:33:52 -04:00
|
|
|
void meta_window_get_buffer_rect (const MetaWindow *window, MetaRectangle *rect);
|
2013-11-19 12:24:45 -05:00
|
|
|
|
|
|
|
void meta_window_get_frame_rect (const MetaWindow *window, MetaRectangle *rect);
|
2013-11-15 16:11:20 -05:00
|
|
|
|
|
|
|
void meta_window_client_rect_to_frame_rect (MetaWindow *window,
|
2013-11-29 07:52:18 -05:00
|
|
|
MetaRectangle *client_rect,
|
|
|
|
MetaRectangle *frame_rect);
|
2013-11-15 16:11:20 -05:00
|
|
|
void meta_window_frame_rect_to_client_rect (MetaWindow *window,
|
|
|
|
MetaRectangle *frame_rect,
|
|
|
|
MetaRectangle *client_rect);
|
|
|
|
|
2008-05-18 20:00:09 -04:00
|
|
|
MetaDisplay *meta_window_get_display (MetaWindow *window);
|
|
|
|
Window meta_window_get_xwindow (MetaWindow *window);
|
2008-11-07 04:57:00 -05:00
|
|
|
MetaWindowType meta_window_get_window_type (MetaWindow *window);
|
2008-09-18 11:09:11 -04:00
|
|
|
MetaWorkspace *meta_window_get_workspace (MetaWindow *window);
|
2011-02-28 09:21:35 -05:00
|
|
|
int meta_window_get_monitor (MetaWindow *window);
|
2008-09-18 11:09:11 -04:00
|
|
|
gboolean meta_window_is_on_all_workspaces (MetaWindow *window);
|
2013-01-14 12:34:14 -05:00
|
|
|
gboolean meta_window_located_on_workspace (MetaWindow *window,
|
|
|
|
MetaWorkspace *workspace);
|
2008-10-24 05:07:24 -04:00
|
|
|
gboolean meta_window_is_hidden (MetaWindow *window);
|
|
|
|
void meta_window_activate (MetaWindow *window,guint32 current_time);
|
|
|
|
void meta_window_activate_with_workspace (MetaWindow *window,
|
|
|
|
guint32 current_time,
|
|
|
|
MetaWorkspace *workspace);
|
2008-10-30 04:30:42 -04:00
|
|
|
const char * meta_window_get_description (MetaWindow *window);
|
2009-05-29 13:26:18 -04:00
|
|
|
const char * meta_window_get_wm_class (MetaWindow *window);
|
2010-03-17 05:20:39 -04:00
|
|
|
const char * meta_window_get_wm_class_instance (MetaWindow *window);
|
2008-11-03 09:45:28 -05:00
|
|
|
gboolean meta_window_showing_on_its_workspace (MetaWindow *window);
|
|
|
|
|
2017-10-20 22:45:23 -04:00
|
|
|
const char * meta_window_get_sandboxed_app_id (MetaWindow *window);
|
2014-05-25 10:57:15 -04:00
|
|
|
const char * meta_window_get_gtk_theme_variant (MetaWindow *window);
|
2012-01-17 13:27:10 -05:00
|
|
|
const char * meta_window_get_gtk_application_id (MetaWindow *window);
|
|
|
|
const char * meta_window_get_gtk_unique_bus_name (MetaWindow *window);
|
|
|
|
const char * meta_window_get_gtk_application_object_path (MetaWindow *window);
|
|
|
|
const char * meta_window_get_gtk_window_object_path (MetaWindow *window);
|
|
|
|
const char * meta_window_get_gtk_app_menu_object_path (MetaWindow *window);
|
|
|
|
const char * meta_window_get_gtk_menubar_object_path (MetaWindow *window);
|
2011-11-25 18:42:41 -05:00
|
|
|
|
2011-03-09 10:01:44 -05:00
|
|
|
void meta_window_move_frame(MetaWindow *window, gboolean user_op, int root_x_nw, int root_y_nw);
|
2011-06-04 21:02:44 -04:00
|
|
|
void meta_window_move_resize_frame (MetaWindow *window, gboolean user_op, int root_x_nw, int root_y_nw, int w, int h);
|
2011-03-21 07:36:01 -04:00
|
|
|
void meta_window_move_to_monitor (MetaWindow *window, int monitor);
|
2011-03-09 10:01:44 -05:00
|
|
|
|
2010-04-17 14:45:14 -04:00
|
|
|
void meta_window_set_demands_attention (MetaWindow *window);
|
|
|
|
void meta_window_unset_demands_attention (MetaWindow *window);
|
|
|
|
|
2008-11-19 07:30:45 -05:00
|
|
|
const char* meta_window_get_startup_id (MetaWindow *window);
|
2008-11-20 04:14:58 -05:00
|
|
|
void meta_window_change_workspace_by_index (MetaWindow *window,
|
|
|
|
gint space_index,
|
2013-10-09 15:36:51 -04:00
|
|
|
gboolean append);
|
2012-04-14 09:12:48 -04:00
|
|
|
void meta_window_change_workspace (MetaWindow *window,
|
|
|
|
MetaWorkspace *workspace);
|
2009-02-02 15:16:05 -05:00
|
|
|
GObject *meta_window_get_compositor_private (MetaWindow *window);
|
|
|
|
void meta_window_set_compositor_private (MetaWindow *window, GObject *priv);
|
2009-01-12 07:30:31 -05:00
|
|
|
const char *meta_window_get_role (MetaWindow *window);
|
2009-03-12 17:07:27 -04:00
|
|
|
MetaStackLayer meta_window_get_layer (MetaWindow *window);
|
2009-03-19 12:01:32 -04:00
|
|
|
MetaWindow* meta_window_find_root_ancestor (MetaWindow *window);
|
2009-08-04 03:32:36 -04:00
|
|
|
gboolean meta_window_is_ancestor_of_transient (MetaWindow *window,
|
|
|
|
MetaWindow *transient);
|
2010-04-24 17:19:25 -04:00
|
|
|
|
|
|
|
typedef gboolean (*MetaWindowForeachFunc) (MetaWindow *window,
|
2012-11-16 15:23:47 -05:00
|
|
|
void *user_data);
|
2010-04-24 17:19:25 -04:00
|
|
|
|
|
|
|
void meta_window_foreach_transient (MetaWindow *window,
|
|
|
|
MetaWindowForeachFunc func,
|
|
|
|
void *user_data);
|
|
|
|
void meta_window_foreach_ancestor (MetaWindow *window,
|
|
|
|
MetaWindowForeachFunc func,
|
|
|
|
void *user_data);
|
|
|
|
|
2010-11-11 18:42:44 -05:00
|
|
|
MetaMaximizeFlags meta_window_get_maximized (MetaWindow *window);
|
|
|
|
gboolean meta_window_is_fullscreen (MetaWindow *window);
|
2013-02-18 07:30:37 -05:00
|
|
|
gboolean meta_window_is_screen_sized (MetaWindow *window);
|
2013-02-17 15:12:45 -05:00
|
|
|
gboolean meta_window_is_monitor_sized (MetaWindow *window);
|
2011-03-09 07:04:18 -05:00
|
|
|
gboolean meta_window_is_on_primary_monitor (MetaWindow *window);
|
2012-08-30 02:40:18 -04:00
|
|
|
gboolean meta_window_requested_bypass_compositor (MetaWindow *window);
|
|
|
|
gboolean meta_window_requested_dont_bypass_compositor (MetaWindow *window);
|
2010-11-11 18:42:44 -05:00
|
|
|
|
2009-03-31 17:29:48 -04:00
|
|
|
gboolean meta_window_get_icon_geometry (MetaWindow *window,
|
|
|
|
MetaRectangle *rect);
|
2013-01-22 19:11:23 -05:00
|
|
|
void meta_window_set_icon_geometry (MetaWindow *window,
|
|
|
|
MetaRectangle *rect);
|
2009-04-27 08:21:39 -04:00
|
|
|
void meta_window_maximize (MetaWindow *window,
|
|
|
|
MetaMaximizeFlags directions);
|
|
|
|
void meta_window_unmaximize (MetaWindow *window,
|
|
|
|
MetaMaximizeFlags directions);
|
2009-06-10 00:14:19 -04:00
|
|
|
void meta_window_minimize (MetaWindow *window);
|
|
|
|
void meta_window_unminimize (MetaWindow *window);
|
2010-04-23 08:58:36 -04:00
|
|
|
void meta_window_raise (MetaWindow *window);
|
|
|
|
void meta_window_lower (MetaWindow *window);
|
2009-06-09 23:02:14 -04:00
|
|
|
const char *meta_window_get_title (MetaWindow *window);
|
2009-06-09 23:28:21 -04:00
|
|
|
MetaWindow *meta_window_get_transient_for (MetaWindow *window);
|
2009-06-18 05:08:34 -04:00
|
|
|
void meta_window_delete (MetaWindow *window,
|
|
|
|
guint32 timestamp);
|
2009-09-18 20:50:11 -04:00
|
|
|
guint meta_window_get_stable_sequence (MetaWindow *window);
|
2009-08-30 20:04:48 -04:00
|
|
|
guint32 meta_window_get_user_time (MetaWindow *window);
|
2009-07-31 13:52:25 -04:00
|
|
|
int meta_window_get_pid (MetaWindow *window);
|
|
|
|
const char *meta_window_get_client_machine (MetaWindow *window);
|
2010-06-04 13:57:41 -04:00
|
|
|
gboolean meta_window_is_remote (MetaWindow *window);
|
window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.
Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).
Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-04-05 10:14:52 -04:00
|
|
|
gboolean meta_window_is_attached_dialog (MetaWindow *window);
|
2010-01-18 05:12:17 -05:00
|
|
|
const char *meta_window_get_mutter_hints (MetaWindow *window);
|
2010-11-11 16:12:11 -05:00
|
|
|
|
|
|
|
MetaFrameType meta_window_get_frame_type (MetaWindow *window);
|
|
|
|
|
2011-03-22 15:36:12 -04:00
|
|
|
cairo_region_t *meta_window_get_frame_bounds (MetaWindow *window);
|
|
|
|
|
2016-01-10 09:16:09 -05:00
|
|
|
MetaWindow *meta_window_get_tile_match (MetaWindow *window);
|
|
|
|
|
2012-06-14 16:13:29 -04:00
|
|
|
void meta_window_make_fullscreen (MetaWindow *window);
|
|
|
|
void meta_window_unmake_fullscreen (MetaWindow *window);
|
|
|
|
void meta_window_make_above (MetaWindow *window);
|
|
|
|
void meta_window_unmake_above (MetaWindow *window);
|
|
|
|
void meta_window_shade (MetaWindow *window,
|
|
|
|
guint32 timestamp);
|
|
|
|
void meta_window_unshade (MetaWindow *window,
|
|
|
|
guint32 timestamp);
|
|
|
|
void meta_window_stick (MetaWindow *window);
|
|
|
|
void meta_window_unstick (MetaWindow *window);
|
|
|
|
|
|
|
|
void meta_window_kill (MetaWindow *window);
|
|
|
|
void meta_window_focus (MetaWindow *window,
|
|
|
|
guint32 timestamp);
|
|
|
|
|
2012-12-24 12:15:23 -05:00
|
|
|
void meta_window_check_alive (MetaWindow *window,
|
|
|
|
guint32 timestamp);
|
|
|
|
|
2013-01-27 23:08:17 -05:00
|
|
|
void meta_window_get_work_area_current_monitor (MetaWindow *window,
|
|
|
|
MetaRectangle *area);
|
|
|
|
void meta_window_get_work_area_for_monitor (MetaWindow *window,
|
|
|
|
int which_monitor,
|
|
|
|
MetaRectangle *area);
|
|
|
|
void meta_window_get_work_area_all_monitors (MetaWindow *window,
|
|
|
|
MetaRectangle *area);
|
|
|
|
|
2012-06-14 16:13:29 -04:00
|
|
|
void meta_window_begin_grab_op (MetaWindow *window,
|
|
|
|
MetaGrabOp op,
|
|
|
|
gboolean frame_action,
|
|
|
|
guint32 timestamp);
|
|
|
|
|
2014-03-13 18:15:26 -04:00
|
|
|
gboolean meta_window_can_maximize (MetaWindow *window);
|
|
|
|
gboolean meta_window_can_minimize (MetaWindow *window);
|
|
|
|
gboolean meta_window_can_shade (MetaWindow *window);
|
2013-04-26 11:33:11 -04:00
|
|
|
gboolean meta_window_can_close (MetaWindow *window);
|
2014-03-13 18:15:26 -04:00
|
|
|
gboolean meta_window_is_always_on_all_workspaces (MetaWindow *window);
|
|
|
|
gboolean meta_window_is_above (MetaWindow *window);
|
|
|
|
gboolean meta_window_allows_move (MetaWindow *window);
|
|
|
|
gboolean meta_window_allows_resize (MetaWindow *window);
|
2014-07-08 05:40:02 -04:00
|
|
|
gboolean meta_window_is_client_decorated (MetaWindow *window);
|
2013-04-26 11:33:11 -04:00
|
|
|
|
2014-03-14 10:51:34 -04:00
|
|
|
gboolean meta_window_titlebar_is_onscreen (MetaWindow *window);
|
|
|
|
void meta_window_shove_titlebar_onscreen (MetaWindow *window);
|
|
|
|
|
2008-05-18 20:00:09 -04:00
|
|
|
#endif
|