Add DWM module "src/dwm/wmcheckwin.c"
This commit is contained in:
parent
e33e206e31
commit
3d277c10fa
4 changed files with 63 additions and 55 deletions
1
Makefile
1
Makefile
|
@ -42,6 +42,7 @@ DWM_SRC = \
|
|||
src/dwm/bar.c \
|
||||
src/dwm/handlers.c \
|
||||
src/dwm/layouts.c \
|
||||
src/dwm/wmcheckwin.c \
|
||||
src/dwm/xerror.c
|
||||
|
||||
TEST_SRC = \
|
||||
|
|
57
src/dwm.c
57
src/dwm.c
|
@ -212,13 +212,12 @@ static void updatewindowtype(Client *c);
|
|||
static void updatewmhints(Client *c);
|
||||
static Client *wintoclient(Window w);
|
||||
static Monitor *wintomon(Window w);
|
||||
static void wmcheckwin_create();
|
||||
static void wmcheckwin_destroy();
|
||||
static void zoom(const Arg *arg);
|
||||
|
||||
#include "dwm/bar.h"
|
||||
#include "dwm/handlers.h"
|
||||
#include "dwm/layouts.h"
|
||||
#include "dwm/wmcheckwin.h"
|
||||
#include "dwm/xerror.h"
|
||||
|
||||
/*************
|
||||
|
@ -236,7 +235,6 @@ static Cur *cursor[CurLast];
|
|||
static Clr **scheme;
|
||||
static Drw *drw;
|
||||
static Monitor *mons, *selmon;
|
||||
static Window wmcheckwin;
|
||||
|
||||
static void (*handler[LASTEvent])(XEvent*) = {
|
||||
[ButtonPress] = on_button_press,
|
||||
|
@ -336,6 +334,7 @@ static Button buttons[] = {
|
|||
#include "dwm/bar.c"
|
||||
#include "dwm/handlers.c"
|
||||
#include "dwm/layouts.c"
|
||||
#include "dwm/wmcheckwin.c"
|
||||
#include "dwm/xerror.c"
|
||||
|
||||
/***********************************
|
||||
|
@ -2333,58 +2332,6 @@ Monitor *wintomon(Window w)
|
|||
return selmon;
|
||||
}
|
||||
|
||||
void wmcheckwin_create()
|
||||
{
|
||||
wmcheckwin = XCreateSimpleWindow(
|
||||
xbase->x_display,
|
||||
xbase->x_root,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
);
|
||||
|
||||
XChangeProperty(
|
||||
xbase->x_display,
|
||||
wmcheckwin,
|
||||
xbase->atoms->netatom[NetWMCheck],
|
||||
XA_WINDOW,
|
||||
32,
|
||||
PropModeReplace,
|
||||
(unsigned char*)&wmcheckwin,
|
||||
1
|
||||
);
|
||||
XChangeProperty(
|
||||
xbase->x_display,
|
||||
wmcheckwin,
|
||||
xbase->atoms->netatom[NetWMName],
|
||||
xbase->atoms->utf8string,
|
||||
8,
|
||||
PropModeReplace,
|
||||
(unsigned char*)
|
||||
xbase->program_title,
|
||||
strlen(xbase->program_title)
|
||||
);
|
||||
XChangeProperty(
|
||||
xbase->x_display,
|
||||
xbase->x_root,
|
||||
xbase->atoms->netatom[NetWMCheck],
|
||||
XA_WINDOW,
|
||||
32,
|
||||
PropModeReplace,
|
||||
(unsigned char*)&wmcheckwin,
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
void wmcheckwin_destroy()
|
||||
{
|
||||
XDestroyWindow(xbase->x_display, wmcheckwin);
|
||||
}
|
||||
|
||||
void zoom(__attribute__((unused)) const Arg *arg)
|
||||
{
|
||||
Client *c = selmon->sel;
|
||||
|
|
53
src/dwm/wmcheckwin.c
Normal file
53
src/dwm/wmcheckwin.c
Normal file
|
@ -0,0 +1,53 @@
|
|||
static Window wmcheckwin = 0;
|
||||
|
||||
void wmcheckwin_create()
|
||||
{
|
||||
wmcheckwin = XCreateSimpleWindow(
|
||||
xbase->x_display,
|
||||
xbase->x_root,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
);
|
||||
|
||||
XChangeProperty(
|
||||
xbase->x_display,
|
||||
wmcheckwin,
|
||||
xbase->atoms->netatom[NetWMCheck],
|
||||
XA_WINDOW,
|
||||
32,
|
||||
PropModeReplace,
|
||||
(unsigned char*)&wmcheckwin,
|
||||
1
|
||||
);
|
||||
XChangeProperty(
|
||||
xbase->x_display,
|
||||
wmcheckwin,
|
||||
xbase->atoms->netatom[NetWMName],
|
||||
xbase->atoms->utf8string,
|
||||
8,
|
||||
PropModeReplace,
|
||||
(unsigned char*)
|
||||
xbase->program_title,
|
||||
strlen(xbase->program_title)
|
||||
);
|
||||
XChangeProperty(
|
||||
xbase->x_display,
|
||||
xbase->x_root,
|
||||
xbase->atoms->netatom[NetWMCheck],
|
||||
XA_WINDOW,
|
||||
32,
|
||||
PropModeReplace,
|
||||
(unsigned char*)&wmcheckwin,
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
void wmcheckwin_destroy()
|
||||
{
|
||||
XDestroyWindow(xbase->x_display, wmcheckwin);
|
||||
}
|
7
src/dwm/wmcheckwin.h
Normal file
7
src/dwm/wmcheckwin.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
#ifndef _DWM_WMCHECKWIN_H
|
||||
#define _DWM_WMCHECKWIN_H
|
||||
|
||||
static void wmcheckwin_create();
|
||||
static void wmcheckwin_destroy();
|
||||
|
||||
#endif // _DWM_WMCHECKWIN_H
|
Loading…
Reference in a new issue