about summary refs log tree commit diff stats
path: root/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'event.c')
-rw-r--r--event.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/event.c b/event.c
index 72e9ccd..c89850a 100644
--- a/event.c
+++ b/event.c
@@ -208,6 +208,24 @@ configurerequest(XEvent *e) {
 }
 
 static void
+configurenotify(XEvent *e) {
+	Client *c;
+	XConfigureEvent *ev = &e->xconfigure;
+	XWindowChanges wc;
+
+	if (ev->window == root && (ev->width != sw || ev->height != sh)) {
+		sw = ev->width;
+		sh = ev->height;
+		wah = sh - bh;
+		waw = sw;
+		XFreePixmap(dpy, dc.drawable);
+		dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
+		XResizeWindow(dpy, barwin, sw, bh);
+		lt->arrange();
+	}
+}
+
+static void
 destroynotify(XEvent *e) {
 	Client *c;
 	XDestroyWindowEvent *ev = &e->xdestroywindow;
@@ -333,6 +351,7 @@ unmapnotify(XEvent *e) {
 void (*handler[LASTEvent]) (XEvent *) = {
 	[ButtonPress] = buttonpress,
 	[ConfigureRequest] = configurerequest,
+	[ConfigureNotify] = configurenotify,
 	[DestroyNotify] = destroynotify,
 	[EnterNotify] = enternotify,
 	[LeaveNotify] = leavenotify,
r: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
Profanity
Copyright (C) 2012 - 2016 James Booth <boothj5@gmail.com>

Profanity is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Profanity is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Profanity.  If not, see <http://www.gnu.org/licenses/>.

There is an additional exception from the author permitting linking
with OpenSSL:

As copyright holder, I give permission for profanity to be linked to
the OpenSSL libraries. This includes permission for profanity
binaries to be distributed linked against the OpenSSL libraries.
All other obligations under the GPL v3 remain intact.