Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added frame-extents support + gravity to client. #329

Merged
merged 1 commit into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions client.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ managereply(XCBWindow win, XCBCookie requests[ManageCookieLAST])
updateicon(c, iconreply);
/* check if should be floating after, all size hints and other things are set. */
clientinitfloat(c);
clientinitdecor(c);
XCBSelectInput(_wm.dpy, win, inputmask);
grabbuttons(c, 0);

Expand Down Expand Up @@ -1500,11 +1501,30 @@ setskiptaskbar(Client *c, uint8_t state)
void
setshowdecor(Client *c, uint8_t state)
{
return;
/* TODO, Implement this.
* As of now this is not implemented but for the sake of being NetWM Compliant,
* We just set the decorations to be 0, (AKA No decorations)
*/
state = 0;
enum __FrameExtents
{
__FrameExtentsLW, /* Left "decoration" Width */
__FrameExtentsRW, /* Right "decoration" Width */
__FrameExtentsTW, /* Top "decoration" Width, AKA the Height */
__FrameExtentsBW, /* Bottom "decoration" Width, AKA the Height */
};
u32 data[4] = { 0, 0, 0, 0 };
if(state)
{
if(c->decor->win)
{ XCBMapWindow(_wm.dpy, c->decor->win);
{
Decoration *decor = c->decor;
XCBMapWindow(_wm.dpy, decor->win);
/* as of now not supported but eventually */
data[0] = 0;
data[1] = 0;
data[2] = decor->h;
data[3] = 0;
}
}
else
Expand All @@ -1514,6 +1534,7 @@ setshowdecor(Client *c, uint8_t state)
}
}
SETFLAG(c->flags, ClientFlagShowDecor, !!state);
XCBChangeProperty(_wm.dpy, c->win, netatom[NetWMFrameExtents], XCB_ATOM_CARDINAL, 32, XCB_PROP_MODE_REPLACE, (unsigned char *)data, 4);
}

void
Expand Down
1 change: 1 addition & 0 deletions client.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ struct Client
uint16_t flags; /* Misc States */

uint32_t ewmhflags; /* EWMH types/states */
enum XCBBitGravity gravity; /* Client gravity */
};


Expand Down
7 changes: 6 additions & 1 deletion events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,12 @@ clientmessage(XCBGenericEvent *event)
sync = 1;
}
else if(atom == netatom[NetRequestFrameExtents])
{ /* TODO */
{
/* TODO Implement getframeextents() macro.
* See comment on top setshowdecor().
*/
const u32 _data[4] = { 0, 0, 0, 0 };
XCBChangeProperty(_wm.dpy, c->win, netatom[NetRequestFrameExtents], XCB_ATOM_CARDINAL, 32, XCB_PROP_MODE_REPLACE, (unsigned char *)_data, 4);
}
else if (atom == netatom[NetNumberOfDesktops])
{ /* ignore */
Expand Down