File tree 5 files changed +60
-1
lines changed
5 files changed +60
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ endif()
57
57
58
58
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR} /paths .in ${CMAKE_CURRENT_BINARY_DIR} /paths .vala)
59
59
60
+ file (GLOB_RECURSE C_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.c)
60
61
file (GLOB_RECURSE VALA_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.vala)
61
62
list (REMOVE_ITEM VALA_SRC paths .vala)
62
63
if (MOVIES)
@@ -87,11 +88,12 @@ GENERATE_VAPI
87
88
presenter
88
89
CUSTOM_VAPIS
89
90
${CMAKE_CURRENT_BINARY_DIR} /paths .vala
91
+ ${CMAKE_CURRENT_SOURCE_DIR} /custom_binding.vapi
90
92
)
91
93
92
-
93
94
add_executable (pdfpc
94
95
${VALA_C}
96
+ ${C_SRC}
95
97
)
96
98
97
99
# explicitly add libraries (needed e.g. for Fedora 13+)
Original file line number Diff line number Diff line change @@ -108,6 +108,12 @@ namespace pdfpc.Window {
108
108
}
109
109
110
110
this . gdk_scale = this . screen_to_use. get_monitor_scale_factor(this . screen_num_to_use);
111
+ if (Pdfpc . is_Wayland_backend()) {
112
+ // See issue 214. Wayland is doing some double scaling therefore
113
+ // we are lying about the actual screen size
114
+ this . screen_geometry. width / = this . gdk_scale;
115
+ this . screen_geometry. height / = this . gdk_scale;
116
+ }
111
117
112
118
this . overlay_layout = new Gtk .Overlay ();
113
119
this . pointer_drawing_surface = new Gtk .DrawingArea ();
Original file line number Diff line number Diff line change
1
+ [CCode (cheader_filename = " display_backend.h" )]
2
+ namespace Pdfpc {
3
+ [CCode (cname = "is_Wayland_backend ")]
4
+ bool is_Wayland_backend ();
5
+
6
+ [CCode (cname = "is_X11_backend ")]
7
+ bool is_X11_backend ();
8
+ }
Original file line number Diff line number Diff line change
1
+ #include "display_backend.h"
2
+
3
+ #include <stdio.h>
4
+
5
+ #include <gdk/gdk.h>
6
+ #ifdef GDK_WINDOWING_X11
7
+ #include <gdk/gdkx.h>
8
+ #endif
9
+ #ifdef GDK_WINDOWING_WAYLAND
10
+ #include <gdk/gdkwayland.h>
11
+ #endif
12
+
13
+ bool is_Wayland_backend () {
14
+ GdkDisplay * gdk_display = gdk_display_get_default ();
15
+ #ifdef GDK_WINDOWING_WAYLAND
16
+ if (GDK_IS_WAYLAND_DISPLAY (gdk_display )) {
17
+ return true;
18
+ }
19
+ #endif
20
+
21
+ return false;
22
+ }
23
+
24
+ bool is_X11_backend () {
25
+ GdkDisplay * gdk_display = gdk_display_get_default ();
26
+ #ifdef GDK_WINDOWING_X11
27
+ if (GDK_IS_X11_DISPLAY (gdk_display )) {
28
+ return true;
29
+ }
30
+ #endif
31
+
32
+ return false;
33
+ }
34
+
Original file line number Diff line number Diff line change
1
+ #ifndef DISPLAY_BACKEND_H
2
+ #define DISPLAY_BACKEND_H
3
+
4
+ #include <stdbool.h>
5
+
6
+ bool is_Wayland_backend ();
7
+ bool is_X11_backend ();
8
+
9
+ #endif
You can’t perform that action at this time.
0 commit comments