Adding fullscreen mode to tabbed.
This commit is contained in:
parent
e70d87e83b
commit
29c5878d4c
@ -16,11 +16,13 @@ static Key keys[] = { \
|
|||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
{ MODKEY|ShiftMask, XK_Return, focusonce, { 0 } },
|
{ MODKEY|ShiftMask, XK_Return, focusonce, { 0 } },
|
||||||
{ MODKEY|ShiftMask, XK_Return, spawn, { 0 } },
|
{ MODKEY|ShiftMask, XK_Return, spawn, { 0 } },
|
||||||
|
|
||||||
{ MODKEY|ShiftMask, XK_l, rotate, { .i = +1 } },
|
{ MODKEY|ShiftMask, XK_l, rotate, { .i = +1 } },
|
||||||
{ MODKEY|ShiftMask, XK_h, rotate, { .i = -1 } },
|
{ MODKEY|ShiftMask, XK_h, rotate, { .i = -1 } },
|
||||||
{ MODKEY|ShiftMask, XK_j, movetab, { .i = -1 } },
|
{ MODKEY|ShiftMask, XK_j, movetab, { .i = -1 } },
|
||||||
{ MODKEY|ShiftMask, XK_k, movetab, { .i = +1 } },
|
{ MODKEY|ShiftMask, XK_k, movetab, { .i = +1 } },
|
||||||
{ MODKEY, XK_Tab, rotate, { .i = 0 } },
|
{ MODKEY, XK_Tab, rotate, { .i = 0 } },
|
||||||
|
|
||||||
{ MODKEY, XK_1, move, { .i = 0 } },
|
{ MODKEY, XK_1, move, { .i = 0 } },
|
||||||
{ MODKEY, XK_2, move, { .i = 1 } },
|
{ MODKEY, XK_2, move, { .i = 1 } },
|
||||||
{ MODKEY, XK_3, move, { .i = 2 } },
|
{ MODKEY, XK_3, move, { .i = 2 } },
|
||||||
@ -31,6 +33,9 @@ static Key keys[] = { \
|
|||||||
{ MODKEY, XK_8, move, { .i = 7 } },
|
{ MODKEY, XK_8, move, { .i = 7 } },
|
||||||
{ MODKEY, XK_9, move, { .i = 8 } },
|
{ MODKEY, XK_9, move, { .i = 8 } },
|
||||||
{ MODKEY, XK_0, move, { .i = 9 } },
|
{ MODKEY, XK_0, move, { .i = 9 } },
|
||||||
|
|
||||||
{ MODKEY, XK_q, killclient, { 0 } },
|
{ MODKEY, XK_q, killclient, { 0 } },
|
||||||
|
|
||||||
|
{ 0, XK_F11, fullscreen, { 0 } },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
3
tabbed.1
3
tabbed.1
@ -72,6 +72,9 @@ close tab
|
|||||||
.TP
|
.TP
|
||||||
.B Ctrl\-[0..9]
|
.B Ctrl\-[0..9]
|
||||||
jumps to nth tab
|
jumps to nth tab
|
||||||
|
.TP
|
||||||
|
.B F11
|
||||||
|
Toggle fullscreen mode.
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
$ tabbed surf -e
|
$ tabbed surf -e
|
||||||
.TP
|
.TP
|
||||||
|
21
tabbed.c
21
tabbed.c
@ -49,7 +49,8 @@
|
|||||||
#define TEXTW(x) (textnw(x, strlen(x)) + dc.font.height)
|
#define TEXTW(x) (textnw(x, strlen(x)) + dc.font.height)
|
||||||
|
|
||||||
enum { ColFG, ColBG, ColLast }; /* color */
|
enum { ColFG, ColBG, ColLast }; /* color */
|
||||||
enum { WMProtocols, WMDelete, WMName, XEmbed, WMLast }; /* default atoms */
|
enum { WMProtocols, WMDelete, WMName, WMState, WMFullscreen,
|
||||||
|
XEmbed, WMLast }; /* default atoms */
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
int i;
|
int i;
|
||||||
@ -103,6 +104,7 @@ static void expose(const XEvent *e);
|
|||||||
static void focus(int c);
|
static void focus(int c);
|
||||||
static void focusin(const XEvent *e);
|
static void focusin(const XEvent *e);
|
||||||
static void focusonce(const Arg *arg);
|
static void focusonce(const Arg *arg);
|
||||||
|
static void fullscreen(const Arg *arg);
|
||||||
static int getclient(Window w);
|
static int getclient(Window w);
|
||||||
static unsigned long getcolor(const char *colstr);
|
static unsigned long getcolor(const char *colstr);
|
||||||
static int getfirsttab(void);
|
static int getfirsttab(void);
|
||||||
@ -463,6 +465,20 @@ focusonce(const Arg *arg) {
|
|||||||
nextfocus = True;
|
nextfocus = True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
fullscreen(const Arg *arg) {
|
||||||
|
XEvent e;
|
||||||
|
|
||||||
|
e.type = ClientMessage;
|
||||||
|
e.xclient.window = win;
|
||||||
|
e.xclient.message_type = wmatom[WMState];
|
||||||
|
e.xclient.format = 32;
|
||||||
|
e.xclient.data.l[0] = 2;
|
||||||
|
e.xclient.data.l[1] = wmatom[WMFullscreen];
|
||||||
|
e.xclient.data.l[2] = 0;
|
||||||
|
XSendEvent(dpy, root, False, SubstructureNotifyMask, &e);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
getclient(Window w) {
|
getclient(Window w) {
|
||||||
int i;
|
int i;
|
||||||
@ -839,6 +855,9 @@ setup(void) {
|
|||||||
wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
|
wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
|
||||||
wmatom[XEmbed] = XInternAtom(dpy, "_XEMBED", False);
|
wmatom[XEmbed] = XInternAtom(dpy, "_XEMBED", False);
|
||||||
wmatom[WMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
wmatom[WMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
||||||
|
wmatom[WMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
|
||||||
|
wmatom[WMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN",
|
||||||
|
False);
|
||||||
|
|
||||||
/* init appearance */
|
/* init appearance */
|
||||||
wx = 0;
|
wx = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user