diff options
author | Ken Moore <ken@pcbsd.org> | 2015-06-20 10:51:28 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-06-20 10:51:28 -0400 |
commit | 4928230485cbd3bfc42a4596f935c9963671eef2 (patch) | |
tree | e0e1d9f49070ad887a08df8d6028d28d4c2d47a8 /libLumina/LuminaX11.cpp | |
parent | Clean up the desktop plugin/container interactions quite a bit to ensure cons... (diff) | |
download | lumina-4928230485cbd3bfc42a4596f935c9963671eef2.tar.gz lumina-4928230485cbd3bfc42a4596f935c9963671eef2.tar.bz2 lumina-4928230485cbd3bfc42a4596f935c9963671eef2.zip |
Add a new function to luminaX11: WindowFrameGeometry() - returns the sizes of the frame on each side of the given window.
Diffstat (limited to 'libLumina/LuminaX11.cpp')
-rw-r--r-- | libLumina/LuminaX11.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp index 3ee3c918..770f64db 100644 --- a/libLumina/LuminaX11.cpp +++ b/libLumina/LuminaX11.cpp @@ -950,8 +950,8 @@ QRect LXCB::WindowGeometry(WId win, bool includeFrame){ //adjust the origin point to account for the frame geom.translate(-frame.left, -frame.top); //move to the orign point for the frame //adjust the size (include the frame sizes) - //geom.setWidth( geom.width() + frame.left + frame.right ); - //geom.setHeight( geom.height() + frame.top + frame.bottom ); + geom.setWidth( geom.width() + frame.left + frame.right ); + geom.setHeight( geom.height() + frame.top + frame.bottom ); } //qDebug() << " - Frame:" << frame.left << frame.right << frame.top << frame.bottom; //qDebug() << " - Modified with Frame:" << geom.x() << geom.y() << geom.width() << geom.height(); @@ -970,7 +970,21 @@ QRect LXCB::WindowGeometry(WId win, bool includeFrame){ }else{ //Need to do another catch for this situation (probably not mapped yet) } - + return geom; +} + +QList<int> LXCB::WindowFrameGeometry(WId win){ + //Returns: [top, bottom, left, right] sizes for the frame + QList<int> geom; + xcb_get_property_cookie_t cookie = xcb_ewmh_get_frame_extents_unchecked(&EWMH, win); + if(cookie.sequence != 0){ + xcb_ewmh_get_extents_reply_t frame; + if(1== xcb_ewmh_get_frame_extents_reply(&EWMH, cookie, &frame, NULL) ){ + //adjust the origin point to account for the frame + geom << frame.top << frame.bottom << frame.left << frame.right; + } + } + if(geom.isEmpty()){ geom << 0 << 0 << 0 << 0; } return geom; } |