From 73b7323d844089a877133d0b818ef6da53ed516c Mon Sep 17 00:00:00 2001 From: rhp Date: Wed, 4 Jul 2001 04:33:31 +0000 Subject: [PATCH] ... --- src/frames.c | 37 +++++++++++++++++++++---------------- src/place.c | 8 +++----- src/run-metacity.sh | 1 + src/screen.c | 4 +++- src/screen.h | 2 ++ src/workspace.c | 4 ++-- 6 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/frames.c b/src/frames.c index 354484a4f..8d23ccf2b 100644 --- a/src/frames.c +++ b/src/frames.c @@ -718,28 +718,33 @@ meta_frames_manage_window (MetaFrames *frames, int i = 1; while (i < 4) { - if (XGrabButton (gdk_display, i, Mod1Mask, - xwindow, False, - ButtonPressMask | ButtonReleaseMask | - PointerMotionMask | PointerMotionHintMask, - GrabModeAsync, GrabModeAsync, - False, None) != Success) - meta_warning ("Failed to grab button %d with Mod1Mask for frame 0x%lx\n", - i, xwindow); + int result; + + result = XGrabButton (gdk_display, i, Mod1Mask, + xwindow, False, + ButtonPressMask | ButtonReleaseMask | + PointerMotionMask | PointerMotionHintMask, + GrabModeAsync, GrabModeAsync, + False, None); + + if (result != Success) + meta_warning ("Failed to grab button %d with Mod1Mask for frame 0x%lx error code %d\n", + i, xwindow, result); #if 0 /* This is just for debugging, since I end up moving * the Xnest otherwise ;-) */ - if (XGrabButton (gdk_display, i, ControlMask, - xwindow, False, - ButtonPressMask | ButtonReleaseMask | - PointerMotionMask | PointerMotionHintMask, - GrabModeAsync, GrabModeAsync, - False, None) != Success) - meta_warning ("Failed to grab button %d with ControlMask for frame 0x%lx\n", - i, xwindow); + result = XGrabButton (gdk_display, i, ControlMask, + xwindow, False, + ButtonPressMask | ButtonReleaseMask | + PointerMotionMask | PointerMotionHintMask, + GrabModeAsync, GrabModeAsync, + False, None); + if (result != Success) + meta_warning ("Failed to grab button %d with ControlMask for frame 0x%lx error code %d\n", + i, xwindow, result); #endif ++i; diff --git a/src/place.c b/src/place.c index 464ad7795..c303cfb44 100644 --- a/src/place.c +++ b/src/place.c @@ -195,9 +195,7 @@ find_first_fit (MetaWindow *window, int *new_x, int *new_y) { - - - + } void @@ -256,8 +254,8 @@ meta_window_place (MetaWindow *window, int w, h; /* I think whole screen will look nicer than workarea */ - w = WidthOfScreen (window->screen->xscreen); - h = HeightOfScreen (window->screen->xscreen); + w = window->screen->width; + h = window->screen->height; x = (w - window->rect.width) / 2; y = (y - window->rect.height) / 2; diff --git a/src/run-metacity.sh b/src/run-metacity.sh index 99152218f..ce1a955ea 100755 --- a/src/run-metacity.sh +++ b/src/run-metacity.sh @@ -1,4 +1,5 @@ #! /bin/bash + if test -z "$SCREENS"; then SCREENS=1 fi diff --git a/src/screen.c b/src/screen.c index 7e12be171..83d1c9f5d 100644 --- a/src/screen.c +++ b/src/screen.c @@ -163,7 +163,9 @@ meta_screen_new (MetaDisplay *display, screen->screen_name = get_screen_name (display, number); screen->xscreen = ScreenOfDisplay (xdisplay, number); screen->xroot = xroot; - + screen->width = WidthOfScreen (screen->xscreen); + screen->height = HeightOfScreen (screen->xscreen); + if (display->leader_window == None) display->leader_window = XCreateSimpleWindow (display->xdisplay, screen->xroot, diff --git a/src/screen.h b/src/screen.h index 6879e6e53..c733d6358 100644 --- a/src/screen.h +++ b/src/screen.h @@ -36,6 +36,8 @@ struct _MetaScreen char *screen_name; Screen *xscreen; Window xroot; + int width; + int height; MetaUI *ui; MetaWorkspace *active_workspace; diff --git a/src/workspace.c b/src/workspace.c index 8d4415a0c..7bf51e9c9 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -45,8 +45,8 @@ meta_workspace_new (MetaScreen *screen) */ workspace->workarea.x = 0; workspace->workarea.y = 0; - workspace->workarea.width = WidthOfScreen (screen->xscreen); - workspace->workarea.height = HeightOfScreen (screen->xscreen); + workspace->workarea.width = screen->width; + workspace->workarea.height = screen->height; /* Update hint for current number of workspaces */ set_number_of_spaces_hint (screen);