get rid of Client phys_screen
This commit is contained in:
parent
9fc22e9e4e
commit
10c257d57a
22
client.c
22
client.c
|
@ -238,10 +238,12 @@ client_detach(Client *c)
|
||||||
void
|
void
|
||||||
focus(Client *c, Bool selscreen, int screen)
|
focus(Client *c, Bool selscreen, int screen)
|
||||||
{
|
{
|
||||||
|
int phys_screen = get_phys_screen(screen);
|
||||||
|
|
||||||
/* unfocus current selected client */
|
/* unfocus current selected client */
|
||||||
if(globalconf.focus->client)
|
if(globalconf.focus->client)
|
||||||
{
|
{
|
||||||
window_grabbuttons(globalconf.focus->client->phys_screen,
|
window_grabbuttons(get_phys_screen(globalconf.focus->client->screen),
|
||||||
globalconf.focus->client->win, False, True);
|
globalconf.focus->client->win, False, True);
|
||||||
XSetWindowBorder(globalconf.display, globalconf.focus->client->win,
|
XSetWindowBorder(globalconf.display, globalconf.focus->client->win,
|
||||||
globalconf.screens[screen].colors_normal[ColBorder].pixel);
|
globalconf.screens[screen].colors_normal[ColBorder].pixel);
|
||||||
|
@ -262,7 +264,7 @@ focus(Client *c, Bool selscreen, int screen)
|
||||||
if(c)
|
if(c)
|
||||||
{
|
{
|
||||||
XSetWindowBorder(globalconf.display, c->win, globalconf.screens[screen].colors_selected[ColBorder].pixel);
|
XSetWindowBorder(globalconf.display, c->win, globalconf.screens[screen].colors_selected[ColBorder].pixel);
|
||||||
window_grabbuttons(c->phys_screen, c->win, True, True);
|
window_grabbuttons(phys_screen, c->win, True, True);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!selscreen)
|
if(!selscreen)
|
||||||
|
@ -285,10 +287,10 @@ focus(Client *c, Bool selscreen, int screen)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
XSetInputFocus(globalconf.display,
|
XSetInputFocus(globalconf.display,
|
||||||
RootWindow(globalconf.display, get_phys_screen(screen)),
|
RootWindow(globalconf.display, phys_screen),
|
||||||
RevertToPointerRoot, CurrentTime);
|
RevertToPointerRoot, CurrentTime);
|
||||||
|
|
||||||
ewmh_update_net_active_window(get_phys_screen(screen));
|
ewmh_update_net_active_window(phys_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Manage a new client
|
/** Manage a new client
|
||||||
|
@ -306,6 +308,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
|
||||||
Area area, darea;
|
Area area, darea;
|
||||||
Tag *tag;
|
Tag *tag;
|
||||||
Rule *rule;
|
Rule *rule;
|
||||||
|
int phys_screen = get_phys_screen(screen);
|
||||||
|
|
||||||
c = p_new(Client, 1);
|
c = p_new(Client, 1);
|
||||||
|
|
||||||
|
@ -318,7 +321,6 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
|
||||||
|
|
||||||
globalconf.display = globalconf.display;
|
globalconf.display = globalconf.display;
|
||||||
c->screen = get_screen_bycoord(c->x, c->y);
|
c->screen = get_screen_bycoord(c->x, c->y);
|
||||||
c->phys_screen = get_phys_screen(c->screen);
|
|
||||||
|
|
||||||
move_client_to_screen(c, screen, True);
|
move_client_to_screen(c, screen, True);
|
||||||
|
|
||||||
|
@ -345,7 +347,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
darea = get_display_area(c->phys_screen,
|
darea = get_display_area(phys_screen,
|
||||||
globalconf.screens[screen].statusbar,
|
globalconf.screens[screen].statusbar,
|
||||||
&globalconf.screens[screen].padding);
|
&globalconf.screens[screen].padding);
|
||||||
|
|
||||||
|
@ -377,11 +379,11 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
|
||||||
if(globalconf.have_shape)
|
if(globalconf.have_shape)
|
||||||
{
|
{
|
||||||
XShapeSelectInput(globalconf.display, w, ShapeNotifyMask);
|
XShapeSelectInput(globalconf.display, w, ShapeNotifyMask);
|
||||||
window_setshape(c->phys_screen, c->win);
|
window_setshape(phys_screen, c->win);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* grab buttons */
|
/* grab buttons */
|
||||||
window_grabbuttons(c->phys_screen, c->win, False, True);
|
window_grabbuttons(phys_screen, c->win, False, True);
|
||||||
|
|
||||||
/* check for transient and set tags like its parent */
|
/* check for transient and set tags like its parent */
|
||||||
if((rettrans = XGetTransientForHint(globalconf.display, w, &trans) == Success)
|
if((rettrans = XGetTransientForHint(globalconf.display, w, &trans) == Success)
|
||||||
|
@ -412,7 +414,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
|
||||||
|
|
||||||
focus(c, True, screen);
|
focus(c, True, screen);
|
||||||
|
|
||||||
ewmh_update_net_client_list(c->phys_screen);
|
ewmh_update_net_client_list(phys_screen);
|
||||||
|
|
||||||
/* rearrange to display new window */
|
/* rearrange to display new window */
|
||||||
arrange(screen);
|
arrange(screen);
|
||||||
|
@ -479,7 +481,7 @@ client_resize(Client *c, int x, int y, int w, int h,
|
||||||
if(w <= 0 || h <= 0)
|
if(w <= 0 || h <= 0)
|
||||||
return;
|
return;
|
||||||
/* offscreen appearance fixes */
|
/* offscreen appearance fixes */
|
||||||
area = get_display_area(c->phys_screen,
|
area = get_display_area(get_phys_screen(c->screen),
|
||||||
NULL,
|
NULL,
|
||||||
&globalconf.screens[c->screen].padding);
|
&globalconf.screens[c->screen].padding);
|
||||||
if(x > area.width)
|
if(x > area.width)
|
||||||
|
|
2
config.h
2
config.h
|
@ -172,8 +172,6 @@ struct Client
|
||||||
Window win;
|
Window win;
|
||||||
/** Client logical screen */
|
/** Client logical screen */
|
||||||
int screen;
|
int screen;
|
||||||
/** Client physical screen */
|
|
||||||
int phys_screen;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct FocusList FocusList;
|
typedef struct FocusList FocusList;
|
||||||
|
|
8
event.c
8
event.c
|
@ -107,7 +107,7 @@ handle_event_buttonpress(XEvent *e)
|
||||||
{
|
{
|
||||||
restack(c->screen);
|
restack(c->screen);
|
||||||
XAllowEvents(globalconf.display, ReplayPointer, CurrentTime);
|
XAllowEvents(globalconf.display, ReplayPointer, CurrentTime);
|
||||||
window_grabbuttons(c->phys_screen, c->win, True, True);
|
window_grabbuttons(get_phys_screen(c->screen), c->win, True, True);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
handle_mouse_button_press(c->screen, ev->button, ev->state, globalconf.buttons.client, NULL);
|
handle_mouse_button_press(c->screen, ev->button, ev->state, globalconf.buttons.client, NULL);
|
||||||
|
@ -233,7 +233,7 @@ handle_event_enternotify(XEvent * e)
|
||||||
curtags = get_current_tags(c->screen);
|
curtags = get_current_tags(c->screen);
|
||||||
focus(c, ev->same_screen, c->screen);
|
focus(c, ev->same_screen, c->screen);
|
||||||
if (c->isfloating || curtags[0]->layout->arrange == layout_floating)
|
if (c->isfloating || curtags[0]->layout->arrange == layout_floating)
|
||||||
window_grabbuttons(c->phys_screen, c->win, True, False);
|
window_grabbuttons(get_phys_screen(c->screen), c->win, True, False);
|
||||||
p_delete(&curtags);
|
p_delete(&curtags);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -381,7 +381,7 @@ handle_event_unmapnotify(XEvent * e)
|
||||||
XUnmapEvent *ev = &e->xunmap;
|
XUnmapEvent *ev = &e->xunmap;
|
||||||
|
|
||||||
if((c = get_client_bywin(globalconf.clients, ev->window))
|
if((c = get_client_bywin(globalconf.clients, ev->window))
|
||||||
&& ev->event == RootWindow(e->xany.display, c->phys_screen)
|
&& ev->event == RootWindow(e->xany.display, get_phys_screen(c->screen))
|
||||||
&& ev->send_event && window_getstate(c->win) == NormalState)
|
&& ev->send_event && window_getstate(c->win) == NormalState)
|
||||||
client_unmanage(c, WithdrawnState);
|
client_unmanage(c, WithdrawnState);
|
||||||
}
|
}
|
||||||
|
@ -393,7 +393,7 @@ handle_event_shape(XEvent * e)
|
||||||
Client *c = get_client_bywin(globalconf.clients, ev->window);
|
Client *c = get_client_bywin(globalconf.clients, ev->window);
|
||||||
|
|
||||||
if(c)
|
if(c)
|
||||||
window_setshape(c->phys_screen, c->win);
|
window_setshape(get_phys_screen(c->screen), c->win);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
4
ewmh.c
4
ewmh.c
|
@ -143,13 +143,13 @@ ewmh_update_net_client_list(int phys_screen)
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
for(c = globalconf.clients; c; c = c->next)
|
for(c = globalconf.clients; c; c = c->next)
|
||||||
if(c->phys_screen == phys_screen)
|
if(get_phys_screen(c->screen) == phys_screen)
|
||||||
n++;
|
n++;
|
||||||
|
|
||||||
wins = p_new(Window, n + 1);
|
wins = p_new(Window, n + 1);
|
||||||
|
|
||||||
for(n = 0, c = globalconf.clients; c; c = c->next, n++)
|
for(n = 0, c = globalconf.clients; c; c = c->next, n++)
|
||||||
if(c->phys_screen == phys_screen)
|
if(get_phys_screen(c->screen) == phys_screen)
|
||||||
wins[n] = c->win;
|
wins[n] = c->win;
|
||||||
|
|
||||||
XChangeProperty(globalconf.display, RootWindow(globalconf.display, phys_screen),
|
XChangeProperty(globalconf.display, RootWindow(globalconf.display, phys_screen),
|
||||||
|
|
10
mouse.c
10
mouse.c
|
@ -43,7 +43,7 @@ extern AwesomeConf globalconf;
|
||||||
void
|
void
|
||||||
uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
|
uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
int x1, y, ocx, ocy, di, nx, ny;
|
int x1, y, ocx, ocy, di, nx, ny, phys_screen;
|
||||||
unsigned int dui;
|
unsigned int dui;
|
||||||
Window dummy;
|
Window dummy;
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
|
@ -68,13 +68,14 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
|
||||||
|
|
||||||
ocx = nx = c->x;
|
ocx = nx = c->x;
|
||||||
ocy = ny = c->y;
|
ocy = ny = c->y;
|
||||||
|
phys_screen = get_phys_screen(c->screen);
|
||||||
if(XGrabPointer(globalconf.display,
|
if(XGrabPointer(globalconf.display,
|
||||||
RootWindow(globalconf.display, c->phys_screen),
|
RootWindow(globalconf.display, phys_screen),
|
||||||
False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
|
False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
|
||||||
None, globalconf.cursor[CurMove], CurrentTime) != GrabSuccess)
|
None, globalconf.cursor[CurMove], CurrentTime) != GrabSuccess)
|
||||||
return;
|
return;
|
||||||
XQueryPointer(globalconf.display,
|
XQueryPointer(globalconf.display,
|
||||||
RootWindow(globalconf.display, c->phys_screen),
|
RootWindow(globalconf.display, phys_screen),
|
||||||
&dummy, &dummy, &x1, &y, &di, &di, &dui);
|
&dummy, &dummy, &x1, &y, &di, &di, &dui);
|
||||||
c->ismax = False;
|
c->ismax = False;
|
||||||
statusbar_draw_all(c->screen);
|
statusbar_draw_all(c->screen);
|
||||||
|
@ -158,7 +159,8 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused)))
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(XGrabPointer(globalconf.display, RootWindow(globalconf.display, c->phys_screen),
|
if(XGrabPointer(globalconf.display, RootWindow(globalconf.display,
|
||||||
|
get_phys_screen(c->screen)),
|
||||||
False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
|
False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
|
||||||
None, globalconf.cursor[CurResize], CurrentTime) != GrabSuccess)
|
None, globalconf.cursor[CurResize], CurrentTime) != GrabSuccess)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue