]> git.lizzy.rs Git - bspwm.git/commitdiff
Revert "Cursor pointer feedbacks for 'grab_pointer'"
authorBastien Dejean <nihilhill@gmail.com>
Sat, 12 Jan 2013 10:12:17 +0000 (11:12 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Sat, 12 Jan 2013 10:12:17 +0000 (11:12 +0100)
This reverts commit e1e04bff2ea3ab6b8b1a736b53c2887fd36bd006.

Makefile
README.md
bspwm.c
bspwm.h
events.c
events.h
window.c
window.h

index 5700da1a04bd839b30c22dbb31274381421876a9..99a28f76cc4574956e5154d99f9e102ff747f70f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 0.4
 
 CC      = gcc
-LIBS    = -lm -lxcb -lxcb-icccm -lxcb-ewmh -lxcb-xinerama -lxcb-cursor
+LIBS    = -lm -lxcb -lxcb-icccm -lxcb-ewmh -lxcb-xinerama
 CFLAGS  = -std=c99 -pedantic -Wall -Wextra -D_POSIX_C_SOURCE=2 -DVERSION=\"$(VERSION)\"
 LDFLAGS = $(LIBS)
 
index 15165beaef87d11425ee9587277433986439bd7c..a97b9a4719ade632e15d8596d7350f37df75184c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -310,7 +310,6 @@ Multiple choices:
 - libxcb
 - xcb-util
 - xcb-util-wm
-- xcb-util-cursor
 
 ## Installation
 
diff --git a/bspwm.c b/bspwm.c
index 8839b82b750243d9d5723e59f30e1aef1755d572..21e1d1ee2bafffb6b10447393820bd6165651003 100644 (file)
--- a/bspwm.c
+++ b/bspwm.c
@@ -12,7 +12,6 @@
 #include <xcb/xcb.h>
 #include <xcb/xcb_event.h>
 #include <xcb/xcb_ewmh.h>
-#include <xcb/xcb_cursor.h>
 #include <xcb/xinerama.h>
 #include "types.h"
 #include "settings.h"
@@ -38,7 +37,6 @@ void cleanup(void)
     while (rule_head != NULL)
         remove_rule(rule_head);
     free(frozen_pointer);
-    xcb_cursor_context_free(cursor_context);
 }
 
 void register_events(void)
@@ -121,8 +119,6 @@ void setup(void)
     frozen_pointer = make_pointer_state();
     last_focused_window = XCB_NONE;
     save_pointer_position(&last_pointer_position);
-    if (xcb_cursor_context_new(&cursor_context, dpy) == -1)
-        warn("Couldn't create the cursor context.\n");
     split_mode = MODE_AUTOMATIC;
     visible = true;
     exit_status = 0;
diff --git a/bspwm.h b/bspwm.h
index dcebbeff154a2957b8bb59f5dcc270688d891ce4..9c8da08fadef5ef619ee2fdcf238cf34a8b66f0d 100644 (file)
--- a/bspwm.h
+++ b/bspwm.h
@@ -1,7 +1,6 @@
 #ifndef _BSPWM_H
 #define _BSPWM_H
 
-#include "xcb/xcb_cursor.h"
 #include "types.h"
 
 #define ROOT_EVENT_MASK        (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY)
@@ -34,7 +33,6 @@ rule_t *rule_tail;
 pointer_state_t *frozen_pointer;
 xcb_window_t last_focused_window;
 xcb_point_t last_pointer_position;
-xcb_cursor_context_t *cursor_context;
 
 int exit_status;
 
index 487d7338a03ca4379c751a8080c34efe91e31fb3..ec0c3de36ad5f3bd5f08f7c9abe238f42a093c53 100644 (file)
--- a/events.c
+++ b/events.c
@@ -306,24 +306,16 @@ void grab_pointer(pointer_action_t pac)
                     mid_x = c->floating_rectangle.x + (c->floating_rectangle.width / 2);
                     mid_y = c->floating_rectangle.y + (c->floating_rectangle.height / 2);
                     if (pos.x > mid_x) {
-                        if (pos.y > mid_y) {
+                        if (pos.y > mid_y)
                             frozen_pointer->corner = BOTTOM_RIGHT;
-                            window_set_cursor(loc.node->client->window, CURSOR_RESIZE_BR);
-                        } else {
+                        else
                             frozen_pointer->corner = TOP_RIGHT;
-                            window_set_cursor(loc.node->client->window, CURSOR_RESIZE_TR);
-                        }
                     } else {
-                        if (pos.y > mid_y) {
+                        if (pos.y > mid_y)
                             frozen_pointer->corner = BOTTOM_LEFT;
-                            window_set_cursor(loc.node->client->window, CURSOR_RESIZE_BL);
-                        } else {
+                        else
                             frozen_pointer->corner = TOP_LEFT;
-                            window_set_cursor(loc.node->client->window, CURSOR_RESIZE_TL);
-                        }
                     }
-                } else {
-                    window_set_cursor(loc.node->client->window, CURSOR_MOVE);
                 }
                 break;
             case ACTION_NONE:
@@ -407,7 +399,6 @@ void ungrab_pointer(void)
     if (frozen_pointer->action == ACTION_NONE)
         return;
 
-    window_set_cursor(frozen_pointer->node->client->window, CURSOR_NORMAL);
     update_floating_rectangle(frozen_pointer->node->client);
     monitor_t *m = underlying_monitor(frozen_pointer->node->client);
     if (m != NULL && m != frozen_pointer->monitor) {
index 476dc9fcd8ce30f13f3c0a1a029a5247ff5dc24b..6f61ad5c2b31591c401a612a487ebad3a848d198 100644 (file)
--- a/events.h
+++ b/events.h
@@ -1,13 +1,6 @@
 #ifndef _EVENTS_H
 #define _EVENTS_H
 
-#define CURSOR_NORMAL     "left_ptr"
-#define CURSOR_MOVE       "fleur"
-#define CURSOR_RESIZE_TL  "top_left_corner"
-#define CURSOR_RESIZE_TR  "top_right_corner"
-#define CURSOR_RESIZE_BR  "bottom_right_corner"
-#define CURSOR_RESIZE_BL  "bottom_left_corner"
-
 #include <xcb/xcb.h>
 #include <xcb/xcb_event.h>
 
index cf5c7d12a9f09719314c8dded84f8fe27d60a3e1..a02d42cfa89e427f4df583135b4e884844ac78f7 100644 (file)
--- a/window.c
+++ b/window.c
@@ -5,7 +5,6 @@
 #include <xcb/xcb.h>
 #include <xcb/xcb_event.h>
 #include <xcb/xcb_icccm.h>
-#include <xcb/xcb_cursor.h>
 #include "types.h"
 #include "tree.h"
 #include "bspwm.h"
@@ -499,13 +498,6 @@ void window_show(xcb_window_t win)
     window_set_visibility(win, true);
 }
 
-void window_set_cursor(xcb_window_t win, char *name)
-{
-    xcb_cursor_t cursor = xcb_cursor_load_cursor(cursor_context, name);
-    uint32_t values[] = {cursor};
-    xcb_change_window_attributes(dpy, win, XCB_CW_CURSOR, values);
-}
-
 void toggle_visibility(void)
 {
     visible = !visible;
index 379acc0d583b8f077cd397275864c16338b79de6..81daf430c2d8109652bd3239de46b5299e8502d1 100644 (file)
--- a/window.h
+++ b/window.h
@@ -31,7 +31,6 @@ void window_lower(xcb_window_t);
 void window_set_visibility(xcb_window_t, bool);
 void window_hide(xcb_window_t);
 void window_show(xcb_window_t);
-void window_set_cursor(xcb_window_t, char *);
 void toggle_visibility(void);
 uint32_t get_main_border_color(client_t *, bool, bool);
 void update_floating_rectangle(client_t *);