22
22
#include <stdio.h>
23
23
#include <assert.h>
24
24
25
+ #include "config.h"
26
+ #ifdef HAVE_NEW_WESTON = 1
25
27
#include <libweston-1/compositor.h>
28
+ #else
29
+ #include <weston/compositor.h>
30
+ #endif
26
31
27
32
#include "shell-helper-server-protocol.h"
28
33
@@ -71,7 +76,11 @@ shell_helper_move_surface(struct wl_client *client,
71
76
static void
72
77
configure_surface (struct weston_surface * es , int32_t sx , int32_t sy )
73
78
{
79
+ #ifdef HAVE_NEW_WESTON
74
80
struct weston_view * existing_view = es -> committed_private ;
81
+ #else
82
+ struct weston_view * existing_view = es -> configure_private ;
83
+ #endif
75
84
struct weston_view * new_view ;
76
85
77
86
new_view = container_of (es -> views .next , struct weston_view , surface_link );
@@ -97,12 +106,21 @@ shell_helper_add_surface_to_layer(struct wl_client *client,
97
106
struct weston_view * new_view , * existing_view , * next ;
98
107
struct wl_layer * layer ;
99
108
109
+ #ifdef HAVE_NEW_WESTON
100
110
if (new_surface -> committed ) {
101
111
wl_resource_post_error (new_surface_resource ,
102
112
WL_DISPLAY_ERROR_INVALID_OBJECT ,
103
113
"surface role already assigned" );
104
114
return ;
105
115
}
116
+ #else
117
+ if (new_surface -> configure ) {
118
+ wl_resource_post_error (new_surface_resource ,
119
+ WL_DISPLAY_ERROR_INVALID_OBJECT ,
120
+ "surface role already assigned" );
121
+ return ;
122
+ }
123
+ #endif
106
124
107
125
existing_view = container_of (existing_surface -> views .next ,
108
126
struct weston_view ,
@@ -112,15 +130,24 @@ shell_helper_add_surface_to_layer(struct wl_client *client,
112
130
weston_view_destroy (new_view );
113
131
new_view = weston_view_create (new_surface );
114
132
133
+ #ifdef HAVE_NEW_WESTON
115
134
new_surface -> committed = configure_surface ;
116
135
new_surface -> committed_private = existing_view ;
136
+ #else
137
+ new_surface -> configure = configure_surface ;
138
+ new_surface -> configure_private = existing_view ;
139
+ #endif
117
140
new_surface -> output = existing_view -> output ;
118
141
}
119
142
120
143
static void
121
144
configure_panel (struct weston_surface * es , int32_t sx , int32_t sy )
122
145
{
146
+ #ifdef HAVE_NEW_WESTON
123
147
struct shell_helper * helper = es -> committed_private ;
148
+ #else
149
+ struct shell_helper * helper = es -> configure_private ;
150
+ #endif
124
151
struct weston_view * view ;
125
152
126
153
view = container_of (es -> views .next , struct weston_view , surface_link );
@@ -147,16 +174,25 @@ shell_helper_set_panel(struct wl_client *client,
147
174
* it hasn't yet been defined because the original surface configure
148
175
* function hasn't yet been called. if we call it here we will have
149
176
* access to the layer. */
177
+ #ifdef HAVE_NEW_WESTON
150
178
surface -> committed (surface , 0 , 0 );
179
+ #else
180
+ surface -> configure (surface , 0 , 0 );
181
+ #endif
151
182
152
183
helper -> panel_layer = container_of (view -> layer_link .link .next ,
153
184
struct weston_layer ,
154
185
view_list .link );
155
186
156
187
/* set new configure functions that only ensure the surface is in the
157
188
* correct layer. */
189
+ #ifdef HAVE_NEW_WESTON
158
190
surface -> committed = configure_panel ;
159
191
surface -> committed_private = helper ;
192
+ #else
193
+ surface -> configure = configure_panel ;
194
+ surface -> configure_private = helper ;
195
+ #endif
160
196
}
161
197
162
198
enum SlideState {
0 commit comments