aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-events
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-04-26 17:48:37 -0400
committerKen Moore <ken@ixsystems.com>2018-04-26 17:50:10 -0400
commitf228077850b16fdd92310782aafe3f7f2b437adb (patch)
treeaa622a0787d40597cf251f6af75381be13349405 /src-qt5/core/lumina-desktop-unified/src-events
parentFix up the loading of *.desktop icons via LFileInfo (diff)
downloadlumina-f228077850b16fdd92310782aafe3f7f2b437adb.tar.gz
lumina-f228077850b16fdd92310782aafe3f7f2b437adb.tar.bz2
lumina-f228077850b16fdd92310782aafe3f7f2b437adb.zip
Commit a bunch more work on the Lumina 2 screen reservations.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-events')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp22
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.h1
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-events/Window-mgmt.cpp6
3 files changed, 21 insertions, 8 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp b/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp
index 0d1e9c10..2afdd8c2 100644
--- a/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp
@@ -568,12 +568,12 @@ void NativeWindowSystem::ChangeWindowProperties(NativeWindowObject* win, QList<
}
if(props.contains(NativeWindowObject::Visible)){
- qDebug() << "Check Window Visibility:" << vals[ props.indexOf(NativeWindowObject::Visible) ];
+ //qDebug() << "Check Window Visibility:" << vals[ props.indexOf(NativeWindowObject::Visible) ];
if( vals[ props.indexOf(NativeWindowObject::Visible) ].toBool() ){
- qDebug() << " - Map it!";
+ //qDebug() << " - Map it!";
xcb_map_window(QX11Info::connection(), win->id());
}else{
- qDebug() << " - Unmap it!";
+ //qDebug() << " - Unmap it!";
xcb_unmap_window(QX11Info::connection(), win->id());
}
}
@@ -630,6 +630,7 @@ void NativeWindowSystem::SetupNewWindow(NativeWindowObject *win){
Damage dmgID = XDamageCreate(QX11Info::display(), win->id(), XDamageReportRawRectangles);
win->addDamageID( (uint) dmgID); //save this for later
+ registerClientEvents(win->id());
}else{
/*
//xcb_reparent_window(QX11Info::connection(), win->id(), this->winId(), 0, 0);
@@ -643,7 +644,7 @@ void NativeWindowSystem::SetupNewWindow(NativeWindowObject *win){
*/
}
//win->addFrameWinID(this->winId());
- registerClientEvents(win->id());
+ //registerClientEvents(win->id());
}
QImage NativeWindowSystem::GetWindowImage(NativeWindowObject* win){
@@ -802,7 +803,7 @@ void NativeWindowSystem::NewWindowDetected(WId id){
NativeWindowObject *win = new NativeWindowObject(id);
//Register for events from this window
- registerClientEvents(win->id());
+ //registerClientEvents(win->id());
NWindows << win;
UpdateWindowProperties(win, NativeWindowObject::allProperties());
if(win->showWindowFrame()){
@@ -815,11 +816,16 @@ void NativeWindowSystem::NewWindowDetected(WId id){
connect(win, SIGNAL(RequestPing(WId)), this, SLOT(RequestPing(WId)) );
connect(win, SIGNAL(RequestReparent(WId, WId, QPoint)), this, SLOT(RequestReparent(WId, WId, QPoint)) );
connect(win, SIGNAL(RequestPropertiesChange(WId, QList<NativeWindowObject::Property>, QList<QVariant>)), this, SLOT(RequestPropertiesChange(WId, QList<NativeWindowObject::Property>, QList<QVariant>)) );
- connect(win, SIGNAL(VerifyNewGeometry(WId)), this, SLOT(CheckWindowPosition(WId)) );
+ connect(win, SIGNAL(WindowClosed(WId)), this, SLOT(WindowCloseDetected(WId)) );
+ //connect(win, SIGNAL(VerifyNewGeometry(WId)), this, SLOT(CheckWindowPosition(WId)) );
+ qDebug() << " - Setup New Window";
SetupNewWindow(win);
- CheckWindowPosition(id, true); //first time placement
- xcb_map_window(QX11Info::connection(), win->id());
+ qDebug() << " - Setup window position";
+ CheckWindowPosition(win, true); //first time placement
+ //xcb_map_window(QX11Info::connection(), win->id());
+ qDebug() << " - Emit new window signal";
emit NewWindowAvailable(win);
+ connect(win, SIGNAL(VerifyNewGeometry(WId)), this, SLOT(CheckWindowPosition(WId)) );
}
void NativeWindowSystem::NewTrayWindowDetected(WId id){
diff --git a/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.h b/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.h
index f6033674..405d3bc3 100644
--- a/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.h
+++ b/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.h
@@ -140,6 +140,7 @@ private slots:
void ArrangeWindows(WId primary, QString type);
void TileWindows(WId primary, QString type);
void CheckWindowPosition(WId id, bool newwindow = false);
+ void CheckWindowPosition(NativeWindowObject *win, bool newwindow = false);
void arrangeWindows(NativeWindowObject *primary, QString type, bool primaryonly = false);
signals:
diff --git a/src-qt5/core/lumina-desktop-unified/src-events/Window-mgmt.cpp b/src-qt5/core/lumina-desktop-unified/src-events/Window-mgmt.cpp
index 0b45c208..23bd3e40 100644
--- a/src-qt5/core/lumina-desktop-unified/src-events/Window-mgmt.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-events/Window-mgmt.cpp
@@ -91,8 +91,13 @@ void NativeWindowSystem::CheckWindowPosition(WId id, bool newwindow){
//used after a "drop" to validate/snap/re-arrange window(s) as needed
// if "newwindow" is true, then this is the first-placement routine for a window before it initially appears
NativeWindowObject* win = findWindow(id);
+ CheckWindowPosition(win, newwindow);
+}
+
+void NativeWindowSystem::CheckWindowPosition(NativeWindowObject *win, bool newwindow){
if(win==0){ return; } //invalid window
QRect geom = win->geometry();
+ qDebug() << "Got Window Geometry:" << geom;
bool changed = false;
//Make sure it is on the screen (quick check)
if(geom.x() < 0){ changed = true; geom.moveLeft(0); }
@@ -101,5 +106,6 @@ void NativeWindowSystem::CheckWindowPosition(WId id, bool newwindow){
if(geom.height() < 20){ changed = true; geom.setHeight(100); }
if(changed){ win->setGeometryNow(geom); }
//Now run it through the window arrangement routine
+ qDebug() << "ArrangeWindows";
arrangeWindows(win, newwindow ?"center" : "snap", true);
}
bgstack15