screen_fromroot -> screen_find

This commit is contained in:
okan 2014-09-07 17:38:38 +00:00
parent 63dc9657ad
commit ae092d4229
4 changed files with 12 additions and 12 deletions

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: calmwm.h,v 1.269 2014/09/07 17:27:20 okan Exp $
* $OpenBSD: calmwm.h,v 1.270 2014/09/07 17:38:38 okan Exp $
*/
#ifndef _CALMWM_H_
@ -430,9 +430,9 @@ void search_match_text(struct menu_q *, struct menu_q *,
char *);
void search_print_client(struct menu *, int);
struct screen_ctx *screen_find(Window);
struct geom screen_find_xinerama(struct screen_ctx *,
int, int, int);
struct screen_ctx *screen_fromroot(Window);
void screen_init(int);
void screen_update_geometry(struct screen_ctx *);
void screen_updatestackingorder(struct screen_ctx *);

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: client.c,v 1.174 2014/08/25 12:49:19 okan Exp $
* $OpenBSD: client.c,v 1.175 2014/09/07 17:38:38 okan Exp $
*/
#include <sys/param.h>
@ -68,7 +68,7 @@ client_init(Window win, struct screen_ctx *sc)
return (NULL);
if (sc == NULL) {
sc = screen_fromroot(wattr.root);
sc = screen_find(wattr.root);
mapped = 1;
} else {
if (wattr.override_redirect || wattr.map_state != IsViewable)

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: screen.c,v 1.64 2014/08/24 15:37:45 okan Exp $
* $OpenBSD: screen.c,v 1.65 2014/09/07 17:38:38 okan Exp $
*/
#include <sys/param.h>
@ -79,12 +79,12 @@ screen_init(int which)
}
struct screen_ctx *
screen_fromroot(Window rootwin)
screen_find(Window win)
{
struct screen_ctx *sc;
TAILQ_FOREACH(sc, &Screenq, entry)
if (sc->rootwin == rootwin)
if (sc->rootwin == win)
return (sc);
/* XXX FAIL HERE */

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: xevents.c,v 1.112 2014/09/06 16:08:58 okan Exp $
* $OpenBSD: xevents.c,v 1.113 2014/09/07 17:38:38 okan Exp $
*/
/*
@ -239,7 +239,7 @@ xev_handle_buttonpress(XEvent *ee)
if (e->window != e->root)
return;
cc = &fakecc;
cc->sc = screen_fromroot(e->window);
cc->sc = screen_find(e->window);
}
(*mb->callback)(cc, &mb->argument);
@ -289,7 +289,7 @@ xev_handle_keypress(XEvent *ee)
return;
} else {
cc = &fakecc;
cc->sc = screen_fromroot(e->window);
cc->sc = screen_find(e->window);
}
(*kb->callback)(cc, &kb->argument);
@ -306,7 +306,7 @@ xev_handle_keyrelease(XEvent *ee)
KeySym keysym;
unsigned int i;
sc = screen_fromroot(e->root);
sc = screen_find(e->root);
keysym = XkbKeycodeToKeysym(X_Dpy, e->keycode, 0, 0);
for (i = 0; i < nitems(modkeys); i++) {
@ -324,7 +324,7 @@ xev_handle_clientmessage(XEvent *ee)
struct client_ctx *cc, *old_cc;
struct screen_ctx *sc;
sc = screen_fromroot(e->window);
sc = screen_find(e->window);
if ((cc = client_find(e->window)) == NULL && e->window != sc->rootwin)
return;