]> git.lizzy.rs Git - bspwm.git/commitdiff
*Frames* are unnecessary
authorBastien Dejean <nihilhill@gmail.com>
Fri, 27 Dec 2013 09:43:37 +0000 (10:43 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Fri, 27 Dec 2013 09:43:37 +0000 (10:43 +0100)
The padding settings are sufficient for this.

18 files changed:
Sourcedeps
contrib/bash_completion
contrib/create_frame.c [deleted file]
contrib/zsh_completion
doc/bspwm.1
doc/bspwm.1.txt
events.c
events.h
messages.c
query.c
restore.c
rule.c
settings.c
settings.h
tree.c
types.h
window.c
window.h

index d22d6cf5eafa12f5e3659996bd145e2a383daed6..50b37a122aec384119f9cc74b53acec6a723dfdd 100644 (file)
@@ -19,7 +19,7 @@ pointer.o: pointer.c bspwm.h types.h helpers.h query.h settings.h stack.h \
 query.o: query.c bspwm.h types.h helpers.h desktop.h history.h messages.h \
  monitor.h tree.h query.h
 restore.o: restore.c bspwm.h types.h helpers.h desktop.h ewmh.h history.h \
- monitor.h window.h query.h stack.h tree.h restore.h
+ monitor.h window.h query.h stack.h tree.h settings.h restore.h
 rule.o: rule.c bspwm.h types.h helpers.h ewmh.h window.h messages.h \
  settings.h query.h rule.h
 settings.o: settings.c bspwm.h types.h helpers.h settings.h
index 0f3e301d615499fc637ffc0e09b97c8c66698fcf..9adbf4104fac6a02aa2d972ef467d3aa14c25195 100644 (file)
@@ -1,7 +1,7 @@
 _bspc() {
     local commands='window desktop monitor query pointer rule restore control config quit'
 
-    local settings='external_rules_command status_prefix focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_border_color focused_sticky_border_color normal_sticky_border_color focused_private_border_color active_private_border_color normal_private_border_color urgent_border_color focused_frame_opacity active_frame_opacity normal_frame_opacity border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio growth_factor borderless_monocle gapless_monocle focus_follows_pointer pointer_follows_monitor apply_floating_atom auto_alternate auto_cancel history_aware_focus ignore_ewmh_focus remove_disabled_monitor'
+    local settings='external_rules_command status_prefix focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_border_color focused_sticky_border_color normal_sticky_border_color focused_private_border_color active_private_border_color normal_private_border_color urgent_border_color border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio growth_factor borderless_monocle gapless_monocle focus_follows_pointer pointer_follows_monitor apply_floating_atom auto_alternate auto_cancel history_aware_focus ignore_ewmh_focus remove_disabled_monitor'
 
     COMPREPLY=()
 
diff --git a/contrib/create_frame.c b/contrib/create_frame.c
deleted file mode 100644 (file)
index 6136eee..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <stdlib.h>
-#include <stdbool.h>
-#include <string.h>
-#include <xcb/xcb.h>
-#include <xcb/xcb_event.h>
-#include <xcb/xcb_icccm.h>
-
-#define FRAME_CLASS_NAME     "BSPWM_FRAME"
-#define FRAME_INSTANCE_NAME  "bspwm_frame"
-
-xcb_connection_t *dpy;
-
-bool get_atom(char *name, xcb_atom_t *atom)
-{
-    bool ack = true;
-    xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(dpy, xcb_intern_atom(dpy, 0, strlen(name), name), NULL);
-    if (reply != NULL)
-        *atom = reply->atom;
-    else
-        ack = false;
-    free(reply);
-    return ack;
-}
-
-int main(int argc, char *argv[])
-{
-    dpy = xcb_connect(NULL, NULL);
-    if (dpy == NULL)
-        return EXIT_FAILURE;
-    xcb_atom_t WM_PROTOCOLS, WM_DELETE_WINDOW;
-    if (!get_atom("WM_PROTOCOLS", &WM_PROTOCOLS)
-            || !get_atom("WM_DELETE_WINDOW", &WM_DELETE_WINDOW)) {
-        xcb_disconnect(dpy);
-        return EXIT_FAILURE;
-    }
-    xcb_screen_t *screen = xcb_setup_roots_iterator(xcb_get_setup(dpy)).data;
-    if (screen == NULL)
-        return EXIT_FAILURE;
-    xcb_window_t root = screen->root;
-    xcb_window_t win = xcb_generate_id(dpy);
-    xcb_create_window(dpy, XCB_COPY_FROM_PARENT, win, root, 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, 0, NULL);
-    xcb_icccm_set_wm_class(dpy, win, strlen(FRAME_CLASS_NAME) + strlen(FRAME_INSTANCE_NAME) + 1, FRAME_INSTANCE_NAME "\0" FRAME_CLASS_NAME);
-    xcb_map_window(dpy, win);
-    xcb_flush(dpy);
-    xcb_generic_event_t *evt;
-    bool running = true;
-    while (running && (evt = xcb_wait_for_event(dpy)) != NULL) {
-        uint8_t rt = XCB_EVENT_RESPONSE_TYPE(evt);
-        if (rt == XCB_CLIENT_MESSAGE)  {
-            xcb_client_message_event_t *cme = (xcb_client_message_event_t *) evt;
-            if (cme->type == WM_PROTOCOLS && cme->data.data32[0] == WM_DELETE_WINDOW)
-                running = false;
-        }
-        free(evt);
-    }
-    xcb_destroy_window(dpy, win);
-    xcb_disconnect(dpy);
-    return EXIT_SUCCESS;
-}
index e48fa8d4f2bc25d429c04ef52f536543d68b0091..7e971f6a4417149865d4f203102e2399c4d6192b 100644 (file)
@@ -3,7 +3,7 @@
 _bspc() {
     local -a commands settings
     commands=('window' 'desktop' 'monitor' 'query' 'pointer' 'rule' 'restore' 'control' 'config' 'quit')
-    settings=('external_rules_command' 'status_prefix' 'focused_border_color' 'active_border_color' 'normal_border_color' 'presel_border_color' 'focused_locked_border_color' 'active_locked_border_color' 'normal_locked_border_color' 'focused_sticky_border_color' 'normal_sticky_border_color' 'focused_private_border_color' 'active_private_border_color' 'normal_private_border_color' 'urgent_border_color' 'focused_frame_opacity' 'active_frame_opacity' 'normal_frame_opacity' 'border_width' 'window_gap' 'top_padding' 'right_padding' 'bottom_padding' 'left_padding' 'split_ratio' 'growth_factor' 'borderless_monocle' 'gapless_monocle' 'focus_follows_pointer' 'pointer_follows_monitor' 'apply_floating_atom' 'auto_alternate' 'auto_cancel' 'history_aware_focus' 'ignore_ewmh_focus' 'remove_disabled_monitor')
+    settings=('external_rules_command' 'status_prefix' 'focused_border_color' 'active_border_color' 'normal_border_color' 'presel_border_color' 'focused_locked_border_color' 'active_locked_border_color' 'normal_locked_border_color' 'focused_sticky_border_color' 'normal_sticky_border_color' 'focused_private_border_color' 'active_private_border_color' 'normal_private_border_color' 'urgent_border_color' 'border_width' 'window_gap' 'top_padding' 'right_padding' 'bottom_padding' 'left_padding' 'split_ratio' 'growth_factor' 'borderless_monocle' 'gapless_monocle' 'focus_follows_pointer' 'pointer_follows_monitor' 'apply_floating_atom' 'auto_alternate' 'auto_cancel' 'history_aware_focus' 'ignore_ewmh_focus' 'remove_disabled_monitor')
     if (( CURRENT == 2 )) ; then
         _values 'command' "$commands[@]"
     elif (( CURRENT == 3 )) ; then
index 28dc7bd3c6285fa1430addc05c0c3d36031d02a9..fdc5be709e50c681250934e6a8e3ae7e124e2194 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: bspwm
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 12/25/2013
+.\"      Date: 12/27/2013
 .\"    Manual: Bspwm Manual
 .\"    Source: Bspwm 0.8.7
 .\"  Language: English
 .\"
-.TH "BSPWM" "1" "12/25/2013" "Bspwm 0\&.8\&.7" "Bspwm Manual"
+.TH "BSPWM" "1" "12/27/2013" "Bspwm 0\&.8\&.7" "Bspwm Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -876,7 +876,7 @@ rule \fIOPTIONS\fR
 \fBOptions\fR
 .RS 4
 .PP
-\fB\-a\fR, \fB\-\-add\fR <class_name>|<instance_name>|* [\fB\-o\fR|\fB\-\-one\-shot\fR] [desktop=DESKTOP_SEL|monitor=MONITOR_SEL] [(floating|fullscreen|locked|sticky|private|frame|center|lower|follow|manage|focus)=(true|false)]
+\fB\-a\fR, \fB\-\-add\fR <class_name>|<instance_name>|* [\fB\-o\fR|\fB\-\-one\-shot\fR] [desktop=DESKTOP_SEL|monitor=MONITOR_SEL] [(floating|fullscreen|locked|sticky|private|center|lower|follow|manage|focus)=(true|false)]
 .RS 4
 Create a new rule\&.
 .RE
@@ -1000,21 +1000,6 @@ Color of the border of an unfocused private window\&.
 Color of the border of an urgent window\&.
 .RE
 .PP
-\fIfocused_frame_opacity\fR
-.RS 4
-Opacity of a focused frame of a focused monitor\&.
-.RE
-.PP
-\fIactive_frame_opacity\fR
-.RS 4
-Opacity of a focused frame of an unfocused monitor\&.
-.RE
-.PP
-\fInormal_frame_opacity\fR
-.RS 4
-Opacity of an unfocused frame\&.
-.RE
-.PP
 \fIsplit_ratio\fR
 .RS 4
 Default split ratio\&.
index b055d9a3f94a62cf5e887cfc0e827a47511717ae..e294f605be16650fb7cc73441a38598761bcb3f0 100644 (file)
@@ -538,7 +538,7 @@ rule 'OPTIONS'
 Options
 ^^^^^^^
 
-*-a*, *--add* <class_name>|<instance_name>|* [*-o*|*--one-shot*] [desktop=DESKTOP_SEL|monitor=MONITOR_SEL] [(floating|fullscreen|locked|sticky|private|frame|center|lower|follow|manage|focus)=(true|false)]::
+*-a*, *--add* <class_name>|<instance_name>|* [*-o*|*--one-shot*] [desktop=DESKTOP_SEL|monitor=MONITOR_SEL] [(floating|fullscreen|locked|sticky|private|center|lower|follow|manage|focus)=(true|false)]::
     Create a new rule.
 
 *-r*, *--remove* ^<n>|head|tail|<class_name>|<instance_name>|*...::
@@ -616,15 +616,6 @@ Global Settings
 'urgent_border_color'::
     Color of the border of an urgent window.
 
-'focused_frame_opacity'::
-    Opacity of a focused frame of a focused monitor.
-
-'active_frame_opacity'::
-    Opacity of a focused frame of an unfocused monitor.
-
-'normal_frame_opacity'::
-    Opacity of an unfocused frame.
-
 'split_ratio'::
     Default split ratio.
 
index c50cafe2d3400bddd37f299b96d8cecbc1ca7569..4e8bbf5033aaed6d0ea4ff4724da9fc7e7bea70b 100644 (file)
--- a/events.c
+++ b/events.c
@@ -63,9 +63,6 @@ void handle_event(xcb_generic_event_t *evt)
         case XCB_FOCUS_IN:
             focus_in(evt);
             break;
-        case XCB_EXPOSE:
-            expose(evt);
-            break;
         default:
             if (randr && resp_type == randr_base + XCB_RANDR_SCREEN_CHANGE_NOTIFY)
                 import_monitors();
@@ -267,17 +264,6 @@ void focus_in(xcb_generic_event_t *evt)
         update_input_focus();
 }
 
-void expose(xcb_generic_event_t *evt)
-{
-    xcb_expose_event_t *e = (xcb_expose_event_t *) evt;
-
-    PRINTF("expose %X\n", e->window);
-
-    coordinates_t loc;
-    if (locate_window(e->window, &loc) && loc.node->client->frame)
-        draw_frame_background(loc.node, loc.desktop->focus == loc.node, loc.monitor == mon);
-}
-
 void enter_notify(xcb_generic_event_t *evt)
 {
     xcb_enter_notify_event_t *e = (xcb_enter_notify_event_t *) evt;
index 096db5b750fac0020c0c013419ddb8e9fee88820..7812dadf7d7a456939479e2da9089fe868829856 100644 (file)
--- a/events.h
+++ b/events.h
@@ -40,7 +40,6 @@ void unmap_notify(xcb_generic_event_t *evt);
 void property_notify(xcb_generic_event_t *evt);
 void client_message(xcb_generic_event_t *evt);
 void focus_in(xcb_generic_event_t *evt);
-void expose(xcb_generic_event_t *evt);
 void enter_notify(xcb_generic_event_t *evt);
 void motion_notify(xcb_generic_event_t *evt);
 void handle_state(monitor_t *m, desktop_t *d, node_t *n, xcb_atom_t state, unsigned int action);
index e004a7504a70dd96ae3a2bd40cce8de950c663df..cb43a1984e6c22f2f2a20aaf446baa17ca338fc8 100644 (file)
@@ -911,17 +911,6 @@ bool set_setting(coordinates_t loc, char *name, char *value)
         else
             return false;
         return true;
-#define SETOPACITY(s) \
-    } else if (streq(#s, name)) { \
-        double o; \
-        if (sscanf(value, "%lf", &o) == 1 && o >= 0 && o <= 1) \
-            s = o; \
-        else \
-            return false;
-    SETOPACITY(focused_frame_opacity)
-    SETOPACITY(active_frame_opacity)
-    SETOPACITY(normal_frame_opacity)
-#undef SETOPACITY
 #define SETCOLOR(s) \
     } else if (streq(#s, name)) { \
         snprintf(s, sizeof(s), "%s", value);
@@ -947,7 +936,7 @@ bool set_setting(coordinates_t loc, char *name, char *value)
             for (monitor_t *m = mon_head; m != NULL; m = m->next)
                 for (desktop_t *d = m->desk_head; d != NULL; d = d->next)
                     for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n, d->root)) {
-                        uint32_t values[] = {get_event_mask(n->client)};
+                        uint32_t values[] = {CLIENT_EVENT_MASK | (focus_follows_pointer ? XCB_EVENT_MASK_ENTER_WINDOW : 0)};
                         xcb_change_window_attributes(dpy, n->client->window, XCB_CW_EVENT_MASK, values);
                     }
             if (focus_follows_pointer) {
@@ -1019,13 +1008,6 @@ bool get_setting(coordinates_t loc, char *name, char* rsp)
     DESKGET(bottom_padding)
     DESKGET(left_padding)
 #undef DESKGET
-#define GETOPACITY(s) \
-    else if (streq(#s, name)) \
-        snprintf(rsp, BUFSIZ, "%lf", s);
-    GETOPACITY(focused_frame_opacity)
-    GETOPACITY(active_frame_opacity)
-    GETOPACITY(normal_frame_opacity)
-#undef GETOPACITY
 #define GETCOLOR(s) \
     else if (streq(#s, name)) \
         snprintf(rsp, BUFSIZ, "%s", s);
diff --git a/query.c b/query.c
index 210ddb3c516ca3489ee246f06548408500d8a6ab..71873acebe425fbd63c4bd1e9fd07f14ca382cc3 100644 (file)
--- a/query.c
+++ b/query.c
@@ -90,7 +90,7 @@ void query_tree(desktop_t *d, node_t *n, char *rsp, unsigned int depth)
 
     if (is_leaf(n)) {
         client_t *c = n->client;
-        snprintf(line, sizeof(line), "%c %s 0x%X %u %ux%u%+i%+i %c %c%c%c%c%c%c%c%c%c", (n->birth_rotation == 90 ? 'a' : (n->birth_rotation == 270 ? 'c' : 'm')), c->class_name, c->window, c->border_width, c->floating_rectangle.width, c->floating_rectangle.height, c->floating_rectangle.x, c->floating_rectangle.y, (n->split_dir == DIR_UP ? 'U' : (n->split_dir == DIR_RIGHT ? 'R' : (n->split_dir == DIR_DOWN ? 'D' : 'L'))), (c->floating ? 'f' : '-'), (c->transient ? 't' : '-'), (c->fullscreen ? 'F' : '-'), (c->urgent ? 'u' : '-'), (c->locked ? 'l' : '-'), (c->sticky ? 's' : '-'), (c->frame ? 'e' : '-'), (c->private ? 'i' : '-'), (n->split_mode ? 'p' : '-'));
+        snprintf(line, sizeof(line), "%c %s 0x%X %u %ux%u%+i%+i %c %c%c%c%c%c%c%c%c", (n->birth_rotation == 90 ? 'a' : (n->birth_rotation == 270 ? 'c' : 'm')), c->class_name, c->window, c->border_width, c->floating_rectangle.width, c->floating_rectangle.height, c->floating_rectangle.x, c->floating_rectangle.y, (n->split_dir == DIR_UP ? 'U' : (n->split_dir == DIR_RIGHT ? 'R' : (n->split_dir == DIR_DOWN ? 'D' : 'L'))), (c->floating ? 'f' : '-'), (c->transient ? 't' : '-'), (c->fullscreen ? 'F' : '-'), (c->urgent ? 'u' : '-'), (c->locked ? 'l' : '-'), (c->sticky ? 's' : '-'), (c->private ? 'i' : '-'), (n->split_mode ? 'p' : '-'));
     } else {
         snprintf(line, sizeof(line), "%c %c %lf", (n->split_type == TYPE_HORIZONTAL ? 'H' : 'V'), (n->birth_rotation == 90 ? 'a' : (n->birth_rotation == 270 ? 'c' : 'm')), n->split_ratio);
     }
index aa2dcc99ea38547c55b083e9bbdf8bbb1ab0d5fc..2f7ff07b5d0ec2dbfc6944284c0ea0e294d3d102 100644 (file)
--- a/restore.c
+++ b/restore.c
@@ -33,6 +33,7 @@
 #include "query.h"
 #include "stack.h"
 #include "tree.h"
+#include "settings.h"
 #include "restore.h"
 
 void restore_tree(char *file_path)
@@ -133,15 +134,14 @@ void restore_tree(char *file_path)
             } else {
                 client_t *c = make_client(XCB_NONE);
                 num_clients++;
-                char floating, transient, fullscreen, urgent, locked, sticky, frame, private, sd, sm, end = 0;
-                sscanf(line + level, "%c %s %X %u %hux%hu%hi%hi %c %c%c%c%c%c%c%c%c%c %c", &br, c->class_name, &c->window, &c->border_width, &c->floating_rectangle.width, &c->floating_rectangle.height, &c->floating_rectangle.x, &c->floating_rectangle.y, &sd, &floating, &transient, &fullscreen, &urgent, &locked, &sticky, &frame, &private, &sm, &end);
+                char floating, transient, fullscreen, urgent, locked, sticky, private, sd, sm, end = 0;
+                sscanf(line + level, "%c %s %X %u %hux%hu%hi%hi %c %c%c%c%c%c%c%c%c %c", &br, c->class_name, &c->window, &c->border_width, &c->floating_rectangle.width, &c->floating_rectangle.height, &c->floating_rectangle.x, &c->floating_rectangle.y, &sd, &floating, &transient, &fullscreen, &urgent, &locked, &sticky, &private, &sm, &end);
                 c->floating = (floating == '-' ? false : true);
                 c->transient = (transient == '-' ? false : true);
                 c->fullscreen = (fullscreen == '-' ? false : true);
                 c->urgent = (urgent == '-' ? false : true);
                 c->locked = (locked == '-' ? false : true);
                 c->sticky = (sticky == '-' ? false : true);
-                c->frame = (frame == '-' ? false : true);
                 c->private = (private == '-' ? false : true);
                 n->split_mode = (sm == '-' ? MODE_AUTOMATIC : MODE_MANUAL);
                 if (sd == 'U')
@@ -173,7 +173,7 @@ void restore_tree(char *file_path)
     for (monitor_t *m = mon_head; m != NULL; m = m->next)
         for (desktop_t *d = m->desk_head; d != NULL; d = d->next)
             for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n, d->root)) {
-                uint32_t values[] = {get_event_mask(n->client)};
+                uint32_t values[] = {CLIENT_EVENT_MASK | (focus_follows_pointer ? XCB_EVENT_MASK_ENTER_WINDOW : 0)};
                 xcb_change_window_attributes(dpy, n->client->window, XCB_CW_EVENT_MASK, values);
                 if (n->client->floating) {
                     n->vacant = true;
diff --git a/rule.c b/rule.c
index e7ca0b1ddf880623783e7c5c4ec637917d1847c0..13d3566940a3893718df4546c82a1470864b9175 100644 (file)
--- a/rule.c
+++ b/rule.c
@@ -280,7 +280,6 @@ void parse_key_value(char *key, char *value, rule_consequence_t *csq)
         SETCSQ(locked)
         SETCSQ(sticky)
         SETCSQ(private)
-        SETCSQ(frame)
         SETCSQ(center)
         SETCSQ(lower)
         SETCSQ(follow)
index 7dcaa94d124c5ffb7648779806a024f8b8d24b2c..e2507056bd65a8e1c0cab0bfbeb780fb711f5163 100644 (file)
@@ -57,10 +57,6 @@ void load_settings(void)
     snprintf(normal_private_border_color, sizeof(normal_private_border_color), "%s", NORMAL_PRIVATE_BORDER_COLOR);
     snprintf(urgent_border_color, sizeof(urgent_border_color), "%s", URGENT_BORDER_COLOR);
 
-    focused_frame_opacity = FOCUSED_FRAME_OPACITY;
-    active_frame_opacity = ACTIVE_FRAME_OPACITY;
-    normal_frame_opacity = NORMAL_FRAME_OPACITY;
-
     split_ratio = SPLIT_RATIO;
     growth_factor = GROWTH_FACTOR;
 
index e747547973009d250254c4de24c1870204f0705f..90e2e00dd1216495f8b84d50182401ee40fc0324 100644 (file)
 #define NORMAL_PRIVATE_BORDER_COLOR   "#34322E"
 #define URGENT_BORDER_COLOR           "#EFA29A"
 
-#define FOCUSED_FRAME_OPACITY       0.5
-#define ACTIVE_FRAME_OPACITY        0.25
-#define NORMAL_FRAME_OPACITY        0.125
-
 #define SPLIT_RATIO    0.5
 #define GROWTH_FACTOR  1.1
 
@@ -84,10 +80,6 @@ char active_private_border_color[MAXLEN];
 char normal_private_border_color[MAXLEN];
 char urgent_border_color[MAXLEN];
 
-double focused_frame_opacity;
-double active_frame_opacity;
-double normal_frame_opacity;
-
 double split_ratio;
 double growth_factor;
 
diff --git a/tree.c b/tree.c
index 0416676227bf8aabebefeaec6fdf7672d35c9ac5..514e73860c10d151f92cc1424da616da6bbe7854 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -62,8 +62,7 @@ void apply_layout(monitor_t *m, desktop_t *d, node_t *n, xcb_rectangle_t rect, x
     if (is_leaf(n)) {
 
         if ((borderless_monocle && is_tiled(n->client) && d->layout == LAYOUT_MONOCLE)
-                || n->client->fullscreen
-                || n->client->frame)
+                || n->client->fullscreen)
             n->client->border_width = 0;
         else
             n->client->border_width = d->border_width;
@@ -362,7 +361,7 @@ client_t *make_client(xcb_window_t win)
     c->border_width = BORDER_WIDTH;
     c->window = win;
     c->floating = c->transient = c->fullscreen = c->locked = c->sticky = c->urgent = false;
-    c->frame = c->private = c->icccm_focus = false;
+    c->private = c->icccm_focus = false;
     xcb_icccm_get_wm_protocols_reply_t protocols;
     if (xcb_icccm_get_wm_protocols_reply(dpy, xcb_icccm_get_wm_protocols(dpy, win, ewmh->WM_PROTOCOLS), &protocols, NULL) == 1) {
         if (has_proto(WM_TAKE_FOCUS, &protocols))
diff --git a/types.h b/types.h
index 71e5eb58b7f7ae30eed5d16783650b6f43d3016d..0d3d1ef5329882fbc53d579684401d2e27437a17 100644 (file)
--- a/types.h
+++ b/types.h
@@ -161,7 +161,6 @@ typedef struct {
     bool locked;       /* protects window from being closed */
     bool sticky;
     bool urgent;
-    bool frame;
     bool private;
     bool icccm_focus;
     xcb_rectangle_t floating_rectangle;
@@ -267,7 +266,6 @@ typedef struct {
     bool locked;
     bool sticky;
     bool private;
-    bool frame;
     bool center;
     bool lower;
     bool follow;
index 038bd432c1f7810f4accba1013ee9d504dd40ffd..3d4adfdbe7f058d0b3c6a4b34ac6e5e1efff4163 100644 (file)
--- a/window.c
+++ b/window.c
@@ -107,7 +107,6 @@ void manage_window(xcb_window_t win, rule_consequence_t *csq, int fd)
     translate_client(mm, m, c);
     if (csq->center)
         window_center(m, c);
-    c->frame = csq->frame;
 
     snprintf(c->class_name, sizeof(c->class_name), "%s", csq->class_name);
 
@@ -141,7 +140,7 @@ void manage_window(xcb_window_t win, rule_consequence_t *csq, int fd)
     else
         stack(n, STACK_ABOVE);
 
-    uint32_t values[] = {get_event_mask(n->client)};
+    uint32_t values[] = {CLIENT_EVENT_MASK | (focus_follows_pointer ? XCB_EVENT_MASK_ENTER_WINDOW : 0)};
     xcb_change_window_attributes(dpy, c->window, XCB_CW_EVENT_MASK, values);
 
     if (visible) {
@@ -179,12 +178,7 @@ void unmanage_window(xcb_window_t win)
 
 void window_draw_border(node_t *n, bool focused_window, bool focused_monitor)
 {
-    if (n == NULL || (n->client->border_width < 1 && !n->client->frame)) {
-        return;
-    }
-
-    if (n->client->frame) {
-        draw_frame_background(n, focused_window, focused_monitor);
+    if (n == NULL || n->client->border_width < 1) {
         return;
     }
 
@@ -258,58 +252,6 @@ void window_draw_border(node_t *n, bool focused_window, bool focused_monitor)
     }
 }
 
-void draw_frame_background(node_t *n, bool focused_window, bool focused_monitor)
-{
-    if (n == NULL)
-        return;
-
-    xcb_window_t win = n->client->window;
-    uint32_t border_color_pxl = get_border_color(n->client, focused_window, focused_monitor);
-    uint32_t opacity = (focused_window ? (focused_monitor ? focused_frame_opacity : active_frame_opacity) : normal_frame_opacity) * 0xffffffff;
-    xcb_change_property(dpy, XCB_PROP_MODE_REPLACE, win, _NET_WM_WINDOW_OPACITY, XCB_ATOM_CARDINAL, 32, 1, &opacity);
-    uint8_t win_depth = root_depth;
-    xcb_get_geometry_reply_t *geo = xcb_get_geometry_reply(dpy, xcb_get_geometry(dpy, win), NULL);
-    if (geo != NULL)
-        win_depth = geo->depth;
-    free(geo);
-    xcb_rectangle_t rectangle = get_rectangle(n->client);
-    rectangle.x = rectangle.y = 0;
-    uint16_t width = rectangle.width;
-    uint16_t height = rectangle.height;
-    xcb_pixmap_t pixmap = xcb_generate_id(dpy);
-    xcb_create_pixmap(dpy, win_depth, pixmap, win, width, height);
-    xcb_gcontext_t gc = xcb_generate_id(dpy);
-    xcb_create_gc(dpy, gc, pixmap, 0, NULL);
-    xcb_change_gc(dpy, gc, XCB_GC_FOREGROUND, &border_color_pxl);
-    xcb_poly_fill_rectangle(dpy, pixmap, gc, 1, &rectangle);
-    if (n->split_mode == MODE_MANUAL) {
-        xcb_rectangle_t presel_rectangle = rectangle;
-        uint32_t presel_border_color_pxl;
-        get_color(presel_border_color, win, &presel_border_color_pxl);
-        xcb_change_gc(dpy, gc, XCB_GC_FOREGROUND, &presel_border_color_pxl);
-        switch (n->split_dir) {
-            case DIR_UP:
-                presel_rectangle.height = n->split_ratio * rectangle.height;
-                break;
-            case DIR_RIGHT:
-                presel_rectangle.width = (1 - n->split_ratio) * rectangle.width;
-                presel_rectangle.x = rectangle.width - presel_rectangle.width;
-                break;
-            case DIR_DOWN:
-                presel_rectangle.height = (1 - n->split_ratio) * rectangle.height;
-                presel_rectangle.y = rectangle.height - presel_rectangle.height;
-                break;
-            case DIR_LEFT:
-                presel_rectangle.width = n->split_ratio * rectangle.width;
-                break;
-        }
-        xcb_poly_fill_rectangle(dpy, pixmap, gc, 1, &presel_rectangle);
-    }
-    xcb_copy_area(dpy, pixmap, win, gc, 0, 0, 0, 0, width, height);
-    xcb_free_gc(dpy, gc);
-    xcb_free_pixmap(dpy, pixmap);
-}
-
 pointer_state_t *make_pointer_state(void)
 {
     pointer_state_t *p = malloc(sizeof(pointer_state_t));
@@ -403,7 +345,7 @@ void window_kill(monitor_t *m, desktop_t *d, node_t *n)
 
 void set_fullscreen(node_t *n, bool value)
 {
-    if (n == NULL || n->client->frame || n->client->fullscreen == value)
+    if (n == NULL || n->client->fullscreen == value)
         return;
 
     client_t *c = n->client;
@@ -420,7 +362,7 @@ void set_fullscreen(node_t *n, bool value)
 
 void set_floating(node_t *n, bool value)
 {
-    if (n == NULL || n->client->transient || n->client->fullscreen || n->client->frame || n->client->floating == value)
+    if (n == NULL || n->client->transient || n->client->fullscreen || n->client->floating == value)
         return;
 
     PRINTF("floating %X: %s\n", n->client->window, BOOLSTR(value));
@@ -799,8 +741,3 @@ void send_client_message(xcb_window_t win, xcb_atom_t property, xcb_atom_t value
 
     xcb_send_event(dpy, false, win, XCB_EVENT_MASK_NO_EVENT, (char *) &e);
 }
-
-uint32_t get_event_mask(client_t *c)
-{
-    return CLIENT_EVENT_MASK | (c->frame ? XCB_EVENT_MASK_EXPOSURE : 0) | (focus_follows_pointer ? XCB_EVENT_MASK_ENTER_WINDOW : 0);
-}
index d10be8095fd35d4363e80043af051b406a70a6a0..78d1983b606a5d254098f1ea3f7d2e6d28532a71 100644 (file)
--- a/window.h
+++ b/window.h
@@ -35,7 +35,6 @@ void schedule_window(xcb_window_t win);
 void manage_window(xcb_window_t win, rule_consequence_t *csq, int fd);
 void unmanage_window(xcb_window_t win);
 void window_draw_border(node_t *n, bool focused_window, bool focused_monitor);
-void draw_frame_background(node_t *n, bool focused_window, bool focused_monitor);
 pointer_state_t *make_pointer_state(void);
 bool contains(xcb_rectangle_t a, xcb_rectangle_t b);
 xcb_rectangle_t get_rectangle(client_t *c);
@@ -81,6 +80,5 @@ void get_atom(char *name, xcb_atom_t *atom);
 void set_atom(xcb_window_t win, xcb_atom_t atom, uint32_t value);
 bool has_proto(xcb_atom_t atom, xcb_icccm_get_wm_protocols_reply_t *protocols);
 void send_client_message(xcb_window_t win, xcb_atom_t property, xcb_atom_t value);
-uint32_t get_event_mask(client_t *c);
 
 #endif