You are not logged in.
Long story short, I am writing a window tiler similar to QuickTile. The problem I am having is that using either xlib directly or libwnck, the window geometries are being returned including the shadow backdrop. What I ultimately want to be able to do is read and set the window geometry without the shadow. I believe xfwm knows how to do this. For example: go to Windows Manager -> Keyboard and assign a key to "Right". Hitting that key will move the window to the right side of the screen, with the shadow clipped off the right edge of the screen.
My question is, can somebody who is familiar with the xfwm code point me to where this boarder is computed, or to perhaps a theme library or other code/library that can be used to get this information?
Much thanks,
Morgan
Offline
Have a look at src/moveresize.c:clientCheckSize:97.
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
Thank you.
I was able to determine the size of the shadows/decorations on CSD windows using the X _GTK_FRAME_EXTENTS atom and some help from hints.c::getCardinalList()
typedef struct {
unsigned long left;
unsigned long right;
unsigned long top;
unsigned long bottom;
} Extent;
Extent decorationsExtent = {0, 0, 0, 0};
unsigned long *cardinals_p;
int n_cardinals_p;
Atom type;
int format;
unsigned int i;
unsigned long n_cardinals;
unsigned long bytes_after;
unsigned char *propertyData;
Atom gtkFrameExtentAtom = XInternAtom(_xDisplay, "_GTK_FRAME_EXTENTS", false);
int status = XGetWindowProperty(_xDisplay, wnck_window_get_xid(&window),
gtkFrameExtentAtom,
0, G_MAXLONG,
FALSE,
XA_CARDINAL,
&type, &format,
&n_cardinals, &bytes_after,
(unsigned char **)&propertyData);
if ((status == Success) && (propertyData != NULL) && (type != None)) {
unsigned long* cardinals = (unsigned long*)propertyData;
for (int i=0; i<n_cardinals; ++i) {
unsigned long item = cardinals[i] & ((1LL << format) - 1);
printf("d[%d]: %d\n", i, item);
((unsigned long*)(&decorationsExtent))[i] = cardinals[i] & ((1LL << format) - 1);
}
}
Offline
Interesting. Thanks for sharing.
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
Alternatively, you can do this by staying pretty much in GTK/Wnck code via a Libxfce4ui helper: https://gitlab.xfce.org/xfce/xfce4-pane … ow.c#L2485
Last edited by Tamaranch (2022-09-23 07:40:58)
Offline
[ Generated in 0.005 seconds, 7 queries executed - Memory usage: 531.2 KiB (Peak: 532.05 KiB) ]