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;
|
|
|
|
|
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
|
|
|
|
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;
|
2001-05-30 11:36:31 -04:00
|
|
|
};
|
|
|
|
|
2001-06-03 14:33:59 -04:00
|
|
|
MetaScreen* meta_screen_new (MetaDisplay *display,
|
|
|
|
int number);
|
|
|
|
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);
|
|
|
|
|
2002-01-03 18:28:19 -05:00
|
|
|
void meta_screen_focus_top_window (MetaScreen *screen,
|
|
|
|
MetaWindow *not_this_one);
|
|
|
|
|
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
|
|
|
const MetaXineramaScreenInfo* meta_screen_get_current_xinerama (MetaScreen *screen);
|
2002-05-25 12:30:14 -04:00
|
|
|
const MetaXineramaScreenInfo* meta_screen_get_xinerama_for_window (MetaScreen *screen,
|
|
|
|
MetaWindow *window);
|
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);
|
|
|
|
|
|
|
|
|
2002-10-16 16:12:24 -04:00
|
|
|
/* Show/hide the desktop (temporarily hide all windows) */
|
|
|
|
void meta_screen_show_desktop (MetaScreen *screen);
|
|
|
|
void meta_screen_unshow_desktop (MetaScreen *screen);
|
|
|
|
|
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
|