Ewmh/Event/Frame: Fix bug with mplayer in fullscreen and FREE layout reported by philpep and remove titlebar limit for title drawing.

This commit is contained in:
Martin Duquesnoy 2009-06-14 03:06:10 +02:00
parent 7957618a26
commit fba8e7b25f
6 changed files with 43 additions and 55 deletions

View File

@ -244,57 +244,47 @@ clientmessageevent(XClientMessageEvent *ev)
* \param ev XEvent pointer * \param ev XEvent pointer
*/ */
void void
configureevent(XEvent *ev) configureevent(XConfigureRequestEvent *ev)
{ {
XWindowChanges wc; XWindowChanges wc;
XWindowAttributes win_at, ev_at;
XRectangle geo = { 0 };
Client *c; Client *c;
/* Check part */ /* Check part */
if((c = client_gb_win(ev->xconfigurerequest.window)) if((c = client_gb_win(ev->window))
|| (c = client_gb_win(ev->xconfigure.window))) || (c = client_gb_win(ev->window)))
{ {
CHECK(!c->tile); CHECK(!c->tile);
CHECK(!c->lmax); CHECK(!c->lmax);
CHECK(!c->max);
CHECK(!c->state_fullscreen); CHECK(!c->state_fullscreen);
} }
/* Configure Request Part {{{ */ /* Configure Request Part {{{ */
wc.x = ev->xconfigurerequest.x; if((c= client_gb_win(ev->window)))
wc.y = ev->xconfigurerequest.y;
wc.width = ev->xconfigurerequest.width;
wc.height = ev->xconfigurerequest.height;
wc.border_width = ev->xconfigurerequest.border_width;
wc.sibling = ev->xconfigurerequest.above;
wc.stack_mode = ev->xconfigurerequest.detail;
XConfigureWindow(dpy, ev->xconfigurerequest.window,
ev->xconfigurerequest.value_mask, &wc);
/* }}} */
/* Configure Notify Part {{{*/
if((c = client_gb_win(ev->xconfigure.window)))
{ {
XGetWindowAttributes(dpy, ev->xconfigure.window, &win_at); if(ev->value_mask & CWX)
XGetWindowAttributes(dpy, ev->xconfigure.event, &ev_at); c->geo.x = ev->x + BORDH;
if(ev->value_mask & CWY)
c->geo.y = ev->y + TBARH;
if(ev->value_mask & CWWidth)
c->geo.width = ev->width;
if(ev->value_mask & CWHeight)
c->geo.height = ev->height;
/* Frame config */
if(win_at.width != ev_at.width
|| win_at.height != ev_at.height)
{
c->ogeo.width = c->geo.width = geo.width = ev->xconfigure.width;
c->ogeo.height = c->geo.height = geo.height = ev->xconfigure.height;
frame_moveresize(c, geo);
client_moveresize(c, c->geo, False); client_moveresize(c, c->geo, False);
} }
else
{
wc.x = ev->x;
wc.y = ev->y;
wc.width = ev->width;
wc.height = ev->height;
wc.border_width = ev->border_width;
wc.sibling = ev->above;
wc.stack_mode = ev->detail;
/* Win config (re-adjust it with the frame) */ XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
if(ev->xconfigure.x != BORDH
|| ev->xconfigure.y != BORDH + TBARH)
XMoveWindow(dpy, ev->xconfigure.window, BORDH, TBARH);
} }
/* }}} */
return; return;
} }
@ -547,7 +537,7 @@ getevent(XEvent ev)
{ {
case ButtonPress: buttonpress(&ev.xbutton); break; case ButtonPress: buttonpress(&ev.xbutton); break;
case ClientMessage: clientmessageevent(&ev.xclient); break; case ClientMessage: clientmessageevent(&ev.xclient); break;
case ConfigureRequest: configureevent(&ev); break; case ConfigureRequest: configureevent(&ev.xconfigurerequest); break;
case DestroyNotify: destroynotify(&ev.xdestroywindow); break; case DestroyNotify: destroynotify(&ev.xdestroywindow); break;
case EnterNotify: enternotify(&ev.xcrossing); break; case EnterNotify: enternotify(&ev.xcrossing); break;
case Expose: expose(&ev.xexpose); break; case Expose: expose(&ev.xexpose); break;

View File

@ -304,7 +304,6 @@ ewmh_manage_net_wm_state(long data_l[], Client *c)
client_map(c); client_map(c);
XReparentWindow(dpy, c->win, c->frame, BORDH, TBARH); XReparentWindow(dpy, c->win, c->frame, BORDH, TBARH);
client_moveresize(c, c->tmp_geo, False); client_moveresize(c, c->tmp_geo, False);
tags[selscreen][seltag[selscreen]].layout.func(selscreen);
} }
} }
/* Manage _NET_WM_STATE_DEMANDS_ATTENTION */ /* Manage _NET_WM_STATE_DEMANDS_ATTENTION */
@ -316,6 +315,7 @@ ewmh_manage_net_wm_state(long data_l[], Client *c)
if(c == sel) if(c == sel)
client_focus(NULL); client_focus(NULL);
} }
return; return;
} }

View File

@ -248,7 +248,7 @@ frame_update(Client *c)
XClearWindow(dpy, c->bottom); XClearWindow(dpy, c->bottom);
} }
if((TBARH - BORDH) && (TBARH + BORDH + 1) > font->height) if(TBARH - BORDH)
barwin_draw_text(c->titlebar, barwin_draw_text(c->titlebar,
(c->frame_geo.width / 2) - (textw(c->title) / 2), (c->frame_geo.width / 2) - (textw(c->title) / 2),
((font->height - font->descent) + (TBARH - font->height) / 2), ((font->height - font->descent) + (TBARH - font->height) / 2),

View File

@ -51,10 +51,6 @@ init(void)
ewmh_update_current_tag_prop(); ewmh_update_current_tag_prop();
grabkeys(); grabkeys();
/* Warning about font */
if(TBARH + BORDH < font->height)
fprintf(stderr, "WMFS Warning: Font too big, can't draw any text in the titlebar.\n");
return; return;
} }

View File

@ -65,7 +65,9 @@ freelayout(int screen)
Client *c; Client *c;
for(c = clients; c; c = c->next) for(c = clients; c; c = c->next)
if(!ishide(c, selscreen) && c->screen == screen_get_sel()) if(!ishide(c, selscreen)
&& c->screen == screen_get_sel()
&& !c->state_fullscreen)
{ {
client_moveresize(c, c->ogeo, True); client_moveresize(c, c->ogeo, True);
c->tile = c->lmax = False; c->tile = c->lmax = False;

View File

@ -188,7 +188,7 @@ void init_conf(void);
/* event.c */ /* event.c */
void buttonpress(XButtonEvent *ev); void buttonpress(XButtonEvent *ev);
void configureevent(XEvent *ev); void configureevent(XConfigureRequestEvent *ev);
void clientmessageevent(XClientMessageEvent *ev); void clientmessageevent(XClientMessageEvent *ev);
void destroynotify(XDestroyWindowEvent *ev); void destroynotify(XDestroyWindowEvent *ev);
void enternotify(XCrossingEvent *ev); void enternotify(XCrossingEvent *ev);