Bug 446163 - kalarm: src/messagewindow.cpp:1258:45: error: invalid use of incomplete type ‘class QScreen’
Summary: kalarm: src/messagewindow.cpp:1258:45: error: invalid use of incomplete type ...
Status: RESOLVED FIXED
Alias: None
Product: kalarm
Classification: Applications
Component: general (show other bugs)
Version: 3.3.3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: David Jarvie
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-27 12:26 UTC by Andreas Sturmlechner
Modified: 2021-11-27 22:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 21.12.0
Sentry Crash Report:


Attachments
build.log (301.59 KB, text/x-log)
2021-11-27 12:26 UTC, Andreas Sturmlechner
Details
kalarm-21.11.90-with_x11.patch (1.30 KB, patch)
2021-11-27 12:28 UTC, Andreas Sturmlechner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Sturmlechner 2021-11-27 12:26:15 UTC
Created attachment 143998 [details]
build.log

When building without X11, QScreen include is hidden behind #ifdef KDEPIM_HAVE_X11 inside src/messagewindow.cpp, but the code still depends on QScreen:

src/messagewindow.cpp: In member function ‘bool MessageWindow::getWorkAreaAndModal()’:
src/messagewindow.cpp:1258:45: error: invalid use of incomplete type ‘class QScreen’
 1258 |         if (QGuiApplication::primaryScreen()->virtualSiblings().size() > 1)
      |                                             ^~
In file included from /usr/include/qt5/QtWidgets/qwidget.h:55,
                 from /usr/include/qt5/QtWidgets/qmainwindow.h:44,
                 from /usr/include/qt5/QtWidgets/QMainWindow:1,
                 from /usr/include/KF5/KXmlGui/kmainwindow.h:20,
                 from /usr/include/KF5/KXmlGui/kxmlguiwindow.h:17,
                 from /usr/include/KF5/KXmlGui/KXmlGuiWindow:1,
                 from src/mainwindowbase.h:11,
                 from src/messagewindow.h:11,
                 from src/messagewindow.cpp:9:
/usr/include/qt5/QtGui/qcursor.h:51:7: note: forward declaration of ‘class QScreen’
   51 | class QScreen;
      |       ^~~~~~~
src/messagewindow.cpp:1265:44: error: invalid use of incomplete type ‘class QScreen’
 1265 |                 screenRects[s] = screens[s]->geometry();
      |                                            ^~
In file included from /usr/include/qt5/QtWidgets/qwidget.h:55,
                 from /usr/include/qt5/QtWidgets/qmainwindow.h:44,
                 from /usr/include/qt5/QtWidgets/QMainWindow:1,
                 from /usr/include/KF5/KXmlGui/kmainwindow.h:20,
                 from /usr/include/KF5/KXmlGui/kxmlguiwindow.h:17,
                 from /usr/include/KF5/KXmlGui/KXmlGuiWindow:1,
                 from src/mainwindowbase.h:11,
                 from src/messagewindow.h:11,
                 from src/messagewindow.cpp:9:
/usr/include/qt5/QtGui/qcursor.h:51:7: note: forward declaration of ‘class QScreen’
   51 | class QScreen;
      |       ^~~~~~~

Attaching full build.log.
Comment 1 Andreas Sturmlechner 2021-11-27 12:28:44 UTC
Created attachment 143999 [details]
kalarm-21.11.90-with_x11.patch

If you are wondering, to be able to reproduce this build failure despite having Frameworks deps built with X11 support, I've had to apply the following patch as is referenced from build.log.
Comment 2 David Jarvie 2021-11-27 17:10:59 UTC
This is now fixed for release 20.12 by commit 1165d034d766e9550feaf4236d489597e88a2c60.

Note that although the build error has been fixed, the detection of full screen windows remains to be implemented on Wayland - so far, it isn't clear if or how this can be done.
Comment 3 Andreas Sturmlechner 2021-11-27 17:24:00 UTC
(In reply to David Jarvie from comment #2)
> This is now fixed for release 20.12 by commit
> 1165d034d766e9550feaf4236d489597e88a2c60.
> 
> Note that although the build error has been fixed, the detection of full
> screen windows remains to be implemented on Wayland - so far, it isn't clear
> if or how this can be done.

You probably wanted to target 21.12 branch with that instead. ;)
Comment 4 David Jarvie 2021-11-27 22:37:33 UTC
I must be a bit behind the times - I'm glad you noticed! Fixed now for release 21.12 by commit 32f11895cfc6fa6288f44165e0aaadda7bbba48c.