diff --git a/Source/wayland/WaylandServer+Cursor.m b/Source/wayland/WaylandServer+Cursor.m index 15a3f7c0..c0187560 100755 --- a/Source/wayland/WaylandServer+Cursor.m +++ b/Source/wayland/WaylandServer+Cursor.m @@ -38,6 +38,8 @@ #include #include "wayland-cursor.h" +extern void wl_cursor_destroy(struct wl_cursor *cursor); + // XXX should this be configurable by the user? #define DOUBLECLICK_DELAY 300 #define DOUBLECLICK_MOVE_THREASHOLD 3 @@ -852,4 +854,4 @@ - (void)mouseOptionsChanged:(NSNotification *)aNotif wlconfig->mouse_scroll_multiplier = 1.0f; } } -@end +@end \ No newline at end of file diff --git a/Source/wayland/WaylandServer+Keyboard.m b/Source/wayland/WaylandServer+Keyboard.m index 32c37474..c6132a67 100755 --- a/Source/wayland/WaylandServer+Keyboard.m +++ b/Source/wayland/WaylandServer+Keyboard.m @@ -31,6 +31,7 @@ #include #include #include +#include static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, diff --git a/Source/wayland/WaylandServer+Xdgshell.m b/Source/wayland/WaylandServer+Xdgshell.m index 8087ec24..8d0386a8 100644 --- a/Source/wayland/WaylandServer+Xdgshell.m +++ b/Source/wayland/WaylandServer+Xdgshell.m @@ -28,10 +28,11 @@ #include "wayland/WaylandServer.h" #include #include +#include static void xdg_surface_on_configure(void *data, struct xdg_surface *xdg_surface, - uint32_t serial) + uint32_t serial) { struct window *window = data; @@ -43,7 +44,6 @@ free(window); return; } - WaylandConfig *wlconfig = window->wlconfig; NSEvent *ev = nil; NSWindow *nswindow = GSWindowWithNumber(window->window_id); @@ -57,22 +57,22 @@ if (window->buffer_needs_attach) { [window->instance flushwindowrect:NSMakeRect(window->pos_x, window->pos_y, - window->width, window->height - ):window->window_id]; + window->width, window->height) + :window->window_id]; } - if (wlconfig->pointer.focus - && wlconfig->pointer.focus->window_id == window->window_id) + if (window->wlconfig->pointer.focus + && window->wlconfig->pointer.focus->window_id == window->window_id) { ev = [NSEvent otherEventWithType:NSAppKitDefined - location:NSZeroPoint - modifierFlags:0 - timestamp:0 - windowNumber:(int) window->window_id - context:GSCurrentContext() - subtype:GSAppKitWindowFocusIn - data1:0 - data2:0]; + location:NSZeroPoint + modifierFlags:0 + timestamp:0 + windowNumber:(int) window->window_id + context:GSCurrentContext() + subtype:GSAppKitWindowFocusIn + data1:0 + data2:0]; [nswindow sendEvent:ev]; } @@ -80,15 +80,14 @@ static void xdg_toplevel_configure(void *data, struct xdg_toplevel *xdg_toplevel, - int32_t width, int32_t height, struct wl_array *states) + int32_t width, int32_t height, struct wl_array *states) { struct window *window = data; - WaylandConfig *wlconfig = window->wlconfig; - NSDebugLog(@"[%d] xdg_toplevel_configure %ldx%ld", window->window_id, width, - height); + NSDebugLog(@"[%d] xdg_toplevel_configure %dx%d", window->window_id, width, + height); - // the compositor can send 0.0x0.0 + // The compositor can send 0x0 if (width == 0 || height == 0) { return; @@ -99,45 +98,43 @@ window->height = height; xdg_surface_set_window_geometry(window->xdg_surface, 0, 0, window->width, - window->height); + window->height); NSEvent *ev = [NSEvent otherEventWithType:NSAppKitDefined - location:NSMakePoint(0.0, 0.0) - modifierFlags:0 - timestamp:0 - windowNumber:window->window_id - context:GSCurrentContext() - subtype:GSAppKitWindowResized - data1:window->width - data2:window->height]; + location:NSMakePoint(0.0, 0.0) + modifierFlags:0 + timestamp:0 + windowNumber:window->window_id + context:GSCurrentContext() + subtype:GSAppKitWindowResized + data1:window->width + data2:window->height]; [(GSWindowWithNumber(window->window_id)) sendEvent:ev]; } - NSDebugLog(@"[%d] notify resize from backend=%ldx%ld", window->window_id, - width, height); + NSDebugLog(@"[%d] notify resize from backend=%dx%d", window->window_id, + width, height); } static void -xdg_toplevel_close_handler(void *data, struct zxdg_toplevel_v6 *xdg_toplevel) +xdg_toplevel_close_handler(void *data, struct xdg_toplevel *xdg_toplevel) { NSDebugLog(@"xdg_toplevel_close_handler"); } static void xdg_popup_configure(void *data, struct xdg_popup *xdg_popup, int32_t x, - int32_t y, int32_t width, int32_t height) + int32_t y, int32_t width, int32_t height) { struct window *window = data; - WaylandConfig *wlconfig = window->wlconfig; NSDebugLog(@"[%d] xdg_popup_configure [%d,%d %dx%d]", window->window_id, x, y, - width, height); + width, height); } static void xdg_popup_done(void *data, struct xdg_popup *xdg_popup) { struct window *window = data; - WaylandConfig *wlconfig = window->wlconfig; window->terminated = YES; xdg_popup_destroy(xdg_popup); wl_surface_destroy(window->surface); @@ -145,7 +142,7 @@ static void wm_base_handle_ping(void *data, struct xdg_wm_base *xdg_wm_base, - uint32_t serial) + uint32_t serial) { NSDebugLog(@"wm_base_handle_ping"); xdg_wm_base_pong(xdg_wm_base, serial); @@ -167,4 +164,4 @@ const struct xdg_toplevel_listener xdg_toplevel_listener = { .configure = xdg_toplevel_configure, .close = xdg_toplevel_close_handler, -}; +}; \ No newline at end of file diff --git a/Source/wayland/WaylandServer.m b/Source/wayland/WaylandServer.m index 61c33a75..39568213 100644 --- a/Source/wayland/WaylandServer.m +++ b/Source/wayland/WaylandServer.m @@ -781,7 +781,7 @@ - (void)createSurfaceShell:(struct window *)window break; case NSPopUpMenuWindowLevel: NSDebugLog(@"[%d] NSPopUpMenuWindowLevel", win); - [self createPopup:win]; + [self createPopup:window]; break; case NSScreenSaverWindowLevel: NSDebugLog(@"[%d] NSScreenSaverWindowLevel", win); @@ -1099,4 +1099,4 @@ - (void)destroyWindowShell:(struct window *)window wl_display_flush(window->wlconfig->display); } -@end +@end \ No newline at end of file