Bug 457152

Summary: kwin commit 6576a83ae breaks build: missing QApplication
Product: [Plasma] kwin Reporter: Duncan <1i5t5.duncan>
Component: effects-variousAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kde
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: This fixes it for me.

Description Duncan 2022-07-26 09:03:56 UTC
On git master for kwin, frameworks and plasma using the gentoo/kde overlay live git ebuilds.  My current kwin HEAD is b7d7a99f in case it's fixed while I'm filing this.

kwin commit (email addresses masked)....

* commit 6576a83ae
Author:     David Redondo <kde@>
AuthorDate: Wed Jun 29 13:52:52 2022 +0200
Commit:     David Redondo <kde@>
CommitDate: Wed Jul 20 07:01:05 2022 +0000

Add outputlocator effect

An effect that implements the "identify" functionality of
the screen configuration kcm. It displays a label on each
screen that identifies the screen.
Doing this as a kwin effect allows to correctly handle
the case when outputs are mirrored (on wayland) compared to
absolute positioning of windows which end up on top of each other.

... breaks my build with the following error:

In file included from /tmp/portage/kde-plasma/kwin-9999/work/kwin-9999/src/effects/outputlocator/outputlocator.cpp:10:
/tmp/portage/kde-plasma/kwin-9999/work/kwin-9999/src/main.h:21:10: fatal error: QApplication: No such file or directory
21 | #include <QApplication>

Missing a Qt::Widgets in CMakeLists.txt under target_link_libraries(kwin4_effect_outputlocator PRIVATE ??
Comment 1 Duncan 2022-07-26 09:20:45 UTC
CCing David as author/committer.
Comment 2 Duncan 2022-07-26 09:29:19 UTC
Created attachment 150918 [details]
This fixes it for me.

Indeed, a Qt:Widgets line seems to do it.  I'm not a coder so I don't know if this is the "correct" fix, but it works for me.  (And I only know git from a gentoo-running consumer side so a gitlab merge request is beyond me.)
Comment 3 Bug Janitor Service 2022-07-26 09:57:27 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2722
Comment 4 David Redondo 2022-07-26 10:29:47 UTC
Git commit 1f9c3178788d793d05a9065163569cb035b759c8 by David Redondo.
Committed on 26/07/2022 at 10:06.
Pushed by davidre into branch 'master'.

Remove unneeded include

M  +0    -1    src/effects/outputlocator/outputlocator.cpp

https://invent.kde.org/plasma/kwin/commit/1f9c3178788d793d05a9065163569cb035b759c8
Comment 5 Duncan 2022-07-26 11:11:14 UTC
(In reply to David Redondo from comment #4)
> Git commit 1f9c3178788d793d05a9065163569cb035b759c8 by David Redondo.
> Committed on 26/07/2022 at 10:06.
> Pushed by davidre into branch 'master'.
> 
> Remove unneeded include

Doesn't seem to do it.  Still getting a similar altho slightly different in the details error:

/tmp/portage/kde-plasma/kwin-9999/work/kwin-9999/src/effects/outputlocator/outputlocator.cpp:11:10: fatal error: QApplication: No such file or directory
11 | #include <QApplication>
|          ^~~~~~~~~~~~~~
compilation terminated.
Comment 6 Duncan 2022-07-26 11:19:18 UTC
(In reply to Duncan from comment #5)
> (In reply to David Redondo from comment #4)
> > Remove unneeded include
> 
> Doesn't seem to do it.  Still getting a similar altho slightly different in
> the details error:

... and reenabling my patch with the Qt::Widgets line still builds fine, so indeed, the include you removed doesn't appear to be needed, but removing it doesn't fix the problem of the missing QApplication.
Comment 7 Bug Janitor Service 2022-07-26 11:32:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2724
Comment 8 David Redondo 2022-07-26 13:01:53 UTC
Git commit 0fc4bf7fbad50b1ef39d957fe9a8f2fa5f92ec41 by David Redondo.
Committed on 26/07/2022 at 11:32.
Pushed by davidre into branch 'master'.

Remove another unneded include

GIT_SILENT

M  +0    -1    src/effects/outputlocator/outputlocator.cpp

https://invent.kde.org/plasma/kwin/commit/0fc4bf7fbad50b1ef39d957fe9a8f2fa5f92ec41