diff --git a/awesome.c b/awesome.c index de0a98eb..77118f91 100644 --- a/awesome.c +++ b/awesome.c @@ -83,7 +83,7 @@ scan() if(wa.map_state == IsViewable || window_getstate(wins[i]) == IconicState) { if(screen == 0) - real_screen = get_screen_bycoord(wa.x, wa.y); + real_screen = screen_get_bycoord(wa.x, wa.y); client_manage(wins[i], &wa, real_screen); } } @@ -96,7 +96,7 @@ scan() && (wa.map_state == IsViewable || window_getstate(wins[i]) == IconicState)) { if(screen == 0) - real_screen = get_screen_bycoord(wa.x, wa.y); + real_screen = screen_get_bycoord(wa.x, wa.y); client_manage(wins[i], &wa, real_screen); } } diff --git a/client.c b/client.c index 36496065..9f5ae321 100644 --- a/client.c +++ b/client.c @@ -227,7 +227,7 @@ client_get_smart_geometry(Area geometry, int border, int screen) screen_geometry = p_new(Area, 1); - *screen_geometry = get_screen_area(screen, + *screen_geometry = screen_get_area(screen, globalconf.screens[screen].statusbar, &globalconf.screens[screen].padding); @@ -297,9 +297,9 @@ client_manage(Window w, XWindowAttributes *wa, int screen) c = p_new(Client, 1); - c->screen = get_screen_bycoord(wa->x, wa->y); + c->screen = screen_get_bycoord(wa->x, wa->y); - screen_geom = get_screen_area(c->screen, + screen_geom = screen_get_area(c->screen, globalconf.screens[screen].statusbar, &globalconf.screens[screen].padding); /* Initial values */ @@ -473,7 +473,7 @@ client_resize(Client *c, Area geometry, Bool sizehints) if(c->geometry.x != geometry.x || c->geometry.y != geometry.y || c->geometry.width != geometry.width || c->geometry.height != geometry.height) { - new_screen = get_screen_bycoord(geometry.x, geometry.y); + new_screen = screen_get_bycoord(geometry.x, geometry.y); c->geometry.x = wc.x = geometry.x; c->geometry.y = wc.y = geometry.y; @@ -926,7 +926,7 @@ void uicb_client_togglemax(int screen, char *arg __attribute__ ((unused))) { Client *sel = globalconf.focus->client; - Area area = get_screen_area(screen, + Area area = screen_get_area(screen, globalconf.screens[screen].statusbar, &globalconf.screens[screen].padding); @@ -947,7 +947,7 @@ void uicb_client_toggleverticalmax(int screen, char *arg __attribute__ ((unused))) { Client *sel = globalconf.focus->client; - Area area = get_screen_area(screen, + Area area = screen_get_area(screen, globalconf.screens[screen].statusbar, &globalconf.screens[screen].padding); @@ -970,7 +970,7 @@ void uicb_client_togglehorizontalmax(int screen, char *arg __attribute__ ((unused))) { Client *sel = globalconf.focus->client; - Area area = get_screen_area(screen, + Area area = screen_get_area(screen, globalconf.screens[screen].statusbar, &globalconf.screens[screen].padding); diff --git a/event.c b/event.c index dce9bffa..75d0336b 100644 --- a/event.c +++ b/event.c @@ -134,7 +134,7 @@ handle_event_buttonpress(XEvent *e) &wdummy, &x, &y, &i, &i, &udummy)) { - screen = get_screen_bycoord(x, y); + screen = screen_get_bycoord(x, y); handle_mouse_button_press(screen, ev->button, ev->state, globalconf.buttons.root, NULL); return; @@ -272,10 +272,10 @@ handle_event_keypress(XEvent * e) { /* if screen is 0, we are on first Zaphod screen or on the * only screen in Xinerama, so we can ask for a better screen - * number with get_screen_bycoord: we'll get 0 in Zaphod mode + * number with screen_get_bycoord: we'll get 0 in Zaphod mode * so it's the same, or maybe the real Xinerama screen */ if(screen == 0) - screen = get_screen_bycoord(x, y); + screen = screen_get_bycoord(x, y); break; } @@ -329,7 +329,7 @@ handle_event_maprequest(XEvent *e) for(screen = 0; wa.screen != ScreenOfDisplay(e->xany.display, screen); screen++); if(screen == 0 && XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), &dummy, &dummy, &x, &y, &d, &d, &m)) - screen = get_screen_bycoord(x, y); + screen = screen_get_bycoord(x, y); client_manage(ev->window, &wa, screen); } } diff --git a/ewmh.c b/ewmh.c index a1fece88..13f142e1 100644 --- a/ewmh.c +++ b/ewmh.c @@ -262,7 +262,7 @@ ewmh_process_state_atom(Client *c, Atom state, int set) } else if(set == _NET_WM_STATE_ADD) { - geometry = get_screen_area(c->screen, NULL, &globalconf.screens[c->screen].padding); + geometry = screen_get_area(c->screen, NULL, &globalconf.screens[c->screen].padding); /* save geometry */ c->m_geometry = c->geometry; c->wasfloating = c->isfloating; diff --git a/layouts/fibonacci.c b/layouts/fibonacci.c index 2733ede1..70d50393 100644 --- a/layouts/fibonacci.c +++ b/layouts/fibonacci.c @@ -33,7 +33,7 @@ layout_fibonacci(int screen, int shape) int n = 0, i = 0; Client *c; Area geometry, area; - geometry = area = get_screen_area(screen, + geometry = area = screen_get_area(screen, globalconf.screens[screen].statusbar, &globalconf.screens[screen].padding); diff --git a/layouts/max.c b/layouts/max.c index 2d2535ff..f9809abe 100644 --- a/layouts/max.c +++ b/layouts/max.c @@ -31,7 +31,7 @@ void layout_max(int screen) { Client *c; - Area area = get_screen_area(screen, + Area area = screen_get_area(screen, globalconf.screens[screen].statusbar, &globalconf.screens[screen].padding); diff --git a/layouts/tile.c b/layouts/tile.c index 3d0a32f2..b8fa8c2f 100644 --- a/layouts/tile.c +++ b/layouts/tile.c @@ -116,7 +116,7 @@ _tile(int screen, const Position position) Client *c; Tag **curtags = tags_get_current(screen); - area = get_screen_area(screen, + area = screen_get_area(screen, globalconf.screens[screen].statusbar, &globalconf.screens[screen].padding); diff --git a/mouse.c b/mouse.c index 93a3574b..cd095883 100644 --- a/mouse.c +++ b/mouse.c @@ -57,7 +57,7 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused))) /* go above everybody */ XMapRaised(globalconf.display, c->win); - area = get_screen_area(c->screen, + area = screen_get_area(c->screen, globalconf.screens[screen].statusbar, &globalconf.screens[screen].padding); @@ -119,7 +119,7 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused))) XQueryPointer(globalconf.display, RootWindow(globalconf.display, phys_screen), &dummy, &child, &x, &y, &di, &di, &dui); - if((newscreen = get_screen_bycoord(x, y)) != c->screen) + if((newscreen = screen_get_bycoord(x, y)) != c->screen) { move_client_to_screen(c, newscreen, True); globalconf.screens[c->screen].need_arrange = True; @@ -176,7 +176,7 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused))) for(c = globalconf.clients; c && !IS_TILED(c, screen); c = c->next); if(!c) return; - area = get_screen_area(screen, + area = screen_get_area(screen, globalconf.screens[c->screen].statusbar, &globalconf.screens[c->screen].padding); } diff --git a/screen.c b/screen.c index 5028493a..4135a88e 100644 --- a/screen.c +++ b/screen.c @@ -36,7 +36,7 @@ extern AwesomeConf globalconf; * \return Area */ Area -get_screen_area(int screen, Statusbar *statusbar, Padding *padding) +screen_get_area(int screen, Statusbar *statusbar, Padding *padding) { Area area; Statusbar *sb; @@ -110,7 +110,7 @@ get_display_area(int screen, Statusbar *statusbar, Padding *padding) * \return screen number or DefaultScreen of disp on no match */ int -get_screen_bycoord(int x, int y) +screen_get_bycoord(int x, int y) { int i; Area area; @@ -121,7 +121,7 @@ get_screen_bycoord(int x, int y) for(i = 0; i < globalconf.nscreen; i++) { - area = get_screen_area(i, NULL, NULL); + area = screen_get_area(i, NULL, NULL); if((x < 0 || (x >= area.x && x < area.x + area.width)) && (y < 0 || (y >= area.y && y < area.y + area.height))) return i; @@ -245,8 +245,8 @@ move_client_to_screen(Client *c, int new_screen, Bool doresize) Area new_geometry, new_f_geometry; new_f_geometry = c->f_geometry; - to = get_screen_area(c->screen, NULL, NULL); - from = get_screen_area(old_screen, NULL, NULL); + to = screen_get_area(c->screen, NULL, NULL); + from = screen_get_area(old_screen, NULL, NULL); /* compute new coords in new screen */ new_f_geometry.x = (c->f_geometry.x - from.x) + to.x; @@ -317,7 +317,7 @@ move_mouse_pointer_to_screen(int screen) { if(XineramaIsActive(globalconf.display)) { - Area area = get_screen_area(screen, NULL, NULL); + Area area = screen_get_area(screen, NULL, NULL); XWarpPointer(globalconf.display, None, DefaultRootWindow(globalconf.display), diff --git a/screen.h b/screen.h index dfb2503b..fb76b4b9 100644 --- a/screen.h +++ b/screen.h @@ -1,7 +1,7 @@ /* * screen.h - screen management header * - * Copyright © 2007 Julien Danjou + * Copyright © 2007-2008 Julien Danjou * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,9 +24,9 @@ #include "structs.h" -Area get_screen_area(int, Statusbar *, Padding *); +Area screen_get_area(int, Statusbar *, Padding *); Area get_display_area(int, Statusbar *, Padding *); -int get_screen_bycoord(int, int); +int screen_get_bycoord(int, int); void screen_build_screens(void); int get_phys_screen(int); void move_client_to_screen(Client *, int, Bool); diff --git a/statusbar.c b/statusbar.c index 809c64a7..f8ee1fce 100644 --- a/statusbar.c +++ b/statusbar.c @@ -39,11 +39,11 @@ statusbar_update_position(Statusbar *statusbar) /* Top and Bottom Statusbar have prio */ if(statusbar->position == Top || statusbar->position == Bottom) - area = get_screen_area(statusbar->screen, + area = screen_get_area(statusbar->screen, NULL, &globalconf.screens[statusbar->screen].padding); else - area = get_screen_area(statusbar->screen, + area = screen_get_area(statusbar->screen, globalconf.screens[statusbar->screen].statusbar, &globalconf.screens[statusbar->screen].padding); @@ -184,7 +184,7 @@ statusbar_init(Statusbar *statusbar) { Statusbar *sb; int phys_screen = get_phys_screen(statusbar->screen); - Area area = get_screen_area(statusbar->screen, + Area area = screen_get_area(statusbar->screen, globalconf.screens[statusbar->screen].statusbar, &globalconf.screens[statusbar->screen].padding);