diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2011-06-24 06:52:24 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2011-06-24 06:52:24 +0000 |
commit | 0f75f4f9fc7011fa01415da95b8c2e34c35101be (patch) | |
tree | 535a89fcf614213ad83ce3c85041254bd44484af /app/cwm | |
parent | ff7254245e2e456749227c5ffbc43163917d22d7 (diff) |
add 'normal' cursor and shuffle the others we use to make a bit more
sense and to be slightly less un-expected. from Alexander Polakov.
re-use 'normal' cursor now instead XC_hand1 for menu selection. i
really wish X had real docs and made sense.
ok on earlier diff with '?' removed (but it's back now) oga@
Diffstat (limited to 'app/cwm')
-rw-r--r-- | app/cwm/calmwm.c | 23 | ||||
-rw-r--r-- | app/cwm/calmwm.h | 8 | ||||
-rw-r--r-- | app/cwm/menu.c | 4 |
3 files changed, 18 insertions, 17 deletions
diff --git a/app/cwm/calmwm.c b/app/cwm/calmwm.c index 577ac8c33..a51910085 100644 --- a/app/cwm/calmwm.c +++ b/app/cwm/calmwm.c @@ -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.c,v 1.55 2011/06/24 05:58:51 okan Exp $ + * $OpenBSD: calmwm.c,v 1.56 2011/06/24 06:52:23 okan Exp $ */ #include <sys/param.h> @@ -35,11 +35,11 @@ Display *X_Dpy; -Cursor Cursor_move; -Cursor Cursor_resize; -Cursor Cursor_select; Cursor Cursor_default; +Cursor Cursor_move; +Cursor Cursor_normal; Cursor Cursor_question; +Cursor Cursor_resize; struct screen_ctx_q Screenq = TAILQ_HEAD_INITIALIZER(Screenq); struct client_ctx_q Clientq = TAILQ_HEAD_INITIALIZER(Clientq); @@ -120,6 +120,12 @@ x_setup(void) struct keybinding *kb; int i; + Cursor_default = XCreateFontCursor(X_Dpy, XC_X_cursor); + Cursor_move = XCreateFontCursor(X_Dpy, XC_fleur); + Cursor_normal = XCreateFontCursor(X_Dpy, XC_left_ptr); + Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow); + Cursor_resize = XCreateFontCursor(X_Dpy, XC_bottom_right_corner); + for (i = 0; i < ScreenCount(X_Dpy); i++) { sc = xcalloc(1, sizeof(*sc)); x_setupscreen(sc, i); @@ -132,12 +138,6 @@ x_setup(void) */ TAILQ_FOREACH(kb, &Conf.keybindingq, entry) conf_grab(&Conf, kb); - - Cursor_move = XCreateFontCursor(X_Dpy, XC_fleur); - Cursor_resize = XCreateFontCursor(X_Dpy, XC_bottom_right_corner); - Cursor_select = XCreateFontCursor(X_Dpy, XC_hand1); - Cursor_default = XCreateFontCursor(X_Dpy, XC_X_cursor); - Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow); } static void @@ -179,11 +179,12 @@ x_setupscreen(struct screen_ctx *sc, u_int which) xu_setwmname(sc); + rootattr.cursor = Cursor_normal; rootattr.event_mask = ChildMask|PropertyChangeMask|EnterWindowMask| LeaveWindowMask|ColormapChangeMask|ButtonMask; XChangeWindowAttributes(X_Dpy, sc->rootwin, - CWEventMask, &rootattr); + CWEventMask|CWCursor, &rootattr); /* Deal with existing clients. */ XQueryTree(X_Dpy, sc->rootwin, &w0, &w1, &wins, &nwins); diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index bb6aa868f..7f25c61bc 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -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.132 2011/06/24 06:09:26 okan Exp $ + * $OpenBSD: calmwm.h,v 1.133 2011/06/24 06:52:23 okan Exp $ */ #ifndef _CALMWM_H_ @@ -473,11 +473,11 @@ char *xstrdup(const char *); /* Externs */ extern Display *X_Dpy; -extern Cursor Cursor_move; -extern Cursor Cursor_resize; -extern Cursor Cursor_select; extern Cursor Cursor_default; +extern Cursor Cursor_move; +extern Cursor Cursor_normal; extern Cursor Cursor_question; +extern Cursor Cursor_resize; extern struct screen_ctx_q Screenq; extern struct client_ctx_q Clientq; diff --git a/app/cwm/menu.c b/app/cwm/menu.c index b2f980cfb..798710002 100644 --- a/app/cwm/menu.c +++ b/app/cwm/menu.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: menu.c,v 1.27 2011/05/11 13:53:51 okan Exp $ + * $OpenBSD: menu.c,v 1.28 2011/06/24 06:52:23 okan Exp $ */ #include <sys/param.h> @@ -405,7 +405,7 @@ menu_handle_move(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc) XFillRectangle(X_Dpy, sc->menuwin, sc->gc, 0, font_height(sc) * mc->prev, mc->width, font_height(sc)); if (mc->entry != -1) { - xu_ptr_regrab(MenuGrabMask, Cursor_select); + xu_ptr_regrab(MenuGrabMask, Cursor_normal); XFillRectangle(X_Dpy, sc->menuwin, sc->gc, 0, font_height(sc) * mc->entry, mc->width, font_height(sc)); } else |