aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libLumina/LuminaX11.cpp20
-rw-r--r--libLumina/LuminaX11.h3
2 files changed, 19 insertions, 4 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;
}
diff --git a/libLumina/LuminaX11.h b/libLumina/LuminaX11.h
index 0a950d63..468045d1 100644
--- a/libLumina/LuminaX11.h
+++ b/libLumina/LuminaX11.h
@@ -131,7 +131,8 @@ public:
//Window Information
QString WindowClass(WId);
unsigned int WindowWorkspace(WId); //The workspace the window is on
- QRect WindowGeometry(WId, bool includeFrame = true); //the geometry of the window (frame excluded)
+ QRect WindowGeometry(WId win, bool includeFrame = true); //the geometry of the window (frame excluded)
+ QList<int> WindowFrameGeometry(WId win); //Returns: [top,bottom,left,right] sizes of the frame
WINDOWSTATE WindowState(WId win); //Visible state of window
QString WindowVisibleIconName(WId win); //_NET_WM_VISIBLE_ICON_NAME
QString WindowIconName(WId win); //_NET_WM_ICON_NAME
bgstack15