2006-10-01 18:30:10 -04:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
2001-05-30 11:36:31 -04:00
|
|
|
/* Metacity X screen handler */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2001 Havoc Pennington
|
2004-02-27 20:48:27 -05:00
|
|
|
* Copyright (C) 2003 Rob Adams
|
2006-01-10 14:43:21 -05:00
|
|
|
* Copyright (C) 2004-2006 Elijah Newren
|
2001-05-30 11:36:31 -04: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.
|
|
|
|
*
|
|
|
|
* 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;
|
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 09:58:50 -05:00
|
|
|
MetaRectangle rect;
|
2002-04-21 15:35:02 -04:00
|
|
|
};
|
|
|
|
|
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;
|
|
|
|
|
2005-11-29 16:36:12 -05:00
|
|
|
#define META_WIREFRAME_XOR_LINE_WIDTH 2
|
2003-10-12 02:25:38 -04:00
|
|
|
|
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;
|
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 09:58:50 -05:00
|
|
|
MetaRectangle rect; /* Size of screen; rect.x & rect.y are always 0 */
|
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
|
|
|
|
2005-12-28 01:24:30 -05:00
|
|
|
/* This window holds the focus when we don't want to focus
|
|
|
|
* any actual clients
|
|
|
|
*/
|
|
|
|
Window no_focus_window;
|
|
|
|
|
2002-10-16 16:12:24 -04:00
|
|
|
GList *workspaces;
|
Make the "showing desktop" mode be per-workspace instead of per-screen.
2004-10-16 Elijah Newren <newren@math.utah.edu>
Make the "showing desktop" mode be per-workspace instead of
per-screen. (fixes #142198)
* src/keybindings.c (handle_toggle_desktop): access
showing_desktop through the active workspace
* src/screen.c (meta_screen_new): remove initialization of
screen->showing_desktop,
(meta_screen_update_showing_desktop_hint): rename and make not
static and access showing_desktop through the active workspace,
(queue_windows_showing): replace meta_display_list_windows() with
screen->active_workspace->windows,
(meta_screen_minimize_all_on_active_workspace_except): renamed
from meta_screen_minimize_all_except since it now only works on
the active workspace, (meta_screen_show_desktop,
meta_screen_unshow_desktop): access showing_desktop through the
active workspace
* src/screen.h (struct _MetaScreen): remove showing_desktop field,
(meta_screen_minimize_all_on_active_workspace_except): rename from
meta_screen_minimize_all_except,
(meta_screen_update)_showing_desktop_hint): export this function too
* src/window.c (maybe_leave_show_desktop_mode): access
showing_desktop through the active workspace and use new name for
meta_screen_minimize_all_on_active_workspace_except,
(window_should_be_showing): access showing_desktop through the
active workspace
* src/workspace.c (meta_workspace_new): initialize
workspace->showing_desktop, (meta_workspace_activate_with_focus):
add note that old can be NULL, update showing_desktop_hint if
different on this workspace than the previous one
* src/workspace.h (struct _MetaWorkspace): add showing_desktop
field
2004-10-17 00:28:29 -04:00
|
|
|
|
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;
|
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 12:32:33 -04:00
|
|
|
guint32 wm_sn_timestamp;
|
2002-06-08 19:55:27 -04:00
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2006-01-13 14:41:01 -05:00
|
|
|
/* Managed by compositor.c */
|
|
|
|
gpointer compositor_data;
|
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,
|
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 12:32:33 -04:00
|
|
|
guint32 timestamp);
|
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 13:27:24 -04:00
|
|
|
void meta_screen_free (MetaScreen *screen,
|
|
|
|
guint32 timestamp);
|
2001-06-03 14:33:59 -04:00
|
|
|
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);
|
2005-07-11 09:25:08 -04:00
|
|
|
void meta_screen_update_cursor (MetaScreen *screen);
|
2001-06-09 01:14:43 -04:00
|
|
|
|
2002-04-05 10:52:49 -05:00
|
|
|
void meta_screen_ensure_tab_popup (MetaScreen *screen,
|
2006-01-10 00:05:40 -05:00
|
|
|
MetaTabList list_type,
|
|
|
|
MetaTabShowType show_type);
|
2002-06-22 01:11:04 -04:00
|
|
|
void meta_screen_ensure_workspace_popup (MetaScreen *screen);
|
|
|
|
|
2004-06-24 16:02:46 -04:00
|
|
|
MetaWindow* meta_screen_get_mouse_window (MetaScreen *screen,
|
2003-01-21 23:54:04 -05:00
|
|
|
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-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,
|
2007-03-31 19:34:36 -04:00
|
|
|
Window parent,
|
|
|
|
long valuemask);
|
2002-06-08 23:44:16 -04:00
|
|
|
|
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);
|
|
|
|
|
Make the "showing desktop" mode be per-workspace instead of per-screen.
2004-10-16 Elijah Newren <newren@math.utah.edu>
Make the "showing desktop" mode be per-workspace instead of
per-screen. (fixes #142198)
* src/keybindings.c (handle_toggle_desktop): access
showing_desktop through the active workspace
* src/screen.c (meta_screen_new): remove initialization of
screen->showing_desktop,
(meta_screen_update_showing_desktop_hint): rename and make not
static and access showing_desktop through the active workspace,
(queue_windows_showing): replace meta_display_list_windows() with
screen->active_workspace->windows,
(meta_screen_minimize_all_on_active_workspace_except): renamed
from meta_screen_minimize_all_except since it now only works on
the active workspace, (meta_screen_show_desktop,
meta_screen_unshow_desktop): access showing_desktop through the
active workspace
* src/screen.h (struct _MetaScreen): remove showing_desktop field,
(meta_screen_minimize_all_on_active_workspace_except): rename from
meta_screen_minimize_all_except,
(meta_screen_update)_showing_desktop_hint): export this function too
* src/window.c (maybe_leave_show_desktop_mode): access
showing_desktop through the active workspace and use new name for
meta_screen_minimize_all_on_active_workspace_except,
(window_should_be_showing): access showing_desktop through the
active workspace
* src/workspace.c (meta_workspace_new): initialize
workspace->showing_desktop, (meta_workspace_activate_with_focus):
add note that old can be NULL, update showing_desktop_hint if
different on this workspace than the previous one
* src/workspace.h (struct _MetaWorkspace): add showing_desktop
field
2004-10-17 00:28:29 -04:00
|
|
|
void meta_screen_minimize_all_on_active_workspace_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) */
|
2004-12-19 21:46:42 -05:00
|
|
|
void meta_screen_show_desktop (MetaScreen *screen,
|
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 12:32:33 -04:00
|
|
|
guint32 timestamp);
|
2003-05-16 17:59:08 -04:00
|
|
|
void meta_screen_unshow_desktop (MetaScreen *screen);
|
2002-10-16 16:12:24 -04:00
|
|
|
|
Make the "showing desktop" mode be per-workspace instead of per-screen.
2004-10-16 Elijah Newren <newren@math.utah.edu>
Make the "showing desktop" mode be per-workspace instead of
per-screen. (fixes #142198)
* src/keybindings.c (handle_toggle_desktop): access
showing_desktop through the active workspace
* src/screen.c (meta_screen_new): remove initialization of
screen->showing_desktop,
(meta_screen_update_showing_desktop_hint): rename and make not
static and access showing_desktop through the active workspace,
(queue_windows_showing): replace meta_display_list_windows() with
screen->active_workspace->windows,
(meta_screen_minimize_all_on_active_workspace_except): renamed
from meta_screen_minimize_all_except since it now only works on
the active workspace, (meta_screen_show_desktop,
meta_screen_unshow_desktop): access showing_desktop through the
active workspace
* src/screen.h (struct _MetaScreen): remove showing_desktop field,
(meta_screen_minimize_all_on_active_workspace_except): rename from
meta_screen_minimize_all_except,
(meta_screen_update)_showing_desktop_hint): export this function too
* src/window.c (maybe_leave_show_desktop_mode): access
showing_desktop through the active workspace and use new name for
meta_screen_minimize_all_on_active_workspace_except,
(window_should_be_showing): access showing_desktop through the
active workspace
* src/workspace.c (meta_workspace_new): initialize
workspace->showing_desktop, (meta_workspace_activate_with_focus):
add note that old can be NULL, update showing_desktop_hint if
different on this workspace than the previous one
* src/workspace.h (struct _MetaWorkspace): add showing_desktop
field
2004-10-17 00:28:29 -04:00
|
|
|
/* Update whether the destkop is being shown for the current active_workspace */
|
|
|
|
void meta_screen_update_showing_desktop_hint (MetaScreen *screen);
|
|
|
|
|
2002-11-30 22:58:04 -05:00
|
|
|
void meta_screen_apply_startup_properties (MetaScreen *screen,
|
|
|
|
MetaWindow *window);
|
2006-02-16 15:26:05 -05:00
|
|
|
void meta_screen_composite_all_windows (MetaScreen *screen);
|
2002-10-16 16:12:24 -04:00
|
|
|
|
2001-05-30 11:36:31 -04:00
|
|
|
#endif
|