summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorAndrew Shadura <andrewsh@debian.org>2016-04-29 15:52:16 +0200
committerAndrew Shadura <andrewsh@debian.org>2016-04-29 15:52:16 +0200
commitc6dd1ec3b3d71a979f106879669a15d94cfed6ef (patch)
tree9fbade96d39c5df18899e04889915ee3180d3c9d /cmd
parentcc0dafee5f33f4efc97b31ebb64f9a3459c0873b (diff)
Apply patches for dgit.debian/3.10_20120413+hg2813-9
Diffstat (limited to 'cmd')
-rw-r--r--cmd/menu/Makefile4
-rw-r--r--cmd/tray/Makefile4
-rw-r--r--cmd/tray/tray.c21
-rw-r--r--cmd/wihack.sh9
-rw-r--r--cmd/wmii/Makefile4
-rw-r--r--cmd/wmii/client.c2
-rw-r--r--cmd/wmii/column.c4
-rw-r--r--cmd/wmii/dat.h10
-rw-r--r--cmd/wmii/fns.h4
-rw-r--r--cmd/wmii/frame.c5
-rw-r--r--cmd/wmii/main.c48
-rw-r--r--cmd/wmii/message.c22
-rw-r--r--cmd/wmii/view.c41
-rw-r--r--cmd/wmiir.c4
-rw-r--r--cmd/x11/Makefile5
15 files changed, 152 insertions, 35 deletions
diff --git a/cmd/menu/Makefile b/cmd/menu/Makefile
index d8524c8..c4d62db 100644
--- a/cmd/menu/Makefile
+++ b/cmd/menu/Makefile
@@ -15,8 +15,8 @@ TAGFILES= dat.h $(ROOT)/include/*.h $(ROOT)/include/stuff/*.h
PACKAGES += $(X11PACKAGES)
-LIB = $(LIBS9) $(LIBIXP)
-LIBS += -lm
+LIB = $(LIBS9)
+LIBS += -lm $(LIBIXP)
OBJ = main \
caret \
history \
diff --git a/cmd/tray/Makefile b/cmd/tray/Makefile
index 2789c5d..a6e3c49 100644
--- a/cmd/tray/Makefile
+++ b/cmd/tray/Makefile
@@ -9,8 +9,8 @@ HFILES= dat.h fns.h selection.h
PACKAGES += $(X11PACKAGES)
-LIB = $(LIBS9) $(LIBIXP)
-LIBS += -lm
+LIB = $(LIBS9)
+LIBS += -lm $(LIBIXP)
OBJ = \
client \
ewmh \
diff --git a/cmd/tray/tray.c b/cmd/tray/tray.c
index dece602..1257996 100644
--- a/cmd/tray/tray.c
+++ b/cmd/tray/tray.c
@@ -55,6 +55,9 @@ restrut(Window *w, int orientation) {
ewmh_setstrut(w, strut);
}
+static bool
+root_config_event(Window *w, void *aux, XConfigureEvent *ev);
+
void
tray_init(void) {
WinAttr wa;
@@ -77,7 +80,7 @@ tray_init(void) {
sethandler(tray.win, &handlers);
pushhandler(&scr.root, &root_handlers, nil);
- selectinput(&scr.root, scr.root.eventmask | PropertyChangeMask);
+ selectinput(&scr.root, scr.root.eventmask | PropertyChangeMask | StructureNotifyMask);
changeprop_string(tray.win, "_WMII_TAGS", tray.tags);
@@ -99,6 +102,7 @@ tray_init(void) {
hints.flags = InputHint;
hints.input = false;
XSetWMHints(display, tray.win->xid, &hints);
+ root_config_event(nil, nil, nil);
tray_resize(tray.win->r);
}
@@ -409,6 +413,20 @@ static Handlers handlers = {
};
static bool
+root_config_event(Window *w, void *aux, XConfigureEvent *ev) {
+
+ USED(aux);
+ int i, n;
+ Rectangle *rects;
+
+ rects = xinerama_screens(&n);
+
+ scr.rect = rects[0];
+ tray_update();
+ return false;
+}
+
+static bool
property_event(Window *w, void *aux, XPropertyEvent *ev) {
if(ev->atom == NET("CURRENT_DESKTOP"))
tray_resize(tray.r);
@@ -418,6 +436,7 @@ property_event(Window *w, void *aux, XPropertyEvent *ev) {
}
static Handlers root_handlers = {
+ .config = root_config_event,
.property = property_event,
};
diff --git a/cmd/wihack.sh b/cmd/wihack.sh
index ae06ff0..10ced8c 100644
--- a/cmd/wihack.sh
+++ b/cmd/wihack.sh
@@ -7,12 +7,12 @@ usage() {
exit 1
}
-checkarg='[ ${#@} -gt 0 ] || usage'
+checkarg='[ $# -gt 0 ] || usage'
export WMII_HACK_TIME=$(date +%s)
-while [ ${#@} -gt 0 ]
+while [ "$1" != "" ]
do
- case $1 in
+ case "$1" in
-transient)
shift; eval $checkarg
export WMII_HACK_TRANSIENT=$1
@@ -36,8 +36,7 @@ eval $checkarg
if [ ! -u "`which $1`" -a ! -g "`which $1`" ]
then
- export LD_PRELOAD=libwmii_hack.so
- export LD_LIBRARY_PATH="@LIBDIR@${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"
+ export LD_PRELOAD="@LIBDIR@/libwmii_hack.so"
else
unset WMII_HACK_TRANSIENT WMII_HACK_TYPE WMII_HACK_TAGS
fi
diff --git a/cmd/wmii/Makefile b/cmd/wmii/Makefile
index b5d41c4..e527387 100644
--- a/cmd/wmii/Makefile
+++ b/cmd/wmii/Makefile
@@ -10,8 +10,8 @@ TAGFILES = dat.h
PACKAGES += $(X11PACKAGES) xext xrandr xrender xinerama
-LIB = $(LIBIXP) $(LIBS9)
-LIBS += -lm
+LIB = $(LIBS9)
+LIBS += -lm $(LIBIXP)
OBJ = area \
bar \
diff --git a/cmd/wmii/client.c b/cmd/wmii/client.c
index c119bd0..5a7224e 100644
--- a/cmd/wmii/client.c
+++ b/cmd/wmii/client.c
@@ -1,5 +1,5 @@
/* Copyright ©2004-2006 Anselm R. Garbe <garbeam at gmail dot com>
- * Copyright ©2006-2010 Kris Maglione <maglione.k at Gmail>
+ * Copyright ©2006-2014 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/column.c b/cmd/wmii/column.c
index 098e964..25a9567 100644
--- a/cmd/wmii/column.c
+++ b/cmd/wmii/column.c
@@ -1,5 +1,5 @@
/* Copyright ©2004-2006 Anselm R. Garbe <garbeam at gmail dot com>
- * Copyright ©2006-2010 Kris Maglione <maglione.k at Gmail>
+ * Copyright ©2006-2014 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
@@ -156,7 +156,7 @@ column_detach(Frame *f) {
if(first)
stack_scale(first, dy);
column_arrange(a, false);
- }else if(a->view->areas[a->screen]->next)
+ }else if(a->view->areas[a->screen]->next && !a->permanent)
column_destroy(a);
}
diff --git a/cmd/wmii/dat.h b/cmd/wmii/dat.h
index 1b32f9a..1a3fc3e 100644
--- a/cmd/wmii/dat.h
+++ b/cmd/wmii/dat.h
@@ -1,4 +1,4 @@
-/* Copyright ©2007-2010 Kris Maglione <jg@suckless.org>
+/* Copyright ©2007-2014 Kris Maglione <jg@suckless.org>
* See LICENSE file for license details.
*/
@@ -18,7 +18,11 @@
#include <stuff/util.h>
#include "debug.h"
-#define FONT "fixed"
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX 255
+#endif
+
+#define FONT "-*-fixed-medium-r-*-*-*-120-75-75-c-60-iso10646-"
#define FOCUSCOLORS "#000000 #81654f #000000"
#define NORMCOLORS "#000000 #c1c48b #81654f"
@@ -149,6 +153,7 @@ struct Area {
int mode;
int screen;
bool max;
+ bool permanent;
Rectangle r;
Rectangle r_old;
};
@@ -371,6 +376,7 @@ EXTERN long ignoreenter;
EXTERN bool resizing;
EXTERN int starting;
EXTERN char* user;
+EXTERN long nscreens_new;
EXTERN Client* kludge;
diff --git a/cmd/wmii/fns.h b/cmd/wmii/fns.h
index cc2e7e0..a0da74d 100644
--- a/cmd/wmii/fns.h
+++ b/cmd/wmii/fns.h
@@ -1,4 +1,4 @@
-/* Copyright ©2007-2010 Kris Maglione <jg@suckless.org>
+/* Copyright ©2007-2014 Kris Maglione <jg@suckless.org>
* See LICENSE file for license details.
*/
@@ -207,6 +207,7 @@ void update_keys(void);
/* main.c */
void init_screens(void);
void spawn_command(const char*);
+void wipe_screens(void);
/* message.c */
char* mask(char**, int*, int*);
@@ -280,6 +281,7 @@ void view_select(const char*);
void view_update(View*);
void view_update_all(void);
void view_update_rect(View*);
+void view_update_screens(View*);
void view_update_urgency(View*, char*);
Rectangle* view_rects(View*, uint *num, Frame *ignore);
diff --git a/cmd/wmii/frame.c b/cmd/wmii/frame.c
index 3c1a838..85f7f82 100644
--- a/cmd/wmii/frame.c
+++ b/cmd/wmii/frame.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2010 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2014 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
@@ -559,7 +559,8 @@ move_focus(Frame *old_f, Frame *f) {
noinput = (old_f && old_f->client->noinput) ||
(f && f->client->noinput) ||
disp.hasgrab != &c_root;
- if(noinput) {
+
+ if(noinput || true) {
if(old_f)
frame_draw(old_f);
if(f)
diff --git a/cmd/wmii/main.c b/cmd/wmii/main.c
index e58b858..fc5f43a 100644
--- a/cmd/wmii/main.c
+++ b/cmd/wmii/main.c
@@ -1,5 +1,5 @@
/* Copyright ©2004-2006 Anselm R. Garbe <garbeam at gmail dot com>
- * Copyright ©2006-2010 Kris Maglione <maglione.k at Gmail>
+ * Copyright ©2006-2014 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#define EXTERN
@@ -158,12 +158,14 @@ regerror(char *err) {
fprint(2, "%s: %s\n", argv0, err);
}
+static bool keep_screens = true;
+
void
init_screens(void) {
static int old_n, old_nscreens;
- Rectangle *rects;
+ Rectangle *rects, *r;
View *v;
- int i, n, m;
+ int i, j, n, m;
#ifdef notdef
d.x = Dx(scr.rect) - Dx(screen->r);
@@ -176,15 +178,33 @@ init_screens(void) {
/* Reallocate screens, zero any new ones. */
rects = xinerama_screens(&n);
+ r = malloc(n * sizeof *r);
+
+ /* Weed out subsumed/cloned screens */
+ for(m=-1; m < n; n=m) {
+ for(i=n-1, m=0; i >= 0; i--) {
+ for(j=0; j < n; j++)
+ if (i != j &&
+ eqrect(rects[i],
+ rect_intersection(rects[i], rects[j])))
+ break;
+ if (j == n)
+ r[m++] = rects[i];
+ }
+ for(i=m-1, j=0; i >= 0; i--)
+ rects[j++] = r[i];
+ }
+ free(r);
+
m = nscreens;
- nscreens = max(n, nscreens);
+ nscreens_new = keep_screens ? max(n, nscreens) : n;
+
+ for(v=view; v; v=v->next)
+ view_update_screens(v);
+
+ nscreens = nscreens_new;
screens = erealloc(screens, (nscreens + 1) * sizeof *screens);
screens[nscreens] = nil;
- for(v=view; v; v=v->next) {
- v->areas = erealloc(v->areas, nscreens * sizeof *v->areas);
- v->r = erealloc(v->r, nscreens * sizeof *v->r);
- v->pad = erealloc(v->pad, nscreens * sizeof *v->pad);
- }
/* Reallocate buffers. */
freeimage(disp.ibuf);
@@ -207,9 +227,11 @@ init_screens(void) {
screen->r = rects[i];
else
screen->r = rectsetorigin(screen->r, scr.rect.max);
+
if(i >= m)
for(v=view; v; v=v->next)
view_init(v, i);
+
def.snap = Dy(screen->r) / 63;
bar_init(screens[i]);
}
@@ -219,10 +241,18 @@ init_screens(void) {
if (old_n != n || old_nscreens != nscreens)
event("ScreenChange %d %d\n", n, nscreens);
+
old_n = n;
old_nscreens = nscreens;
}
+void
+wipe_screens(void) {
+ keep_screens = false;
+ init_screens();
+ keep_screens = true;
+}
+
static void
cleanup(void) {
starting = -1;
diff --git a/cmd/wmii/message.c b/cmd/wmii/message.c
index d392ad0..0127605 100644
--- a/cmd/wmii/message.c
+++ b/cmd/wmii/message.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2010 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2014 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
@@ -62,6 +62,7 @@ enum {
LUP,
LURGENT,
LVIEW,
+ LWIPESCREENS,
LTILDE,
};
char *symtab[] = {
@@ -103,6 +104,7 @@ char *symtab[] = {
"up",
"urgent",
"view",
+ "wipescreens",
"~",
};
@@ -609,26 +611,33 @@ message_root(void *p, IxpMsg *m) {
setdef(&screen->barpos, s, barpostab, nelem(barpostab));
view_update(selview);
break;
+
case LBORDER:
def.border = msg_getulong(msg_getword(m, 0));;
view_update(selview);
break;
+
case LCOLMODE:
setdef(&def.colmode, msg_getword(m, 0), modes, Collast);
break;
+
case LDEBUG:
msg_debug(msg_getword(m, 0));
break;
+
case LEXEC:
execstr = strdup(m->pos);
srv.running = 0;
break;
+
case LSPAWN:
spawn_command(m->pos);
break;
+
case LFOCUSCOLORS:
msg_parsecolors(m, &def.focuscolor);
goto updatecolors;
+
case LFONT:
fn = loadfont(m->pos);
if(fn) {
@@ -640,6 +649,7 @@ message_root(void *p, IxpMsg *m) {
ret = "can't load font";
view_update(selview);
break;
+
case LFONTPAD:
if(!getint(msg_getword(m, 0), &def.font->pad.min.x) ||
!getint(msg_getword(m, 0), &def.font->pad.max.x) ||
@@ -652,6 +662,7 @@ message_root(void *p, IxpMsg *m) {
view_update(selview);
}
break;
+
case LGRABMOD:
s = msg_getword(m, Ebadvalue);
if(!parsekey(s, &i, nil) || i == 0)
@@ -659,10 +670,12 @@ message_root(void *p, IxpMsg *m) {
def.mod = i;
break;
+
case LINCMODE:
setdef(&def.incmode, msg_getword(m, 0), incmodetab, nelem(incmodetab));
view_update(selview);
break;
+
case LNORMCOLORS:
msg_parsecolors(m, &def.normcolor);
updatecolors:
@@ -670,12 +683,19 @@ message_root(void *p, IxpMsg *m) {
client_reparent(c);
view_update(selview);
break;
+
case LSELCOLORS:
warning("selcolors have been removed");
return Ebadcmd;
+
case LVIEW:
view_select(m->pos);
break;
+
+ case LWIPESCREENS:
+ wipe_screens();
+ break;
+
case LQUIT:
srv.running = 0;
break;
diff --git a/cmd/wmii/view.c b/cmd/wmii/view.c
index 5bf43c5..4aa3d29 100644
--- a/cmd/wmii/view.c
+++ b/cmd/wmii/view.c
@@ -1,5 +1,5 @@
/* Copyright ©2004-2006 Anselm R. Garbe <garbeam at gmail dot com>
- * Copyright ©2006-2010 Kris Maglione <maglione.k at Gmail>
+ * Copyright ©2006-2014 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
@@ -113,6 +113,38 @@ view_init(View *v, int iscreen) {
}
void
+view_update_screens(View *v) {
+ Area *a;
+ Frame *f;
+ int s;
+
+ if (v->sel->screen > (long)nscreens)
+ v->sel = v->floating->next;
+
+ v->selscreen = min(v->selscreen, nscreens);
+
+ if (nscreens_new < nscreens) {
+ foreach_frame(v, s, a, f) {
+ f->oldscreen = min(f->oldscreen, nscreens_new);
+ if (a->screen >= nscreens_new) {
+ a->permanent = true;
+ area_detach(f);
+ view_attach(v, f);
+ }
+ }
+
+ foreach_area(v, s, a) {
+ if (a->screen >= nscreens_new)
+ area_destroy(a);
+ }
+ }
+
+ v->areas = erealloc(v->areas, nscreens_new * sizeof *v->areas);
+ v->r = erealloc(v->r, nscreens_new * sizeof *v->r);
+ v->pad = erealloc(v->pad, nscreens_new * sizeof *v->pad);
+}
+
+void
view_destroy(View *v) {
View **vp;
Frame *f;
@@ -385,6 +417,7 @@ view_attach(View *v, Frame *f) {
oldsel = v->oldsel;
a = v->sel;
+
if(c->floating == Never)
a = view_findarea(v, v->selscreen, v->selcol, false);
else if(client_floats_p(c)) {
@@ -392,8 +425,12 @@ view_attach(View *v, Frame *f) {
oldsel = v->sel;
a = v->floating;
}
+ else if(c->sel && c->sel->screen >= 0 && c->sel->screen < nscreens_new &&
+ c->sel->screen != v->sel->screen)
+ a = view_findarea(v, c->sel->screen, 0, false);
else if((ff = client_groupframe(c, v))) {
- a = ff->area;
+ if (ff->client != c && ff->area->screen < nscreens_new)
+ a = ff->area;
if(v->oldsel && ff->client == view_selclient(v))
a = v->oldsel;
}
diff --git a/cmd/wmiir.c b/cmd/wmiir.c
index ecf9a92..360ffb9 100644
--- a/cmd/wmiir.c
+++ b/cmd/wmiir.c
@@ -529,6 +529,7 @@ main(int argc, char *argv[]) {
char *address;
exectab *tab;
int ret;
+ Stat *stat;
IXP_ASSERT_VERSION;
@@ -579,6 +580,9 @@ main(int argc, char *argv[]) {
if(tab->cmd == 0)
usage();
+ stat = ixp_stat(client, "/keys");
+ ixp_freestat(stat);
+
ret = tab->fn(argc, argv);
ixp_unmount(client);
diff --git a/cmd/x11/Makefile b/cmd/x11/Makefile
index 5dd7fa3..606ad1d 100644
--- a/cmd/x11/Makefile
+++ b/cmd/x11/Makefile
@@ -7,9 +7,8 @@ TARG = wikeyname \
PACKAGES += $(X11PACKAGES)
-LIB = $(LIBS9) $(LIBIXP)
-LIBS += $(LIB)
-CFLAGS += $(INCX11)
+LIB = $(LIBS9)
+LIBS += $(LIB) $(LIBIXP) -ldl
wiclick.out: wiclick.o
$(LINK) $@ $< -lXtst