1
0
Fork 0
mutter-performance-source/src/screen.h

140 lines
4.5 KiB
C
Raw Normal View History

2001-05-30 15:36:31 +00: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 18:33:59 +00:00
#include <X11/Xutil.h>
2001-06-18 03:24:25 +00:00
#include "ui.h"
2001-06-03 18:33:59 +00:00
typedef struct _MetaXineramaScreenInfo MetaXineramaScreenInfo;
struct _MetaXineramaScreenInfo
{
int number;
int x_origin;
int y_origin;
int width;
int height;
};
2001-06-03 18:33:59 +00:00
typedef void (* MetaScreenWindowFunc) (MetaScreen *screen, MetaWindow *window,
gpointer user_data);
2001-05-30 15:36:31 +00:00
typedef enum
{
META_SCREEN_TOPLEFT,
META_SCREEN_TOPRIGHT,
META_SCREEN_BOTTOMLEFT,
META_SCREEN_BOTTOMRIGHT
} MetaScreenCorner;
2001-05-30 15:36:31 +00:00
struct _MetaScreen
{
MetaDisplay *display;
int number;
2001-06-03 01:33:27 +00:00
char *screen_name;
2001-05-30 15:36:31 +00:00
Screen *xscreen;
Window xroot;
int default_depth;
Visual *default_xvisual;
2001-07-04 04:33:31 +00:00
int width;
int height;
2001-06-18 03:24:25 +00:00
MetaUI *ui;
MetaTabPopup *tab_popup;
2001-06-06 04:47:37 +00:00
MetaWorkspace *active_workspace;
2001-06-10 19:23:28 +00:00
MetaStack *stack;
2001-07-26 03:14:45 +00:00
MetaCursor current_cursor;
Window wm_sn_selection_window;
Atom wm_sn_atom;
Time wm_sn_timestamp;
MetaXineramaScreenInfo *xinerama_infos;
int n_xinerama_infos;
/* Cache the current Xinerama */
int last_xinerama_index;
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 05:41:13 +00:00
guint work_area_idle;
int rows_of_workspaces;
int columns_of_workspaces;
MetaScreenCorner starting_corner;
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 05:41:13 +00:00
guint keys_grabbed : 1;
guint all_keys_grabbed : 1;
int closing;
2001-05-30 15:36:31 +00:00
};
2001-06-03 18:33:59 +00: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-20 03:01:26 +00:00
void meta_screen_queue_window_resizes (MetaScreen *screen);
2001-05-30 15:36:31 +00:00
2001-06-09 05:14:43 +00:00
int meta_screen_get_n_workspaces (MetaScreen *screen);
2001-07-26 03:14:45 +00:00
void meta_screen_set_cursor (MetaScreen *screen,
MetaCursor cursor);
2001-06-09 05:14:43 +00:00
void meta_screen_ensure_tab_popup (MetaScreen *screen,
MetaTabList type);
void meta_screen_ensure_workspace_popup (MetaScreen *screen);
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 05:41:13 +00:00
const MetaXineramaScreenInfo* meta_screen_get_current_xinerama (MetaScreen *screen);
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 05:41:13 +00:00
void meta_screen_update_workspace_layout (MetaScreen *screen);
void meta_screen_update_workspace_names (MetaScreen *screen);
void meta_screen_queue_workarea_recalc (MetaScreen *screen);
Window meta_create_offscreen_window (Display *xdisplay,
Window parent);
void meta_screen_calc_workspace_layout (MetaScreen *screen,
int num_workspaces,
int *r,
int *c);
void meta_screen_resize (MetaScreen *screen,
int width,
int height);
2001-05-30 15:36:31 +00:00
#endif