ewmh: Fix net_wm_state_fullscreen management.

This commit is contained in:
Martin Duquesnoy 2009-04-21 22:51:30 +02:00
parent 9057489d92
commit 78d0572a70
3 changed files with 39 additions and 36 deletions

View File

@ -381,15 +381,20 @@ client_map(Client *c)
{
CHECK(c);
XMapWindow(dpy, c->frame);
XMapSubwindows(dpy, c->frame);
if(TBARH - BORDH)
if(c->state_fullscreen)
XMapWindow(dpy, c->win);
else
{
barwin_map(c->titlebar);
barwin_map_subwin(c->titlebar);
XMapWindow(dpy, c->frame);
XMapSubwindows(dpy, c->frame);
if(TBARH - BORDH)
{
barwin_map(c->titlebar);
barwin_map_subwin(c->titlebar);
}
XMapSubwindows(dpy, c->frame);
c->unmapped = False;
}
XMapSubwindows(dpy, c->frame);
c->unmapped = False;
return;
}
@ -562,7 +567,8 @@ client_maximize(Client *c)
{
XRectangle geo;
CHECK(c);
if(!c || c->state_fullscreen)
return;
client_focus(c);
@ -573,13 +579,6 @@ client_maximize(Client *c)
geo.width = sgeo[c->screen].width - BORDH * 2;
geo.height = sgeo[c->screen].height - BORDH;
if(c->state_fullscreen)
{
geo.y -= INFOBARH;
geo.height += INFOBARH;
}
client_moveresize(c, geo, False);
return;
@ -772,15 +771,20 @@ client_unmap(Client *c)
{
CHECK(c);
if(TBARH - BORDH)
if(c->state_fullscreen)
XUnmapWindow(dpy, c->win);
else
{
barwin_unmap_subwin(c->titlebar);
barwin_unmap(c->titlebar);
}
if(TBARH - BORDH)
{
barwin_unmap_subwin(c->titlebar);
barwin_unmap(c->titlebar);
}
XUnmapWindow(dpy, c->frame);
XUnmapSubwindows(dpy, c->frame);
c->unmapped = True;
XUnmapWindow(dpy, c->frame);
XUnmapSubwindows(dpy, c->frame);
c->unmapped = True;
}
return;
}

View File

@ -253,16 +253,23 @@ ewmh_manage_net_wm_state(long data_l[], Client *c)
{
if(data_l[0] == _NET_WM_STATE_ADD && !c->state_fullscreen)
{
client_unmap(c);
c->unmapped = False;
XMapWindow(dpy, c->win);
XReparentWindow(dpy, c->win, ROOT, spgeo[selscreen].x, spgeo[selscreen].y);
XResizeWindow(dpy, c->win, spgeo[selscreen].x + spgeo[selscreen].width, spgeo[selscreen].y + spgeo[selscreen].height);
c->state_fullscreen = True;
c->tmp_geo = c->geo;
if(c->free)
c->ogeo = c->geo;
client_maximize(c);
c->max = True;
client_raise(c);
}
else if(data_l[0] == _NET_WM_STATE_REMOVE && c->state_fullscreen)
{
c->state_fullscreen = False;
client_map(c);
XReparentWindow(dpy, c->win, c->frame, BORDH, TBARH);
client_moveresize(c, c->tmp_geo, False);
tags[selscreen][seltag[selscreen]].layout.func(selscreen);
}

View File

@ -286,24 +286,16 @@ main(int argc, char **argv)
int i;
struct sigaction sig;
static struct option long_options[] = {
{"help", 0, NULL, 'h'},
{"info", 0, NULL, 'i'},
{"version", 0, NULL, 'v'},
{NULL, 0, NULL, 0}
};
while ((i = getopt_long(argc, argv, "hvi", long_options, NULL)) != -1)
while ((i = getopt(argc, argv, "hvi")) != -1)
{
switch (i)
{
case 'h':
default:
printf("Usage: wmfs [OPTION]\n"
" -h, --help show this page\n"
" -i, --info show informations\n"
" -v, --version show WMFS version\n");
printf("usage: %s [-ihv]\n"
" -h show this page\n"
" -i show informations\n"
" -v show WMFS version\n", argv[0]);
exit(EXIT_SUCCESS);
break;
case 'i':