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
1=== modified file 'src/ubuntumirclient/input.cpp'
2--- src/ubuntumirclient/input.cpp 2015-12-07 16:20:47 +0000
3+++ src/ubuntumirclient/input.cpp 2015-12-22 20:14:57 +0000
4@@ -240,16 +240,9 @@
5 if (focused) {
6 mPendingFocusGainedEvents--;
7 ubuntuEvent->window->handleSurfaceFocused();
8- QWindowSystemInterface::handleWindowActivated(ubuntuEvent->window->window(), Qt::ActiveWindowFocusReason);
9- if (qGuiApp->applicationState() == Qt::ApplicationInactive) {
10- QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive);
11- }
12 } else if(!mPendingFocusGainedEvents) {
13 DLOG("[ubuntumirclient QPA] No windows have focus");
14 QWindowSystemInterface::handleWindowActivated(nullptr, Qt::ActiveWindowFocusReason);
15- if (qGuiApp->applicationState() == Qt::ApplicationActive) {
16- QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationInactive);
17- }
18 }
19 }
20 break;
21
22=== modified file 'src/ubuntumirclient/integration.cpp'
23--- src/ubuntumirclient/integration.cpp 2015-11-20 15:43:25 +0000
24+++ src/ubuntumirclient/integration.cpp 2015-12-22 20:14:57 +0000
25@@ -46,11 +46,8 @@
26 Q_UNUSED(options)
27 Q_UNUSED(context)
28 DASSERT(context != NULL);
29- if (qGuiApp->focusWindow()) {
30- QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive);
31- } else {
32- QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationInactive);
33- }
34+ QCoreApplication::postEvent(QCoreApplication::instance(),
35+ new QEvent(QEvent::ApplicationActivate));
36 }
37
38 static void aboutToStopCallback(UApplicationArchive *archive, void* context)
39@@ -64,7 +61,8 @@
40 } else {
41 qWarning("UbuntuClientIntegration aboutToStopCallback(): no input context");
42 }
43- QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended);
44+ QCoreApplication::postEvent(QCoreApplication::instance(),
45+ new QEvent(QEvent::ApplicationDeactivate));
46 }
47
48 UbuntuClientIntegration::UbuntuClientIntegration()
49@@ -177,9 +175,6 @@
50 case OpenGL:
51 return true;
52
53- case ApplicationState:
54- return true;
55-
56 case ThreadedOpenGL:
57 if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_THREADED_OPENGL")) {
58 return true;
59
60=== modified file 'src/ubuntumirclient/window.cpp'
61--- src/ubuntumirclient/window.cpp 2015-12-07 16:20:58 +0000
62+++ src/ubuntumirclient/window.cpp 2015-12-22 20:14:57 +0000
63@@ -537,6 +537,7 @@
64 // Therefore let's ensure we are up to date with the system clipboard now that we are getting
65 // focused again.
66 mClipboard->requestDBusClipboardContents();
67+ QWindowSystemInterface::handleWindowActivated(window(), Qt::ActiveWindowFocusReason);
68 }
69
70 void UbuntuWindow::setWindowState(Qt::WindowState state)

Subscribers

People subscribed via source and target branches