mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-05-19 09:30:24 -07:00
docs: update
This commit is contained in:
parent
274180f9ec
commit
b54620584a
@ -21,123 +21,95 @@ index 864c9a7..1525894 100644
|
|||||||
|
|
||||||
const char* menu[] = {"dmenu_run", 0};
|
const char* menu[] = {"dmenu_run", 0};
|
||||||
const char* term[] = {"st", 0};
|
const char* term[] = {"st", 0};
|
||||||
diff --git a/patches/sowm-rounded-corners.patch b/patches/sowm-rounded-corners.patch
|
diff --git a/sowm.c b/sowm.c
|
||||||
index a2a3554..6b0cd21 100644
|
index 1618a65..29794cb 100644
|
||||||
--- a/patches/sowm-rounded-corners.patch
|
--- a/sowm.c
|
||||||
+++ b/patches/sowm-rounded-corners.patch
|
+++ b/sowm.c
|
||||||
@@ -1,115 +0,0 @@
|
@@ -5,6 +5,7 @@
|
||||||
-diff --git a/Makefile b/Makefile
|
#include <X11/Xlib.h>
|
||||||
-index 2420660..d03d5e7 100644
|
#include <X11/XF86keysym.h>
|
||||||
---- a/Makefile
|
#include <X11/keysym.h>
|
||||||
-+++ b/Makefile
|
+#include <X11/extensions/shape.h>
|
||||||
-@@ -1,5 +1,5 @@
|
#include <stdlib.h>
|
||||||
- CFLAGS+= -std=c99 -Wall -Wno-deprecated-declarations -pedantic
|
#include <signal.h>
|
||||||
--LDADD+= -lX11
|
#include <unistd.h>
|
||||||
-+LDADD+= -lX11 -lXext
|
@@ -53,6 +54,7 @@ static void win_fs(Window w);
|
||||||
- LDFLAGS=
|
static void win_fs_current();
|
||||||
- PREFIX?= /usr
|
static void win_kill();
|
||||||
- BINDIR?= $(PREFIX)/bin
|
static void win_next();
|
||||||
-diff --git a/config.h b/config.h
|
+static void win_round_corners(Window w, int rad);
|
||||||
-index 864c9a7..1525894 100644
|
static void win_to_ws(const Arg arg);
|
||||||
---- a/config.h
|
static void ws_go(const Arg arg);
|
||||||
-+++ b/config.h
|
static void ws_save(int i);
|
||||||
-@@ -2,6 +2,7 @@
|
@@ -87,6 +89,8 @@ void notify_destroy(XEvent *e) {
|
||||||
- #define CONFIG_H
|
}
|
||||||
-
|
|
||||||
- #define MOD Mod4Mask
|
void notify_enter(XEvent *e) {
|
||||||
-+#define ROUND_CORNERS 20
|
+ while(XCheckTypedEvent(dis, EnterNotify, e));
|
||||||
-
|
+
|
||||||
- const char* menu[] = {"dmenu_run", 0};
|
if (e->xcrossing.window != root) FOC(e->xcrossing.window)
|
||||||
- const char* term[] = {"st", 0};
|
}
|
||||||
-diff --git a/sowm.c b/sowm.c
|
|
||||||
-index 1618a65..29794cb 100644
|
@@ -104,6 +108,8 @@ void notify_motion(XEvent *e) {
|
||||||
---- a/sowm.c
|
attr.y + (start.button==1 ? yd : 0),
|
||||||
-+++ b/sowm.c
|
attr.width + (start.button==3 ? xd : 0),
|
||||||
-@@ -5,6 +5,7 @@
|
attr.height + (start.button==3 ? yd : 0));
|
||||||
- #include <X11/Xlib.h>
|
+
|
||||||
- #include <X11/XF86keysym.h>
|
+ win_round_corners(start.subwindow, ROUND_CORNERS);
|
||||||
- #include <X11/keysym.h>
|
}
|
||||||
-+#include <X11/extensions/shape.h>
|
|
||||||
- #include <stdlib.h>
|
for WIN if (c->win == start.subwindow) c->f = 0;
|
||||||
- #include <signal.h>
|
@@ -219,7 +225,45 @@ void win_fs(Window w) {
|
||||||
- #include <unistd.h>
|
|
||||||
-@@ -53,6 +54,7 @@ static void win_fs(Window w);
|
} else
|
||||||
- static void win_fs_current();
|
XMoveResizeWindow(dis, w, c->a.x, c->a.y, c->a.width, c->a.height);
|
||||||
- static void win_kill();
|
+
|
||||||
- static void win_next();
|
+ win_round_corners(w, c->f ? 0 : ROUND_CORNERS);
|
||||||
-+static void win_round_corners(Window w, int rad);
|
+ }
|
||||||
- static void win_to_ws(const Arg arg);
|
+}
|
||||||
- static void ws_go(const Arg arg);
|
+
|
||||||
- static void ws_save(int i);
|
+void win_round_corners(Window w, int rad) {
|
||||||
-@@ -87,6 +89,8 @@ void notify_destroy(XEvent *e) {
|
+ XWindowAttributes attr2;
|
||||||
- }
|
+ XGetWindowAttributes(dis, w, &attr2);
|
||||||
-
|
+
|
||||||
- void notify_enter(XEvent *e) {
|
+ int dia = 2 * rad;
|
||||||
-+ while(XCheckTypedEvent(dis, EnterNotify, e));
|
+ int ww = attr2.width;
|
||||||
-+
|
+ int wh = attr2.height;
|
||||||
- if (e->xcrossing.window != root) FOC(e->xcrossing.window)
|
+
|
||||||
- }
|
+ if (ww < dia || wh < dia) return;
|
||||||
-
|
+
|
||||||
-@@ -104,6 +108,8 @@ void notify_motion(XEvent *e) {
|
+ Pixmap mask = XCreatePixmap(dis, w, ww, wh, 1);
|
||||||
- attr.y + (start.button==1 ? yd : 0),
|
+
|
||||||
- attr.width + (start.button==3 ? xd : 0),
|
+ if (!mask) return;
|
||||||
- attr.height + (start.button==3 ? yd : 0));
|
+
|
||||||
-+
|
+ XGCValues xgcv;
|
||||||
-+ win_round_corners(start.subwindow, ROUND_CORNERS);
|
+ GC shape_gc = XCreateGC(dis, mask, 0, &xgcv);
|
||||||
- }
|
+
|
||||||
-
|
+ if (!shape_gc) {
|
||||||
- for WIN if (c->win == start.subwindow) c->f = 0;
|
+ XFreePixmap(dis, mask);
|
||||||
-@@ -219,7 +225,45 @@ void win_fs(Window w) {
|
+ return;
|
||||||
-
|
}
|
||||||
- } else
|
+
|
||||||
- XMoveResizeWindow(dis, w, c->a.x, c->a.y, c->a.width, c->a.height);
|
+ XSetForeground(dis, shape_gc, 0);
|
||||||
-+
|
+ XFillRectangle(dis, mask, shape_gc, 0, 0, ww, wh);
|
||||||
-+ win_round_corners(w, c->f ? 0 : ROUND_CORNERS);
|
+ XSetForeground(dis, shape_gc, 1);
|
||||||
-+ }
|
+ XFillArc(dis, mask, shape_gc, 0, 0, dia, dia, 0, 23040);
|
||||||
-+}
|
+ XFillArc(dis, mask, shape_gc, ww-dia-1, 0, dia, dia, 0, 23040);
|
||||||
-+
|
+ XFillArc(dis, mask, shape_gc, 0, wh-dia-1, dia, dia, 0, 23040);
|
||||||
-+void win_round_corners(Window w, int rad) {
|
+ XFillArc(dis, mask, shape_gc, ww-dia-1, wh-dia-1, dia, dia, 0, 23040);
|
||||||
-+ XWindowAttributes attr2;
|
+ XFillRectangle(dis, mask, shape_gc, rad, 0, ww-dia, wh);
|
||||||
-+ XGetWindowAttributes(dis, w, &attr2);
|
+ XFillRectangle(dis, mask, shape_gc, 0, rad, ww, wh-dia);
|
||||||
-+
|
+ XShapeCombineMask(dis, w, ShapeBounding, 0, 0, mask, ShapeSet);
|
||||||
-+ int dia = 2 * rad;
|
+ XFreePixmap(dis, mask);
|
||||||
-+ int ww = attr2.width;
|
+ XFreeGC(dis, shape_gc);
|
||||||
-+ int wh = attr2.height;
|
}
|
||||||
-+
|
|
||||||
-+ if (ww < dia || wh < dia) return;
|
void win_to_ws(const Arg arg) {
|
||||||
-+
|
@@ -310,6 +354,7 @@ void map_request(XEvent *e) {
|
||||||
-+ Pixmap mask = XCreatePixmap(dis, w, ww, wh, 1);
|
EnterWindowMask|FocusChangeMask);
|
||||||
-+
|
win_center(w);
|
||||||
-+ if (!mask) return;
|
XMapWindow(dis, w);
|
||||||
-+
|
+ win_round_corners(w, ROUND_CORNERS);
|
||||||
-+ XGCValues xgcv;
|
FOC(w);
|
||||||
-+ GC shape_gc = XCreateGC(dis, mask, 0, &xgcv);
|
win_add(w);
|
||||||
-+
|
}
|
||||||
-+ if (!shape_gc) {
|
|
||||||
-+ XFreePixmap(dis, mask);
|
|
||||||
-+ return;
|
|
||||||
- }
|
|
||||||
-+
|
|
||||||
-+ XSetForeground(dis, shape_gc, 0);
|
|
||||||
-+ XFillRectangle(dis, mask, shape_gc, 0, 0, ww, wh);
|
|
||||||
-+ XSetForeground(dis, shape_gc, 1);
|
|
||||||
-+ XFillArc(dis, mask, shape_gc, 0, 0, dia, dia, 0, 23040);
|
|
||||||
-+ XFillArc(dis, mask, shape_gc, ww-dia-1, 0, dia, dia, 0, 23040);
|
|
||||||
-+ XFillArc(dis, mask, shape_gc, 0, wh-dia-1, dia, dia, 0, 23040);
|
|
||||||
-+ XFillArc(dis, mask, shape_gc, ww-dia-1, wh-dia-1, dia, dia, 0, 23040);
|
|
||||||
-+ XFillRectangle(dis, mask, shape_gc, rad, 0, ww-dia, wh);
|
|
||||||
-+ XFillRectangle(dis, mask, shape_gc, 0, rad, ww, wh-dia);
|
|
||||||
-+ XShapeCombineMask(dis, w, ShapeBounding, 0, 0, mask, ShapeSet);
|
|
||||||
-+ XFreePixmap(dis, mask);
|
|
||||||
-+ XFreeGC(dis, shape_gc);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- void win_to_ws(const Arg arg) {
|
|
||||||
-@@ -310,6 +354,7 @@ void map_request(XEvent *e) {
|
|
||||||
- EnterWindowMask|FocusChangeMask);
|
|
||||||
- win_center(w);
|
|
||||||
- XMapWindow(dis, w);
|
|
||||||
-+ win_round_corners(w, ROUND_CORNERS);
|
|
||||||
- FOC(w);
|
|
||||||
- win_add(w);
|
|
||||||
- }
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user