summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/frames.c39
-rw-r--r--src/place.c8
-rwxr-xr-xsrc/run-metacity.sh1
-rw-r--r--src/screen.c4
-rw-r--r--src/screen.h2
-rw-r--r--src/workspace.c4
6 files changed, 33 insertions, 25 deletions
diff --git a/src/frames.c b/src/frames.c
index 354484a..8d23ccf 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 464ad77..c303cfb 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 9915221..ce1a955 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 7e12be1..83d1c9f 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 6879e6e..c733d63 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 8d4415a..7bf51e9 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);