2001-06-06 00:47:37 -04:00
|
|
|
/* Metacity Workspaces */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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_WORKSPACE_H
|
|
|
|
#define META_WORKSPACE_H
|
|
|
|
|
|
|
|
#include "window.h"
|
|
|
|
|
2002-04-28 00:52:26 -04:00
|
|
|
/* Negative to avoid conflicting with real workspace
|
|
|
|
* numbers
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_MOTION_UP = -1,
|
|
|
|
META_MOTION_DOWN = -2,
|
|
|
|
META_MOTION_LEFT = -3,
|
|
|
|
META_MOTION_RIGHT = -4
|
|
|
|
} MetaMotionDirection;
|
|
|
|
|
2001-06-06 00:47:37 -04:00
|
|
|
struct _MetaWorkspace
|
|
|
|
{
|
|
|
|
MetaScreen *screen;
|
|
|
|
|
|
|
|
GList *windows;
|
2003-08-15 18:09:55 -04:00
|
|
|
GList *mru_list;
|
2003-02-23 12:09:46 -05:00
|
|
|
|
|
|
|
MetaRectangle all_work_areas;
|
|
|
|
MetaRectangle *work_areas;
|
2003-06-25 23:09:38 -04:00
|
|
|
GSList *left_struts;
|
|
|
|
GSList *right_struts;
|
|
|
|
GSList *top_struts;
|
|
|
|
GSList *bottom_struts;
|
2003-02-23 12:09:46 -05:00
|
|
|
guint work_areas_invalid : 1;
|
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
|
|
|
|
|
|
|
guint showing_desktop : 1;
|
2001-06-06 00:47:37 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
MetaWorkspace* meta_workspace_new (MetaScreen *screen);
|
|
|
|
void meta_workspace_free (MetaWorkspace *workspace);
|
|
|
|
void meta_workspace_add_window (MetaWorkspace *workspace,
|
|
|
|
MetaWindow *window);
|
|
|
|
void meta_workspace_remove_window (MetaWorkspace *workspace,
|
|
|
|
MetaWindow *window);
|
2001-12-09 22:55:26 -05:00
|
|
|
void meta_workspace_relocate_windows (MetaWorkspace *workspace,
|
|
|
|
MetaWorkspace *new_home);
|
2003-05-30 16:24:00 -04:00
|
|
|
void meta_workspace_activate_with_focus (MetaWorkspace *workspace,
|
Fix a variety of focus race conditions in all focus modes, or at least
2004-10-04 Elijah Newren <newren@math.utah.edu>
Fix a variety of focus race conditions in all focus modes, or at
least make them harder to trigger (fixes #152000)
* src/core.[ch] (meta_core_user_lower_and_unfocus): add a
timestamp parameter; pass it along to
meta_workspace_focus_default_window
* src/display.[ch] (meta_display_get_current_time_roundtrip): new
function
* src/display.c (event_callback): pass a timestamp to the
meta_workspace_activate and meta_workspace_focus_default_window
function calls
* src/frames.c (meta_frames_button_press_event): pass a timestamp
to meta_core_user_lower_and_unfocus
* src/keybindings.c (handle_activate_workspace): pass a timestamp
to meta_workspace_activate, (process_workspace_switch_grab): pass
a timestamp to meta_workspace_focus_default_window and
meta_workspace_activate, (handle_toggle_desktop): pass a timestamp
to meta_workspace_focus_default_window,
(do_handle_move_to_workspace): pass a timestamp to
meta_workspace_activate_with_focus, (handle_workspace_switch):
meta_workspace_activate
* src/screen.c (meta_screen_new): pass a timestamp to
meta_workspace_activate
* src/window.c (meta_window_free): pass a timestamp to
meta_workspace_focus_default_window, (idle_calc_showing): don't
increment the focus sentinel here, (meta_window_minimize): pass a
timestamp to meta_workspace_focus_default_window,
(meta_window_client_message), pass a timestamp to
meta_workspace_focus_default_window
* src/workspace.h (meta_workspace_activate): add timestamp
parameter, (meta_workspace_activate_with_focus): add timestamp
parameter, (meta_workspace_focus_default_window): add timestamp
parameter
* src/workspace.c (meta_workspace_focus_mru_window): make this
function take a timestamp and use it for meta_window_focus or
XSetInputFocus, (meta_workspace_activate_with_focus): make this
function take a timestamp and pass it along to meta_window_focus
and meta_workspace_focus_default_window,
(meta_workspace_activate): make this function take a timestamp and
pass it to meta_workspace_activate_with_focus),
(meta_workspace_focus_default_window): make this function take a
timestamp, warn if its 0 but try to handle that case sanely, and
pass the timestamp on to meta_window_focus or
meta_workspace_focus_mru_window or XSetInputFocus
2004-10-04 16:32:59 -04:00
|
|
|
MetaWindow *focus_this,
|
|
|
|
Time timestamp);
|
|
|
|
void meta_workspace_activate (MetaWorkspace *workspace,
|
|
|
|
Time timestamp);
|
2001-06-06 00:47:37 -04:00
|
|
|
int meta_workspace_index (MetaWorkspace *workspace);
|
2002-01-10 01:31:31 -05:00
|
|
|
GList* meta_workspace_list_windows (MetaWorkspace *workspace);
|
|
|
|
|
|
|
|
void meta_workspace_invalidate_work_area (MetaWorkspace *workspace);
|
2003-02-23 12:09:46 -05:00
|
|
|
|
|
|
|
|
|
|
|
void meta_workspace_get_work_area_for_xinerama (MetaWorkspace *workspace,
|
|
|
|
int which_xinerama,
|
|
|
|
MetaRectangle *area);
|
|
|
|
void meta_workspace_get_work_area_all_xineramas (MetaWorkspace *workspace,
|
|
|
|
MetaRectangle *area);
|
|
|
|
|
2003-08-15 18:09:55 -04:00
|
|
|
void meta_workspace_focus_default_window (MetaWorkspace *workspace,
|
Fix a variety of focus race conditions in all focus modes, or at least
2004-10-04 Elijah Newren <newren@math.utah.edu>
Fix a variety of focus race conditions in all focus modes, or at
least make them harder to trigger (fixes #152000)
* src/core.[ch] (meta_core_user_lower_and_unfocus): add a
timestamp parameter; pass it along to
meta_workspace_focus_default_window
* src/display.[ch] (meta_display_get_current_time_roundtrip): new
function
* src/display.c (event_callback): pass a timestamp to the
meta_workspace_activate and meta_workspace_focus_default_window
function calls
* src/frames.c (meta_frames_button_press_event): pass a timestamp
to meta_core_user_lower_and_unfocus
* src/keybindings.c (handle_activate_workspace): pass a timestamp
to meta_workspace_activate, (process_workspace_switch_grab): pass
a timestamp to meta_workspace_focus_default_window and
meta_workspace_activate, (handle_toggle_desktop): pass a timestamp
to meta_workspace_focus_default_window,
(do_handle_move_to_workspace): pass a timestamp to
meta_workspace_activate_with_focus, (handle_workspace_switch):
meta_workspace_activate
* src/screen.c (meta_screen_new): pass a timestamp to
meta_workspace_activate
* src/window.c (meta_window_free): pass a timestamp to
meta_workspace_focus_default_window, (idle_calc_showing): don't
increment the focus sentinel here, (meta_window_minimize): pass a
timestamp to meta_workspace_focus_default_window,
(meta_window_client_message), pass a timestamp to
meta_workspace_focus_default_window
* src/workspace.h (meta_workspace_activate): add timestamp
parameter, (meta_workspace_activate_with_focus): add timestamp
parameter, (meta_workspace_focus_default_window): add timestamp
parameter
* src/workspace.c (meta_workspace_focus_mru_window): make this
function take a timestamp and use it for meta_window_focus or
XSetInputFocus, (meta_workspace_activate_with_focus): make this
function take a timestamp and pass it along to meta_window_focus
and meta_workspace_focus_default_window,
(meta_workspace_activate): make this function take a timestamp and
pass it to meta_workspace_activate_with_focus),
(meta_workspace_focus_default_window): make this function take a
timestamp, warn if its 0 but try to handle that case sanely, and
pass the timestamp on to meta_window_focus or
meta_workspace_focus_mru_window or XSetInputFocus
2004-10-04 16:32:59 -04:00
|
|
|
MetaWindow *not_this_one,
|
|
|
|
Time timestamp);
|
2001-06-06 00:47:37 -04:00
|
|
|
|
2002-04-28 00:52:26 -04:00
|
|
|
MetaWorkspace* meta_workspace_get_neighbor (MetaWorkspace *workspace,
|
|
|
|
MetaMotionDirection direction);
|
|
|
|
|
2002-11-03 14:06:39 -05:00
|
|
|
const char* meta_workspace_get_name (MetaWorkspace *workspace);
|
2002-06-22 00:52:35 -04:00
|
|
|
|
2001-06-06 00:47:37 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|