After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 774324 - Fail to build without wayland
Fail to build without wayland
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Other Preferences
git master
Other FreeBSD
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-12 14:53 UTC by Ting-Wei Lan
Modified: 2017-02-08 17:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
info: Fix build when Wayland is disabled (1.08 KB, patch)
2016-11-12 14:54 UTC, Ting-Wei Lan
none Details | Review
info: Fix build when Wayland is disabled (1.08 KB, patch)
2016-11-12 15:30 UTC, Ting-Wei Lan
none Details | Review
info: Fix build when Wayland is disabled (1.07 KB, patch)
2017-02-08 17:40 UTC, Bastien Nocera
committed Details | Review

Description Ting-Wei Lan 2016-11-12 14:53:32 UTC
In file panels/info/cc-info-panel.c, function get_graphics_data, both GDK_IS_X11_DISPLAY and GDK_IS_WAYLAND_DISPLAY are used when only one of them is available, causing linking error when wayland is disabled:

../panels/info/.libs/libinfo.a(cc-info-panel.o): In function `get_graphics_data':
cc-info-panel.c:(.text+0x673): undefined reference to `GDK_IS_WAYLAND_DISPLAY'
../panels/info/.libs/libinfo.a(cc-info-panel.o): In function `get_graphics_data':
cc-info-panel.c:(.text+0x673): undefined reference to `GDK_IS_WAYLAND_DISPLAY'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 1 Ting-Wei Lan 2016-11-12 14:54:21 UTC
Created attachment 339691 [details] [review]
info: Fix build when Wayland is disabled
Comment 2 Bastien Nocera 2016-11-12 15:01:26 UTC
Review of attachment 339691 [details] [review]:

gboolean x11_or_wayland = FALSE;
#ifdef GDK_WINDOWING_X11
x11_or_wayland = GDK_IS_X11_DISPLAY (display);
#endif
#ifdef GDK_WINDOWING_WAYLAND
x11_or_wayland = x11_or_wayland || GDK_IS_WAYLAND_DISPLAY (display);
#endif

...

::: panels/info/cc-info-panel.c
@@ +412,2 @@
 #if defined(GDK_WINDOWING_X11) || defined(GDK_WINDOWING_WAYLAND)
+  int x11_or_wayland = 0;

Why not a boolean?

@@ +413,3 @@
+  int x11_or_wayland = 0;
+#ifdef GDK_WINDOWING_X11
+  x11_or_wayland = x11_or_wayland || GDK_IS_X11_DISPLAY (display);

x11_or_wayland = GDK_IS_X11_DISPLAY (display);
Comment 3 Ting-Wei Lan 2016-11-12 15:09:11 UTC
(In reply to Bastien Nocera from comment #2)
> Review of attachment 339691 [details] [review] [review]:
> 
> Why not a boolean?
> 

Do you prefer GLib gboolean or C99 _Bool(bool)? Using either of them works here, but I am not sure if you have any preference.
Comment 4 Ting-Wei Lan 2016-11-12 15:30:59 UTC
Created attachment 339696 [details] [review]
info: Fix build when Wayland is disabled
Comment 5 Bastien Nocera 2017-02-08 17:40:13 UTC
Created attachment 345256 [details] [review]
info: Fix build when Wayland is disabled
Comment 6 Bastien Nocera 2017-02-08 17:40:46 UTC
Attachment 345256 [details] pushed as 33d8c94 - info: Fix build when Wayland is disabled