summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2011-07-26 14:18:10 -0400
committerEamon Walsh <ewalsh@tycho.nsa.gov>2011-07-26 14:18:10 -0400
commit46aaf66b3b57d19a66634368922959666ac5d21f (patch)
tree832bcfadeb790069cf69ad2724c254211ea25eee
parentba1aaad0e07e3a1f168e59ffbeae92b202929845 (diff)
Revisions to track protocol and track program.
The SIBLING flag has been split into ABOVE and BELOW flags. This allows a view to be placed above or below a sibling view. MS-Windows support is the immediate motivation for this change.
-rw-r--r--doc/track_protocol.txt4
-rw-r--r--src/comm.c7
-rw-r--r--src/comm_structs.h7
-rw-r--r--src/track.c2
4 files changed, 13 insertions, 7 deletions
diff --git a/doc/track_protocol.txt b/doc/track_protocol.txt
index ea3e58d..dfe079e 100644
--- a/doc/track_protocol.txt
+++ b/doc/track_protocol.txt
@@ -35,8 +35,8 @@ set in the message:
LINPICKER_FLAG_TOPMOST: The view should be placed at the top/bottom of the
LINPICKER_FLAG_BOTMOST: stack with respect to the buffer's other views.
- LINPICKER_FLAG_SIBLING: The view should be placed above the view specified
- in the sibling field, which must exist.
+ LINPICKER_FLAG_ABOVE: The view should be placed above or below the view
+ LINPICKER_FLAG_BELOW: specified in the sibling field, which must exist.
LINPICKER_FLAG_HIDDEN: The view should be hidden or made visible.
LINPICKER_FLAG_SHOWN:
diff --git a/src/comm.c b/src/comm.c
index 2eee7ff..ff8c2fc 100644
--- a/src/comm.c
+++ b/src/comm.c
@@ -68,11 +68,16 @@ comm_do_update(struct client *c, struct buffer *b, struct view *v,
view_stack(v, VIEW_STACK_TOP, NULL);
else if (m->flags & LINPICKER_FLAG_BOTMOST)
view_stack(v, VIEW_STACK_BOTTOM, NULL);
- else if (m->flags & LINPICKER_FLAG_SIBLING) {
+ else if (m->flags & LINPICKER_FLAG_ABOVE) {
struct view *s = view_lookup(c, m->sibling);
if (s && s != v)
view_stack(v, VIEW_STACK_ABOVE, s);
}
+ else if (m->flags & LINPICKER_FLAG_BELOW) {
+ struct view *s = view_lookup(c, m->sibling);
+ if (s && s != v)
+ view_stack(v, VIEW_STACK_BELOW, s);
+ }
/* Set view visibility */
if (m->flags & LINPICKER_FLAG_SHOWN)
diff --git a/src/comm_structs.h b/src/comm_structs.h
index 7918ced..efa72f2 100644
--- a/src/comm_structs.h
+++ b/src/comm_structs.h
@@ -39,9 +39,10 @@
#define LINPICKER_FLAG_POSITION 1
#define LINPICKER_FLAG_TOPMOST 2
#define LINPICKER_FLAG_BOTMOST 4
-#define LINPICKER_FLAG_SIBLING 8
-#define LINPICKER_FLAG_HIDDEN 16
-#define LINPICKER_FLAG_SHOWN 32
+#define LINPICKER_FLAG_ABOVE 8
+#define LINPICKER_FLAG_BELOW 16
+#define LINPICKER_FLAG_HIDDEN 32
+#define LINPICKER_FLAG_SHOWN 64
struct lin_message {
uint32_t type;
diff --git a/src/track.c b/src/track.c
index f17ad8a..cd98893 100644
--- a/src/track.c
+++ b/src/track.c
@@ -223,7 +223,7 @@ x_event(xcb_connection_t *conn, xcb_window_t root, xcb_generic_event_t *ev)
con = (typeof(con))ev;
m.type = LINPICKER_UPDATE;
m.view = con->window;
- m.flags = LINPICKER_FLAG_POSITION | LINPICKER_FLAG_SIBLING;
+ m.flags = LINPICKER_FLAG_POSITION | LINPICKER_FLAG_ABOVE;
m.sibling = con->above_sibling;
m.x = con->x;
m.y = con->y;