use get_real_screen() in a lot of places

This commit is contained in:
Julien Danjou 2007-09-28 11:55:08 +02:00
parent 9692e398d5
commit 659adaab5e
3 changed files with 8 additions and 26 deletions

View File

@ -189,12 +189,7 @@ static void
setup(Display *disp, int screen, DC *drawcontext, awesome_config *awesomeconf) setup(Display *disp, int screen, DC *drawcontext, awesome_config *awesomeconf)
{ {
XSetWindowAttributes wa; XSetWindowAttributes wa;
int real_screen; int real_screen = get_real_screen(disp, screen);
if(XineramaIsActive(disp))
real_screen = DefaultScreen(disp);
else
real_screen = screen;
/* init cursors */ /* init cursors */
drawcontext->cursor[CurNormal] = XCreateFontCursor(disp, XC_left_ptr); drawcontext->cursor[CurNormal] = XCreateFontCursor(disp, XC_left_ptr);

20
event.c
View File

@ -60,10 +60,7 @@ movemouse(Client * c, awesome_config *awesomeconf)
XEvent ev; XEvent ev;
ScreenInfo *si; ScreenInfo *si;
if(XineramaIsActive(c->display)) real_screen = get_real_screen(c->display, awesomeconf->screen);
real_screen = DefaultScreen(c->display);
else
real_screen = awesomeconf->screen;
si = get_display_info(c->display, real_screen, NULL); si = get_display_info(c->display, real_screen, NULL);
@ -108,17 +105,13 @@ movemouse(Client * c, awesome_config *awesomeconf)
static void static void
resizemouse(Client * c, awesome_config *awesomeconf) resizemouse(Client * c, awesome_config *awesomeconf)
{ {
int ocx, ocy, nw, nh, real_screen; int ocx, ocy, nw, nh;
XEvent ev; XEvent ev;
if(XineramaIsActive(c->display))
real_screen = DefaultScreen(c->display);
else
real_screen = awesomeconf->screen;
ocx = c->x; ocx = c->x;
ocy = c->y; ocy = c->y;
if(XGrabPointer(c->display, RootWindow(c->display, real_screen), False, MOUSEMASK, GrabModeAsync, GrabModeAsync, if(XGrabPointer(c->display, RootWindow(c->display, get_real_screen(c->display, awesomeconf->screen)),
False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
None, dc[c->screen].cursor[CurResize], CurrentTime) != GrabSuccess) None, dc[c->screen].cursor[CurResize], CurrentTime) != GrabSuccess)
return; return;
c->ismax = False; c->ismax = False;
@ -243,10 +236,7 @@ handle_event_configurerequest(XEvent * e, awesome_config *awesomeconf)
c->border = ev->border_width; c->border = ev->border_width;
if(c->isfixed || c->isfloating || IS_ARRANGE(layout_floating)) if(c->isfixed || c->isfloating || IS_ARRANGE(layout_floating))
{ {
if(XineramaIsActive(c->display)) real_screen = get_real_screen(c->display, c->screen);
real_screen = DefaultScreen(c->display);
else
real_screen = c->screen;
if(ev->value_mask & CWX) if(ev->value_mask & CWX)
c->x = ev->x; c->x = ev->x;
if(ev->value_mask & CWY) if(ev->value_mask & CWY)

View File

@ -111,12 +111,9 @@ initstatusbar(Display *disp, int screen, DC *drawcontext, Statusbar *statusbar)
int screen_number, real_screen; int screen_number, real_screen;
ScreenInfo *si; ScreenInfo *si;
statusbar->screen = screen; real_screen = get_real_screen(disp, screen);
if(XineramaIsActive(disp)) statusbar->screen = screen;
real_screen = DefaultScreen(disp);
else
real_screen = screen;
si = get_screen_info(disp, screen, NULL, &screen_number); si = get_screen_info(disp, screen, NULL, &screen_number);