diff options
author | Elijah Newren <newren@gmail.com> | 2005-11-16 19:18:17 +0000 |
---|---|---|
committer | Elijah Newren <newren@src.gnome.org> | 2005-11-16 19:18:17 +0000 |
commit | cad637b61f4c74e437bad146784564e68e8d3cfc (patch) | |
tree | a9ffa1c9e0cc1110417650bd211d8b3c6f7095ea | |
parent | 1328e39ed28b7b5f01fb99ff3375d607ec675add (diff) | |
download | metacity-cad637b61f4c74e437bad146784564e68e8d3cfc.tar.gz |
Don't access workspace->screen_region and workspace->xinerama_region
2005-11-16 Elijah Newren <newren@gmail.com>
* src/constraints.c (setup_constraint_info):
* src/workspace.[ch]: (meta_workspace_get_onscreen_region,
meta_workspace_get_onxinerama_region):
Don't access workspace->screen_region and
workspace->xinerama_region directly but rather do it through new
accessor functions in workspace.c that can ensure the workarea is
validated.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | src/constraints.c | 7 | ||||
-rw-r--r-- | src/workspace.c | 17 | ||||
-rw-r--r-- | src/workspace.h | 5 |
4 files changed, 37 insertions, 2 deletions
@@ -1,3 +1,13 @@ +2005-11-16 Elijah Newren <newren@gmail.com> + + * src/constraints.c (setup_constraint_info): + * src/workspace.[ch]: (meta_workspace_get_onscreen_region, + meta_workspace_get_onxinerama_region): + Don't access workspace->screen_region and + workspace->xinerama_region directly but rather do it through new + accessor functions in workspace.c that can ensure the workarea is + validated. + 2005-11-15 Elijah Newren <newren@gmail.com> * README: Update -- I NEED TESTERS NOW!!! :-) diff --git a/src/constraints.c b/src/constraints.c index f461d929..816b40b0 100644 --- a/src/constraints.c +++ b/src/constraints.c @@ -383,8 +383,11 @@ setup_constraint_info (ConstraintInfo *info, info->entire_xinerama = xinerama_info->rect; MetaWorkspace *cur_workspace = window->screen->active_workspace; - info->usable_screen_region = cur_workspace->screen_region; - info->usable_xinerama_region = cur_workspace->xinerama_region[xinerama_info->number]; + info->usable_screen_region = + meta_workspace_get_onscreen_region (cur_workspace); + info->usable_xinerama_region = + meta_workspace_get_onxinerama_region (cur_workspace, + xinerama_info->number); /* Log all this information for debugging */ meta_topic (META_DEBUG_GEOMETRY, diff --git a/src/workspace.c b/src/workspace.c index 73d606f7..2e03c612 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -766,6 +766,23 @@ meta_workspace_get_work_area_all_xineramas (MetaWorkspace *workspace, *area = workspace->work_area_screen; } +GList* +meta_workspace_get_onscreen_region (MetaWorkspace *workspace) +{ + ensure_work_areas_validated (workspace); + + return workspace->screen_region; +} + +GList* +meta_workspace_get_onxinerama_region (MetaWorkspace *workspace, + int which_xinerama) +{ + ensure_work_areas_validated (workspace); + + return workspace->xinerama_region[which_xinerama]; +} + #ifdef WITH_VERBOSE_MODE static char * meta_motion_direction_to_string (MetaMotionDirection direction) diff --git a/src/workspace.h b/src/workspace.h index b07f31b3..f81573bc 100644 --- a/src/workspace.h +++ b/src/workspace.h @@ -78,6 +78,11 @@ void meta_workspace_get_work_area_for_xinerama (MetaWorkspace *workspace, MetaRectangle *area); void meta_workspace_get_work_area_all_xineramas (MetaWorkspace *workspace, MetaRectangle *area); +GList* meta_workspace_get_onscreen_region (MetaWorkspace *workspace); +GList* meta_workspace_get_onxinerama_region (MetaWorkspace *workspace, + int which_xinerama); +void meta_workspace_get_work_area_all_xineramas (MetaWorkspace *workspace, + MetaRectangle *area); void meta_workspace_focus_default_window (MetaWorkspace *workspace, MetaWindow *not_this_one, |