commit e8a836c
Michael Forney
·
2013-11-24 10:28:12 +0000 UTC
parent 58622c7
Use global state for display and event_loop
3 files changed,
+6,
-7
+4,
-3
1@@ -23,6 +23,7 @@
2
3 #include "shell.h"
4 #include "shell_surface.h"
5+#include "private.h"
6
7 #include <wayland-server.h>
8
9@@ -60,10 +61,10 @@ static void bind_shell(struct wl_client * client, void * data,
10 wl_resource_set_implementation(resource, &shell_implementation, NULL, NULL);
11 }
12
13-bool swc_shell_initialize(struct wl_display * display)
14+bool swc_shell_initialize()
15 {
16- shell.global = wl_global_create(display, &wl_shell_interface, 1, NULL,
17- &bind_shell);
18+ shell.global = wl_global_create(swc.display, &wl_shell_interface, 1,
19+ NULL, &bind_shell);
20
21 return shell.global;
22 }
+1,
-3
1@@ -26,9 +26,7 @@
2
3 #include <stdbool.h>
4
5-struct wl_display;
6-
7-bool swc_shell_initialize(struct wl_display * display);
8+bool swc_shell_initialize();
9 void swc_shell_finalize();
10
11 #endif
+1,
-1
1@@ -64,7 +64,7 @@ bool swc_initialize(struct wl_display * display,
2
3 swc_compositor_add_globals(&compositor, display);
4
5- if (!swc_shell_initialize(display))
6+ if (!swc_shell_initialize())
7 {
8 fprintf(stderr, "Could not initialize shell\n");
9 goto error2;