Merge lp:~saviq/qtubuntu/revert-application.active into lp:qtubuntu

Proposed by Michał Sawicz
Status: Work in progress
Proposed branch: lp:~saviq/qtubuntu/revert-application.active
Merge into: lp:qtubuntu
Diff against target: 70 lines (+5/-16)
3 files modified
src/ubuntumirclient/input.cpp (+0/-7)
src/ubuntumirclient/integration.cpp (+4/-9)
src/ubuntumirclient/window.cpp (+1/-0)
To merge this branch: bzr merge lp:~saviq/qtubuntu/revert-application.active
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) Disapprove
PS Jenkins bot continuous-integration Approve
Review via email: mp+281253@code.launchpad.net

Commit message

Revert r298 that broke Qt.application.state

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

I think the fix should be as simple as not deleting the code that the original MP removed, instead of reverting everything.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> I think the fix should be as simple as not deleting the code that the original
> MP removed, instead of reverting everything.

Hmmm, actually the problem is not that as we don't have to send the deprecated events since Qt feeds the deprecated API from the new one.

It's about a behavioral change really, as that new code is more accurate but it maybe hit some bug, like after unlock the foreground app doesn't have focus or something. investigating.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :
review: Disapprove

Unmerged revisions

302. By Michał Sawicz

Revert r298 that broke Qt.application.state

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/ubuntumirclient/input.cpp'
--- src/ubuntumirclient/input.cpp 2015-12-07 16:20:47 +0000
+++ src/ubuntumirclient/input.cpp 2015-12-22 20:14:57 +0000
@@ -240,16 +240,9 @@
240 if (focused) {240 if (focused) {
241 mPendingFocusGainedEvents--;241 mPendingFocusGainedEvents--;
242 ubuntuEvent->window->handleSurfaceFocused();242 ubuntuEvent->window->handleSurfaceFocused();
243 QWindowSystemInterface::handleWindowActivated(ubuntuEvent->window->window(), Qt::ActiveWindowFocusReason);
244 if (qGuiApp->applicationState() == Qt::ApplicationInactive) {
245 QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive);
246 }
247 } else if(!mPendingFocusGainedEvents) {243 } else if(!mPendingFocusGainedEvents) {
248 DLOG("[ubuntumirclient QPA] No windows have focus");244 DLOG("[ubuntumirclient QPA] No windows have focus");
249 QWindowSystemInterface::handleWindowActivated(nullptr, Qt::ActiveWindowFocusReason);245 QWindowSystemInterface::handleWindowActivated(nullptr, Qt::ActiveWindowFocusReason);
250 if (qGuiApp->applicationState() == Qt::ApplicationActive) {
251 QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationInactive);
252 }
253 }246 }
254 }247 }
255 break;248 break;
256249
=== modified file 'src/ubuntumirclient/integration.cpp'
--- src/ubuntumirclient/integration.cpp 2015-11-20 15:43:25 +0000
+++ src/ubuntumirclient/integration.cpp 2015-12-22 20:14:57 +0000
@@ -46,11 +46,8 @@
46 Q_UNUSED(options)46 Q_UNUSED(options)
47 Q_UNUSED(context)47 Q_UNUSED(context)
48 DASSERT(context != NULL);48 DASSERT(context != NULL);
49 if (qGuiApp->focusWindow()) {49 QCoreApplication::postEvent(QCoreApplication::instance(),
50 QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive);50 new QEvent(QEvent::ApplicationActivate));
51 } else {
52 QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationInactive);
53 }
54}51}
5552
56static void aboutToStopCallback(UApplicationArchive *archive, void* context)53static void aboutToStopCallback(UApplicationArchive *archive, void* context)
@@ -64,7 +61,8 @@
64 } else {61 } else {
65 qWarning("UbuntuClientIntegration aboutToStopCallback(): no input context");62 qWarning("UbuntuClientIntegration aboutToStopCallback(): no input context");
66 }63 }
67 QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended);64 QCoreApplication::postEvent(QCoreApplication::instance(),
65 new QEvent(QEvent::ApplicationDeactivate));
68}66}
6967
70UbuntuClientIntegration::UbuntuClientIntegration()68UbuntuClientIntegration::UbuntuClientIntegration()
@@ -177,9 +175,6 @@
177 case OpenGL:175 case OpenGL:
178 return true;176 return true;
179177
180 case ApplicationState:
181 return true;
182
183 case ThreadedOpenGL:178 case ThreadedOpenGL:
184 if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_THREADED_OPENGL")) {179 if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_THREADED_OPENGL")) {
185 return true;180 return true;
186181
=== modified file 'src/ubuntumirclient/window.cpp'
--- src/ubuntumirclient/window.cpp 2015-12-07 16:20:58 +0000
+++ src/ubuntumirclient/window.cpp 2015-12-22 20:14:57 +0000
@@ -537,6 +537,7 @@
537 // Therefore let's ensure we are up to date with the system clipboard now that we are getting537 // Therefore let's ensure we are up to date with the system clipboard now that we are getting
538 // focused again.538 // focused again.
539 mClipboard->requestDBusClipboardContents();539 mClipboard->requestDBusClipboardContents();
540 QWindowSystemInterface::handleWindowActivated(window(), Qt::ActiveWindowFocusReason);
540}541}
541542
542void UbuntuWindow::setWindowState(Qt::WindowState state)543void UbuntuWindow::setWindowState(Qt::WindowState state)

Subscribers

People subscribed via source and target branches