2001-05-30 11:36:31 -04:00
|
|
|
/* Metacity X screen handler */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2001 Havoc Pennington
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef META_SCREEN_H
|
|
|
|
#define META_SCREEN_H
|
|
|
|
|
|
|
|
#include "display.h"
|
2001-06-03 14:33:59 -04:00
|
|
|
#include <X11/Xutil.h>
|
2001-06-17 23:24:25 -04:00
|
|
|
#include "ui.h"
|
2001-06-03 14:33:59 -04:00
|
|
|
|
2002-04-21 15:35:02 -04:00
|
|
|
typedef struct _MetaXineramaScreenInfo MetaXineramaScreenInfo;
|
|
|
|
|
|
|
|
struct _MetaXineramaScreenInfo
|
|
|
|
{
|
|
|
|
int number;
|
|
|
|
int x_origin;
|
|
|
|
int y_origin;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
};
|
|
|
|
|
2001-06-03 14:33:59 -04:00
|
|
|
typedef void (* MetaScreenWindowFunc) (MetaScreen *screen, MetaWindow *window,
|
|
|
|
gpointer user_data);
|
2001-05-30 11:36:31 -04:00
|
|
|
|
2002-10-01 15:57:26 -04:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_SCREEN_TOPLEFT,
|
|
|
|
META_SCREEN_TOPRIGHT,
|
|
|
|
META_SCREEN_BOTTOMLEFT,
|
|
|
|
META_SCREEN_BOTTOMRIGHT
|
|
|
|
} MetaScreenCorner;
|
|
|
|
|
2003-04-06 00:57:36 -05:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_SCREEN_UP,
|
|
|
|
META_SCREEN_DOWN,
|
|
|
|
META_SCREEN_LEFT,
|
|
|
|
META_SCREEN_RIGHT
|
|
|
|
} MetaScreenDirection;
|
|
|
|
|
2003-10-12 02:25:38 -04:00
|
|
|
#define META_WIREFRAME_XOR_LINE_WIDTH 5
|
|
|
|
|
2001-05-30 11:36:31 -04:00
|
|
|
struct _MetaScreen
|
|
|
|
{
|
|
|
|
MetaDisplay *display;
|
|
|
|
int number;
|
2001-06-02 21:33:27 -04:00
|
|
|
char *screen_name;
|
2001-05-30 11:36:31 -04:00
|
|
|
Screen *xscreen;
|
|
|
|
Window xroot;
|
2001-09-08 23:44:42 -04:00
|
|
|
int default_depth;
|
|
|
|
Visual *default_xvisual;
|
2001-07-04 00:33:31 -04:00
|
|
|
int width;
|
|
|
|
int height;
|
2001-06-17 23:24:25 -04:00
|
|
|
MetaUI *ui;
|
2001-08-19 14:09:10 -04:00
|
|
|
MetaTabPopup *tab_popup;
|
|
|
|
|
2001-06-06 00:47:37 -04:00
|
|
|
MetaWorkspace *active_workspace;
|
2001-06-10 15:23:28 -04:00
|
|
|
|
2002-10-16 16:12:24 -04:00
|
|
|
GList *workspaces;
|
|
|
|
|
2001-06-10 15:23:28 -04:00
|
|
|
MetaStack *stack;
|
2001-07-25 23:14:45 -04:00
|
|
|
|
|
|
|
MetaCursor current_cursor;
|
2002-04-21 15:35:02 -04:00
|
|
|
|
2003-01-28 10:07:43 -05:00
|
|
|
Window flash_window;
|
|
|
|
|
2002-06-08 19:55:27 -04:00
|
|
|
Window wm_sn_selection_window;
|
|
|
|
Atom wm_sn_atom;
|
|
|
|
Time wm_sn_timestamp;
|
|
|
|
|
2002-04-21 15:35:02 -04:00
|
|
|
MetaXineramaScreenInfo *xinerama_infos;
|
|
|
|
int n_xinerama_infos;
|
2002-04-28 00:52:26 -04:00
|
|
|
|
2002-06-06 23:18:46 -04:00
|
|
|
/* Cache the current Xinerama */
|
|
|
|
int last_xinerama_index;
|
2002-10-25 19:35:50 -04:00
|
|
|
|
|
|
|
#ifdef HAVE_STARTUP_NOTIFICATION
|
|
|
|
SnMonitorContext *sn_context;
|
|
|
|
GSList *startup_sequences;
|
|
|
|
guint startup_sequence_timeout;
|
|
|
|
#endif
|
2002-06-06 23:18:46 -04:00
|
|
|
|
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
|
|
|
guint work_area_idle;
|
2002-05-16 00:03:36 -04:00
|
|
|
|
|
|
|
int rows_of_workspaces;
|
|
|
|
int columns_of_workspaces;
|
2002-10-01 15:57:26 -04:00
|
|
|
MetaScreenCorner starting_corner;
|
2002-05-16 00:03:36 -04:00
|
|
|
guint vertical_workspaces : 1;
|
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
|
|
|
|
2002-04-28 00:52:26 -04:00
|
|
|
guint keys_grabbed : 1;
|
2002-06-27 01:08:32 -04:00
|
|
|
guint all_keys_grabbed : 1;
|
2002-10-16 16:12:24 -04:00
|
|
|
guint showing_desktop : 1;
|
|
|
|
|
2002-06-22 01:11:04 -04:00
|
|
|
int closing;
|
2003-10-12 02:25:38 -04:00
|
|
|
|
|
|
|
/* gc for XOR on root window */
|
|
|
|
GC root_xor_gc;
|
2003-11-23 13:16:01 -05:00
|
|
|
|
|
|
|
/* Managed by compositor.c; top of stack is first in list */
|
|
|
|
GList *compositor_windows;
|
|
|
|
XID root_picture;
|
|
|
|
XID damage_region;
|
2003-11-29 22:30:27 -05:00
|
|
|
XID trans_pixmap;
|
|
|
|
XID trans_picture;
|
2001-05-30 11:36:31 -04:00
|
|
|
};
|
|
|
|
|
2001-06-03 14:33:59 -04:00
|
|
|
MetaScreen* meta_screen_new (MetaDisplay *display,
|
2003-11-24 12:47:48 -05:00
|
|
|
int number,
|
|
|
|
Time timestamp);
|
2001-06-03 14:33:59 -04:00
|
|
|
void meta_screen_free (MetaScreen *screen);
|
|
|
|
void meta_screen_manage_all_windows (MetaScreen *screen);
|
|
|
|
MetaScreen* meta_screen_for_x_screen (Screen *xscreen);
|
|
|
|
void meta_screen_foreach_window (MetaScreen *screen,
|
|
|
|
MetaScreenWindowFunc func,
|
|
|
|
gpointer data);
|
|
|
|
void meta_screen_queue_frame_redraws (MetaScreen *screen);
|
2001-06-19 23:01:26 -04:00
|
|
|
void meta_screen_queue_window_resizes (MetaScreen *screen);
|
2001-05-30 11:36:31 -04:00
|
|
|
|
2001-06-09 01:14:43 -04:00
|
|
|
int meta_screen_get_n_workspaces (MetaScreen *screen);
|
|
|
|
|
2002-10-16 16:12:24 -04:00
|
|
|
MetaWorkspace* meta_screen_get_workspace_by_index (MetaScreen *screen,
|
|
|
|
int index);
|
|
|
|
|
2001-07-25 23:14:45 -04:00
|
|
|
void meta_screen_set_cursor (MetaScreen *screen,
|
|
|
|
MetaCursor cursor);
|
2001-06-09 01:14:43 -04:00
|
|
|
|
2002-04-05 10:52:49 -05:00
|
|
|
void meta_screen_ensure_tab_popup (MetaScreen *screen,
|
|
|
|
MetaTabList type);
|
2001-08-19 14:09:10 -04:00
|
|
|
|
2002-06-22 01:11:04 -04:00
|
|
|
void meta_screen_ensure_workspace_popup (MetaScreen *screen);
|
|
|
|
|
2003-01-21 23:54:04 -05:00
|
|
|
void meta_screen_focus_mouse_window (MetaScreen *screen,
|
|
|
|
MetaWindow *not_this_one);
|
2003-02-23 12:09:46 -05:00
|
|
|
|
|
|
|
const MetaXineramaScreenInfo* meta_screen_get_current_xinerama (MetaScreen *screen);
|
|
|
|
const MetaXineramaScreenInfo* meta_screen_get_xinerama_for_rect (MetaScreen *screen,
|
|
|
|
MetaRectangle *rect);
|
|
|
|
const MetaXineramaScreenInfo* meta_screen_get_xinerama_for_window (MetaScreen *screen,
|
|
|
|
MetaWindow *window);
|
|
|
|
|
2003-06-25 23:09:38 -04:00
|
|
|
gboolean meta_screen_rect_intersects_xinerama (MetaScreen *screen,
|
|
|
|
MetaRectangle *window,
|
|
|
|
int which_xinerama);
|
2003-02-23 12:09:46 -05:00
|
|
|
|
2003-04-06 00:57:36 -05:00
|
|
|
const MetaXineramaScreenInfo* meta_screen_get_xinerama_neighbor (MetaScreen *screen,
|
|
|
|
int which_xinerama,
|
|
|
|
MetaScreenDirection dir);
|
|
|
|
void meta_screen_get_natural_xinerama_list (MetaScreen *screen,
|
|
|
|
int** xineramas_list,
|
|
|
|
int* n_xineramas);
|
on unminimize, queue calc_showing on all transients
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-05-05 01:41:13 -04:00
|
|
|
|
2002-05-16 00:03:36 -04:00
|
|
|
void meta_screen_update_workspace_layout (MetaScreen *screen);
|
2002-06-22 00:52:35 -04:00
|
|
|
void meta_screen_update_workspace_names (MetaScreen *screen);
|
2002-06-24 21:12:37 -04:00
|
|
|
void meta_screen_queue_workarea_recalc (MetaScreen *screen);
|
2002-05-16 00:03:36 -04:00
|
|
|
|
2002-06-08 23:44:16 -04:00
|
|
|
Window meta_create_offscreen_window (Display *xdisplay,
|
|
|
|
Window parent);
|
|
|
|
|
2003-01-05 13:36:01 -05:00
|
|
|
typedef struct MetaWorkspaceLayout MetaWorkspaceLayout;
|
|
|
|
|
|
|
|
struct MetaWorkspaceLayout
|
|
|
|
{
|
|
|
|
int rows;
|
|
|
|
int cols;
|
|
|
|
int *grid;
|
|
|
|
int grid_area;
|
|
|
|
int current_row;
|
|
|
|
int current_col;
|
|
|
|
};
|
|
|
|
|
|
|
|
void meta_screen_calc_workspace_layout (MetaScreen *screen,
|
|
|
|
int num_workspaces,
|
|
|
|
int current_space,
|
|
|
|
MetaWorkspaceLayout *layout);
|
|
|
|
void meta_screen_free_workspace_layout (MetaWorkspaceLayout *layout);
|
2002-06-22 01:11:04 -04:00
|
|
|
|
2002-09-28 22:50:24 -04:00
|
|
|
void meta_screen_resize (MetaScreen *screen,
|
|
|
|
int width,
|
|
|
|
int height);
|
|
|
|
|
2003-05-16 17:59:08 -04:00
|
|
|
void meta_screen_minimize_all_except (MetaScreen *screen,
|
|
|
|
MetaWindow *keep);
|
2002-09-28 22:50:24 -04:00
|
|
|
|
2002-10-16 16:12:24 -04:00
|
|
|
/* Show/hide the desktop (temporarily hide all windows) */
|
2003-05-16 17:59:08 -04:00
|
|
|
void meta_screen_show_desktop (MetaScreen *screen);
|
|
|
|
void meta_screen_unshow_desktop (MetaScreen *screen);
|
2002-10-16 16:12:24 -04:00
|
|
|
|
2002-11-30 22:58:04 -05:00
|
|
|
void meta_screen_apply_startup_properties (MetaScreen *screen,
|
|
|
|
MetaWindow *window);
|
|
|
|
|
2002-10-16 16:12:24 -04:00
|
|
|
|
2001-05-30 11:36:31 -04:00
|
|
|
#endif
|