Skip to content

Commit

Permalink
fixing build for non webOS platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Nov 9, 2023
1 parent 4146c8a commit ccc9ac9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/video/wayland/SDL_waylandmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,9 @@ void Wayland_InitMouse(void)
mouse->WarpMouse = Wayland_WarpMouse;
mouse->WarpMouseGlobal = Wayland_WarpMouseGlobal;
mouse->SetRelativeMouseMode = Wayland_SetRelativeMouseMode;
#if SDL_VIDEO_DRIVER_WAYLAND_WEBOS
mouse->WebOSSetCursorVisibility = WaylandWebOS_SetCursorVisibility;
#endif /* SDL_VIDEO_DRIVER_WAYLAND_WEBOS */

input->relative_mode_override = SDL_FALSE;
input->cursor_visible = SDL_TRUE;
Expand Down
4 changes: 4 additions & 0 deletions src/video/wayland/SDL_waylandvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,9 @@ int Wayland_VideoInit(_THIS)
// Second roundtrip to receive all output events.
WAYLAND_wl_display_roundtrip(data->display);

#if SDL_VIDEO_DRIVER_WAYLAND_WEBOS
WaylandWebOS_VideoInit(_this);
#endif /* SDL_VIDEO_DRIVER_WAYLAND_WEBOS */

Wayland_InitMouse();

Expand Down Expand Up @@ -1095,7 +1097,9 @@ static void Wayland_VideoCleanup(_THIS)
Wayland_QuitWin(data);
Wayland_FiniMouse(data);

#if SDL_VIDEO_DRIVER_WAYLAND_WEBOS
WaylandWebOS_VideoCleanUp(_this);
#endif /* SDL_VIDEO_DRIVER_WAYLAND_WEBOS */

for (i = _this->num_displays - 1; i >= 0; --i) {
SDL_VideoDisplay *display = &_this->displays[i];
Expand Down
10 changes: 8 additions & 2 deletions src/video/wayland/SDL_waylandwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1390,13 +1390,16 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window)
xdg_toplevel_set_app_id(data->shell_surface.xdg.roleobj.toplevel, c->classname);
xdg_toplevel_add_listener(data->shell_surface.xdg.roleobj.toplevel, &toplevel_listener_xdg, data);
}
} else if (c->shell.wl) {
}
#if SDL_VIDEO_DRIVER_WAYLAND_WEBOS
else if (c->shell.wl) {
if (window->flags & SDL_WINDOW_FULLSCREEN) {
wl_shell_surface_set_fullscreen(data->shell_surface.webos.wl, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, NULL);
} else {
wl_shell_surface_set_toplevel(data->shell_surface.webos.wl);
}
}
#endif /* SDL_VIDEO_DRIVER_WAYLAND_WEBOS */

/* Restore state that was set prior to this call */
Wayland_SetWindowTitle(_this, window);
Expand Down Expand Up @@ -1661,9 +1664,12 @@ static void Wayland_activate_window(SDL_VideoData *data, SDL_WindowData *wind,
xdg_activation_token_v1_set_serial(wind->activation_token, serial, seat);
}
xdg_activation_token_v1_commit(wind->activation_token);
} else if (wind->shell_surface.webos.webos) {
}
#if SDL_VIDEO_DRIVER_WAYLAND_WEBOS
else if (wind->shell_surface.webos.webos) {
wl_webos_shell_surface_set_state(wind->shell_surface.webos.webos, WL_WEBOS_SHELL_SURFACE_STATE_FULLSCREEN);
}
#endif /* SDL_VIDEO_DRIVER_WAYLAND_WEBOS */
}

void Wayland_RaiseWindow(_THIS, SDL_Window *window)
Expand Down

0 comments on commit ccc9ac9

Please sign in to comment.