mirror of
https://github.com/amiwm/amiwm.git
synced 2026-03-24 01:24:15 +00:00
Compare commits
3 Commits
d7e7a8a6a2
...
a79992cb7b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a79992cb7b | ||
|
|
0c5a2c7648 | ||
|
|
ca04f20fec |
6
client.c
6
client.c
@@ -204,7 +204,7 @@ void setclientstate(Client *c, int state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
c->state = state;
|
c->state = state;
|
||||||
XChangeProperty(dpy, c->window, wm_state, wm_state, 32,
|
XChangeProperty(dpy, c->window, ATOMS[WM_STATE], ATOMS[WM_STATE], 32,
|
||||||
PropModeReplace, (unsigned char *)data, 2);
|
PropModeReplace, (unsigned char *)data, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ void getstate(Client *c)
|
|||||||
{
|
{
|
||||||
long *data=NULL;
|
long *data=NULL;
|
||||||
|
|
||||||
if(_getprop(c->window, wm_state, wm_state, 2l, (char **)&data)>0) {
|
if(_getprop(c->window, ATOMS[WM_STATE], ATOMS[WM_STATE], 2l, (char **)&data)>0) {
|
||||||
c->state=*data;
|
c->state=*data;
|
||||||
XFree((char *)data);
|
XFree((char *)data);
|
||||||
}
|
}
|
||||||
@@ -446,7 +446,7 @@ reparent_client(Scrn *s, Client *client)
|
|||||||
if(client->parent != client->scr->root)
|
if(client->parent != client->scr->root)
|
||||||
XReparentWindow(dpy, client->parent, s->back, client->x, client->y);
|
XReparentWindow(dpy, client->parent, s->back, client->x, client->y);
|
||||||
if (s->deftitle != NULL)
|
if (s->deftitle != NULL)
|
||||||
setstringprop(client->window, amiwm_screen, s->deftitle);
|
setstringprop(client->window, ATOMS[AMIWM_SCREEN], s->deftitle);
|
||||||
sendconfig(client);
|
sendconfig(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
6
frame.c
6
frame.c
@@ -190,7 +190,7 @@ void reparent(Client *c)
|
|||||||
c->scr = lc->fsscr;
|
c->scr = lc->fsscr;
|
||||||
else
|
else
|
||||||
c->scr = lc->scr;
|
c->scr = lc->scr;
|
||||||
} else if(XGetTextProperty(dpy, c->window, &screen_prop, amiwm_screen)) {
|
} else if(XGetTextProperty(dpy, c->window, &screen_prop, ATOMS[AMIWM_SCREEN])) {
|
||||||
do {
|
do {
|
||||||
if(s->root == scr->root &&
|
if(s->root == scr->root &&
|
||||||
(!s->deftitle[screen_prop.nitems])&&!strncmp(s->deftitle,
|
(!s->deftitle[screen_prop.nitems])&&!strncmp(s->deftitle,
|
||||||
@@ -329,7 +329,7 @@ void reparent(Client *c)
|
|||||||
XMapSubwindows(dpy, c->parent);
|
XMapSubwindows(dpy, c->parent);
|
||||||
sendconfig(c);
|
sendconfig(c);
|
||||||
if (scr->deftitle != NULL)
|
if (scr->deftitle != NULL)
|
||||||
setstringprop(c->window, amiwm_screen, scr->deftitle);
|
setstringprop(c->window, ATOMS[AMIWM_SCREEN], scr->deftitle);
|
||||||
if(prefs.focus == FOC_CLICKTOTYPE)
|
if(prefs.focus == FOC_CLICKTOTYPE)
|
||||||
XGrabButton(dpy, Button1, AnyModifier, c->parent, True,
|
XGrabButton(dpy, Button1, AnyModifier, c->parent, True,
|
||||||
ButtonPressMask, GrabModeSync, GrabModeAsync, None, wm_curs);
|
ButtonPressMask, GrabModeSync, GrabModeAsync, None, wm_curs);
|
||||||
@@ -737,7 +737,7 @@ void gadgetunclicked(Client *c, XEvent *e)
|
|||||||
redraw(c, w);
|
redraw(c, w);
|
||||||
if(w==c->close) {
|
if(w==c->close) {
|
||||||
if((c->proto & Pdelete)&&!(e->xbutton.state&ShiftMask))
|
if((c->proto & Pdelete)&&!(e->xbutton.state&ShiftMask))
|
||||||
sendcmessage(c->window, wm_protocols, wm_delete);
|
sendcmessage(c->window, ATOMS[WM_PROTOCOLS], ATOMS[WM_DELETE_WINDOW]);
|
||||||
else
|
else
|
||||||
XKillClient(dpy, c->window);
|
XKillClient(dpy, c->window);
|
||||||
} else if(w==c->depth)
|
} else if(w==c->depth)
|
||||||
|
|||||||
104
icc.c
104
icc.c
@@ -1,3 +1,5 @@
|
|||||||
|
#include <X11/Xatom.h>
|
||||||
|
|
||||||
#include "drawinfo.h"
|
#include "drawinfo.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
#include "icc.h"
|
#include "icc.h"
|
||||||
@@ -5,7 +7,7 @@
|
|||||||
#include "style.h"
|
#include "style.h"
|
||||||
#include "prefs.h"
|
#include "prefs.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@@ -16,54 +18,34 @@ extern struct Library *XLibBase;
|
|||||||
|
|
||||||
extern void redraw(Client *, Window);
|
extern void redraw(Client *, Window);
|
||||||
|
|
||||||
Atom utf8_string, net_wm_name;
|
Atom ATOMS[NATOMS];
|
||||||
Atom wm_state, wm_change_state, wm_protocols, wm_delete, wm_take_focus;
|
|
||||||
Atom wm_colormaps, wm_name, wm_normal_hints, wm_hints, wm_icon_name, wm_class;
|
|
||||||
Atom net_supporting_wm_check, net_supported, net_wm_state, net_wm_state_fullscreen;
|
|
||||||
Atom amiwm_screen, swm_vroot, amiwm_wflags, amiwm_appiconmsg, amiwm_appwindowmsg;
|
|
||||||
|
|
||||||
extern Display *dpy;
|
extern Display *dpy;
|
||||||
|
extern char *progname;
|
||||||
|
|
||||||
void init_atoms()
|
void init_atoms()
|
||||||
{
|
{
|
||||||
utf8_string = XInternAtom(dpy, "UTF8_STRING", False);
|
static char *atom_names[NATOMS] = {
|
||||||
wm_state = XInternAtom(dpy, "WM_STATE", False);
|
#define X(atom) [atom] = #atom,
|
||||||
wm_change_state = XInternAtom(dpy, "WM_CHANGE_STATE", False);
|
ATOMS_TABLE(X)
|
||||||
wm_protocols = XInternAtom(dpy, "WM_PROTOCOLS", False);
|
#undef X
|
||||||
wm_delete = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
|
};
|
||||||
wm_take_focus = XInternAtom(dpy, "WM_TAKE_FOCUS", False);
|
|
||||||
wm_colormaps = XInternAtom(dpy, "WM_COLORMAP_WINDOWS", False);
|
if (!XInternAtoms(dpy, atom_names, NATOMS, False, ATOMS)) {
|
||||||
wm_name = XInternAtom(dpy, "WM_NAME", False);
|
fprintf(stderr, "%s: cannot intern atoms\n", progname);
|
||||||
wm_normal_hints = XInternAtom(dpy, "WM_NORMAL_HINTS", False);
|
exit(1);
|
||||||
wm_hints = XInternAtom(dpy, "WM_HINTS", False);
|
}
|
||||||
wm_icon_name = XInternAtom(dpy, "WM_ICON_NAME", False);
|
|
||||||
wm_class = XInternAtom(dpy, "WM_CLASS", False);
|
|
||||||
net_supported = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
|
||||||
net_supporting_wm_check = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
|
|
||||||
net_wm_name = XInternAtom(dpy, "_NET_WM_NAME", False);
|
|
||||||
net_wm_state = XInternAtom(dpy, "_NET_WM_STATE", False);
|
|
||||||
net_wm_state_fullscreen = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
|
||||||
amiwm_screen = XInternAtom(dpy, "AMIWM_SCREEN", False);
|
|
||||||
swm_vroot = XInternAtom(dpy, "__SWM_VROOT", False);
|
|
||||||
amiwm_wflags = XInternAtom(dpy, "AMIWM_WFLAGS", False);
|
|
||||||
amiwm_appiconmsg = XInternAtom(dpy, "AMIWM_APPICONMSG", False);
|
|
||||||
amiwm_appwindowmsg = XInternAtom(dpy, "AMIWM_APPWINDOWMSG", False);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setsupports(Window root, Window checkwin)
|
void setsupports(Window root, Window checkwin)
|
||||||
{
|
{
|
||||||
Atom atoms[] = {
|
XChangeProperty(dpy, root, ATOMS[_NET_SUPPORTED], XA_ATOM, 32,
|
||||||
net_wm_state,
|
PropModeReplace, (void *)&ATOMS[_NET_SUPPORTED], NATOMS-_NET_SUPPORTED);
|
||||||
net_wm_state_fullscreen,
|
XChangeProperty(dpy, root, ATOMS[_NET_SUPPORTING_WM_CHECK], XA_WINDOW, 32,
|
||||||
};
|
|
||||||
XChangeProperty(dpy, root, net_supported, XA_ATOM, 32,
|
|
||||||
PropModeReplace, (unsigned char *)atoms,
|
|
||||||
sizeof(atoms)/sizeof(atoms[0]));
|
|
||||||
XChangeProperty(dpy, root, net_supporting_wm_check, XA_WINDOW, 32,
|
|
||||||
PropModeReplace, (void *)(Window[]){checkwin}, 1);
|
PropModeReplace, (void *)(Window[]){checkwin}, 1);
|
||||||
XChangeProperty(dpy, checkwin, net_supporting_wm_check, XA_WINDOW, 32,
|
XChangeProperty(dpy, checkwin, ATOMS[_NET_SUPPORTING_WM_CHECK], XA_WINDOW, 32,
|
||||||
PropModeReplace, (void *)(Window[]){checkwin}, 1);
|
PropModeReplace, (void *)(Window[]){checkwin}, 1);
|
||||||
XChangeProperty(dpy, checkwin, net_wm_name, utf8_string, 8,
|
XChangeProperty(dpy, checkwin, ATOMS[_NET_WM_NAME], ATOMS[UTF8_STRING], 8,
|
||||||
PropModeReplace, (void *)"AmiWM", 5);
|
PropModeReplace, (void *)"AmiWM", 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,13 +68,13 @@ void getwmstate(Client *c)
|
|||||||
Window w;
|
Window w;
|
||||||
|
|
||||||
w = c->window;
|
w = c->window;
|
||||||
if ((n = _getprop(w, net_wm_state, XA_ATOM, 20L, (char**)&p)) < 0)
|
if ((n = _getprop(w, ATOMS[_NET_WM_STATE], XA_ATOM, 20L, (char**)&p)) < 0)
|
||||||
return;
|
return;
|
||||||
c->fullscreen = 0;
|
c->fullscreen = 0;
|
||||||
if (!n)
|
if (!n)
|
||||||
return;
|
return;
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
if (p[i] == net_wm_state_fullscreen)
|
if (p[i] == ATOMS[_NET_WM_STATE_FULLSCREEN])
|
||||||
c->fullscreen = 1;
|
c->fullscreen = 1;
|
||||||
XFree((char *) p);
|
XFree((char *) p);
|
||||||
}
|
}
|
||||||
@@ -100,13 +82,11 @@ void getwmstate(Client *c)
|
|||||||
void setwmstate(Client *c)
|
void setwmstate(Client *c)
|
||||||
{
|
{
|
||||||
if (c->fullscreen) {
|
if (c->fullscreen) {
|
||||||
Atom data[] = {
|
XChangeProperty(dpy, c->window, ATOMS[_NET_WM_STATE], XA_ATOM, 32, PropModeReplace,
|
||||||
net_wm_state_fullscreen
|
(void *)&ATOMS[_NET_WM_STATE_FULLSCREEN], 1);
|
||||||
};
|
} else {
|
||||||
XChangeProperty(dpy, c->window, net_wm_state, XA_ATOM, 32, PropModeReplace,
|
XDeleteProperty(dpy, c->window, ATOMS[_NET_WM_STATE]);
|
||||||
(unsigned char *)data, 1);
|
}
|
||||||
} else
|
|
||||||
XDeleteProperty(dpy, c->window, net_wm_state);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -139,7 +119,7 @@ void getwflags(Client *c)
|
|||||||
long n;
|
long n;
|
||||||
|
|
||||||
c->wflags = 0;
|
c->wflags = 0;
|
||||||
if ((n = _getprop(c->window, amiwm_wflags, amiwm_wflags, 1L, (char**)&p)) <= 0)
|
if ((n = _getprop(c->window, ATOMS[AMIWM_WFLAGS], ATOMS[AMIWM_WFLAGS], 1L, (char**)&p)) <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
c->wflags = p[0];
|
c->wflags = p[0];
|
||||||
@@ -156,13 +136,13 @@ void getproto(Client *c)
|
|||||||
|
|
||||||
w = c->window;
|
w = c->window;
|
||||||
c->proto &= ~(Pdelete|Ptakefocus);
|
c->proto &= ~(Pdelete|Ptakefocus);
|
||||||
if ((n = _getprop(w, wm_protocols, XA_ATOM, 20L, (char**)&p)) <= 0)
|
if ((n = _getprop(w, ATOMS[WM_PROTOCOLS], XA_ATOM, 20L, (char**)&p)) <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
if (p[i] == wm_delete)
|
if (p[i] == ATOMS[WM_DELETE_WINDOW])
|
||||||
c->proto |= Pdelete;
|
c->proto |= Pdelete;
|
||||||
else if (p[i] == wm_take_focus)
|
else if (p[i] == ATOMS[WM_TAKE_FOCUS])
|
||||||
c->proto |= Ptakefocus;
|
c->proto |= Ptakefocus;
|
||||||
|
|
||||||
XFree((char *) p);
|
XFree((char *) p);
|
||||||
@@ -202,7 +182,7 @@ void checkstyle(Client *c)
|
|||||||
if(prefs.firststyle==NULL)
|
if(prefs.firststyle==NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!XGetTextProperty(dpy, c->window, &class_name, wm_class))
|
if(!XGetTextProperty(dpy, c->window, &class_name, XA_WM_CLASS))
|
||||||
class_name.value=NULL;
|
class_name.value=NULL;
|
||||||
else
|
else
|
||||||
/* This value seems to be 2x it's correct value always... */
|
/* This value seems to be 2x it's correct value always... */
|
||||||
@@ -237,7 +217,7 @@ void propertychange(Client *c, Atom a)
|
|||||||
extern void checksizehints(Client *);
|
extern void checksizehints(Client *);
|
||||||
extern void newicontitle(Client *);
|
extern void newicontitle(Client *);
|
||||||
|
|
||||||
if(a==wm_name) {
|
if(a==XA_WM_NAME) {
|
||||||
#ifdef USE_FONTSETS
|
#ifdef USE_FONTSETS
|
||||||
XTextProperty prop;
|
XTextProperty prop;
|
||||||
if(c->title) {
|
if(c->title) {
|
||||||
@@ -265,9 +245,9 @@ void propertychange(Client *c, Atom a)
|
|||||||
XClearWindow(dpy, c->drag);
|
XClearWindow(dpy, c->drag);
|
||||||
redraw(c, c->drag);
|
redraw(c, c->drag);
|
||||||
}
|
}
|
||||||
} else if(a==wm_normal_hints) {
|
} else if(a==XA_WM_NORMAL_HINTS) {
|
||||||
checksizehints(c);
|
checksizehints(c);
|
||||||
} else if(a==wm_hints) {
|
} else if(a==XA_WM_HINTS) {
|
||||||
XWMHints *xwmh;
|
XWMHints *xwmh;
|
||||||
if((xwmh=XGetWMHints(dpy, c->window))) {
|
if((xwmh=XGetWMHints(dpy, c->window))) {
|
||||||
if((xwmh->flags&(IconWindowHint|IconPixmapHint))&&c->icon) {
|
if((xwmh->flags&(IconWindowHint|IconPixmapHint))&&c->icon) {
|
||||||
@@ -281,25 +261,25 @@ void propertychange(Client *c, Atom a)
|
|||||||
}
|
}
|
||||||
XFree(xwmh);
|
XFree(xwmh);
|
||||||
}
|
}
|
||||||
} else if(a==wm_protocols) {
|
} else if(a==ATOMS[WM_PROTOCOLS]) {
|
||||||
getproto(c);
|
getproto(c);
|
||||||
} else if(a==wm_icon_name) {
|
} else if(a==XA_WM_ICON_NAME) {
|
||||||
if(c->style==NULL)
|
if(c->style==NULL)
|
||||||
checkstyle(c);
|
checkstyle(c);
|
||||||
if(c->icon) newicontitle(c);
|
if(c->icon) newicontitle(c);
|
||||||
} else if(a==wm_state) {
|
} else if(a==ATOMS[WM_STATE]) {
|
||||||
if(c->parent==c->scr->root) {
|
if(c->parent==c->scr->root) {
|
||||||
getstate(c);
|
getstate(c);
|
||||||
if(c->state==NormalState)
|
if(c->state==NormalState)
|
||||||
c->state=WithdrawnState;
|
c->state=WithdrawnState;
|
||||||
}
|
}
|
||||||
} else if(a==wm_class && c->style==NULL)
|
} else if(a==XA_WM_CLASS && c->style==NULL)
|
||||||
checkstyle(c);
|
checkstyle(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_client_message(Client *c, XClientMessageEvent *xcme)
|
void handle_client_message(Client *c, XClientMessageEvent *xcme)
|
||||||
{
|
{
|
||||||
if(xcme->message_type == wm_change_state) {
|
if(xcme->message_type == ATOMS[WM_CHANGE_STATE]) {
|
||||||
int state=xcme->data.l[0];
|
int state=xcme->data.l[0];
|
||||||
if(state==IconicState)
|
if(state==IconicState)
|
||||||
if(c->state!=IconicState) {
|
if(c->state!=IconicState) {
|
||||||
@@ -328,10 +308,10 @@ void handle_client_message(Client *c, XClientMessageEvent *xcme)
|
|||||||
XMapRaised(dpy, c->parent);
|
XMapRaised(dpy, c->parent);
|
||||||
setclientstate(c, NormalState);
|
setclientstate(c, NormalState);
|
||||||
}
|
}
|
||||||
} else if (xcme->message_type == net_wm_state) {
|
} else if (xcme->message_type == ATOMS[_NET_WM_STATE]) {
|
||||||
int action=xcme->data.l[0];
|
int action=xcme->data.l[0];
|
||||||
Atom prop=xcme->data.l[1];
|
Atom prop=xcme->data.l[1];
|
||||||
if (prop == net_wm_state_fullscreen)
|
if (prop == ATOMS[_NET_WM_STATE_FULLSCREEN])
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 0: fullscreen(c, 0); break; /* _NET_WM_STATE_REMOVE */
|
case 0: fullscreen(c, 0); break; /* _NET_WM_STATE_REMOVE */
|
||||||
case 1: fullscreen(c, 1); break; /* _NET_WM_STATE_ADD */
|
case 1: fullscreen(c, 1); break; /* _NET_WM_STATE_ADD */
|
||||||
|
|||||||
35
icc.h
35
icc.h
@@ -17,15 +17,12 @@ extern long _getprop(Window, Atom, Atom, long, char **);
|
|||||||
extern void getwflags(Client *);
|
extern void getwflags(Client *);
|
||||||
extern Window get_transient_for(Window);
|
extern Window get_transient_for(Window);
|
||||||
|
|
||||||
extern Atom wm_state, wm_change_state, wm_protocols, wm_delete, wm_take_focus, wm_colormaps, wm_hints, amiwm_screen, swm_vroot;
|
|
||||||
|
|
||||||
#define Pdelete 1
|
#define Pdelete 1
|
||||||
#define Ptakefocus 2
|
#define Ptakefocus 2
|
||||||
#define Psizebottom 4
|
#define Psizebottom 4
|
||||||
#define Psizeright 8
|
#define Psizeright 8
|
||||||
#define Psizetrans 16
|
#define Psizetrans 16
|
||||||
|
|
||||||
|
|
||||||
#define mkcmessage(w, a, x, ...) (&(XEvent){.xclient = { \
|
#define mkcmessage(w, a, x, ...) (&(XEvent){.xclient = { \
|
||||||
.type = ClientMessage, \
|
.type = ClientMessage, \
|
||||||
.window = (w), \
|
.window = (w), \
|
||||||
@@ -34,4 +31,36 @@ extern Atom wm_state, wm_change_state, wm_protocols, wm_delete, wm_take_focus, w
|
|||||||
.data.l = {(long)(x), CurrentTime, __VA_ARGS__}, \
|
.data.l = {(long)(x), CurrentTime, __VA_ARGS__}, \
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
#define NET_ATOMS \
|
||||||
|
X(_NET_SUPPORTING_WM_CHECK) \
|
||||||
|
X(_NET_WM_NAME) \
|
||||||
|
X(_NET_WM_STATE) \
|
||||||
|
X(_NET_WM_STATE_FULLSCREEN) \
|
||||||
|
|
||||||
|
#define ATOMS_TABLE(X) \
|
||||||
|
X(__SWM_VROOT) \
|
||||||
|
X(AMIWM_APPICONMSG) \
|
||||||
|
X(AMIWM_APPWINDOWMSG) \
|
||||||
|
X(AMIWM_SCREEN) \
|
||||||
|
X(AMIWM_WFLAGS) \
|
||||||
|
X(UTF8_STRING) \
|
||||||
|
X(WM_CHANGE_STATE) \
|
||||||
|
X(WM_CLASS) \
|
||||||
|
X(WM_COLORMAP_WINDOWS) \
|
||||||
|
X(WM_DELETE_WINDOW) \
|
||||||
|
X(WM_PROTOCOLS) \
|
||||||
|
X(WM_STATE) \
|
||||||
|
X(WM_TAKE_FOCUS) \
|
||||||
|
X(_NET_SUPPORTED) \
|
||||||
|
NET_ATOMS /* this must come last */
|
||||||
|
|
||||||
|
enum {
|
||||||
|
#define X(atom) atom,
|
||||||
|
ATOMS_TABLE(X)
|
||||||
|
NATOMS
|
||||||
|
#undef X
|
||||||
|
};
|
||||||
|
|
||||||
|
extern Atom ATOMS[NATOMS];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
6
main.c
6
main.c
@@ -758,11 +758,10 @@ static void drag_icon(Scrn *s, Time time, int x_root, int y_root)
|
|||||||
|
|
||||||
if (c != NULL) {
|
if (c != NULL) {
|
||||||
if (c->module != NULL) {
|
if (c->module != NULL) {
|
||||||
extern Atom amiwm_appwindowmsg;
|
|
||||||
XTranslateCoordinates(dpy, s->back, c->window, -4, -4, &wx, &wy, &ch);
|
XTranslateCoordinates(dpy, s->back, c->window, -4, -4, &wx, &wy, &ch);
|
||||||
for (int n = 0; n < nicons; n++) {
|
for (int n = 0; n < nicons; n++) {
|
||||||
dispatch_event_to_broker(mkcmessage(
|
dispatch_event_to_broker(mkcmessage(
|
||||||
c->window, amiwm_appwindowmsg,dragging[n].icon->window,
|
c->window, ATOMS[AMIWM_APPWINDOWMSG],dragging[n].icon->window,
|
||||||
dragging[n].x + wx, dragging[n].y + wy
|
dragging[n].x + wx, dragging[n].y + wy
|
||||||
), 0, c->module);
|
), 0, c->module);
|
||||||
}
|
}
|
||||||
@@ -878,13 +877,12 @@ static void drag_resize(Client *c, Time time, int x_root, int y_root)
|
|||||||
|
|
||||||
static void do_icon_double_click(Scrn *scr)
|
static void do_icon_double_click(Scrn *scr)
|
||||||
{
|
{
|
||||||
extern Atom amiwm_appiconmsg;
|
|
||||||
Icon *i, *next;
|
Icon *i, *next;
|
||||||
|
|
||||||
for(i=scr->firstselected; i; i=next) {
|
for(i=scr->firstselected; i; i=next) {
|
||||||
next=i->nextselected;
|
next=i->nextselected;
|
||||||
if(i->module) {
|
if(i->module) {
|
||||||
dispatch_event_to_broker(mkcmessage(i->window, amiwm_appiconmsg, 0),
|
dispatch_event_to_broker(mkcmessage(i->window, ATOMS[AMIWM_APPICONMSG], 0),
|
||||||
0, i->module);
|
0, i->module);
|
||||||
} else {
|
} else {
|
||||||
deiconify(i);
|
deiconify(i);
|
||||||
|
|||||||
4
screen.c
4
screen.c
@@ -61,9 +61,9 @@ void setvirtualroot(Scrn *s)
|
|||||||
|
|
||||||
if(s==old_vroot) return;
|
if(s==old_vroot) return;
|
||||||
if(old_vroot)
|
if(old_vroot)
|
||||||
XDeleteProperty(dpy, old_vroot->back, swm_vroot);
|
XDeleteProperty(dpy, old_vroot->back, ATOMS[__SWM_VROOT]);
|
||||||
setvroot(s->root, s);
|
setvroot(s->root, s);
|
||||||
XChangeProperty(dpy, s->back, swm_vroot, XA_WINDOW, 32, PropModeReplace,
|
XChangeProperty(dpy, s->back, ATOMS[__SWM_VROOT], XA_WINDOW, 32, PropModeReplace,
|
||||||
(unsigned char *)&(s->back), 1);
|
(unsigned char *)&(s->back), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user