-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce the OBS_PLATFORM_WAYLAND enum value, and try to detect it when OBS Studio runs by looking into the platform name.
- Loading branch information
1 parent
b492263
commit 5707ede
Showing
11 changed files
with
246 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Try to find Wayland on a Unix system | ||
# | ||
# This will define: | ||
# | ||
# WAYLAND_FOUND - True if Wayland is found | ||
# WAYLAND_LIBRARIES - Link these to use Wayland | ||
# WAYLAND_INCLUDE_DIR - Include directory for Wayland | ||
# WAYLAND_DEFINITIONS - Compiler flags for using Wayland | ||
# | ||
# In addition the following more fine grained variables will be defined: | ||
# | ||
# WAYLAND_CLIENT_FOUND WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES | ||
# WAYLAND_SERVER_FOUND WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES | ||
# WAYLAND_EGL_FOUND WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES | ||
# | ||
# Copyright (c) 2013 Martin Gräßlin <[email protected]> | ||
# | ||
# Redistribution and use is allowed according to the terms of the BSD license. | ||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
|
||
IF (NOT WIN32) | ||
IF (WAYLAND_INCLUDE_DIR AND WAYLAND_LIBRARIES) | ||
# In the cache already | ||
SET(WAYLAND_FIND_QUIETLY TRUE) | ||
ENDIF () | ||
|
||
# Use pkg-config to get the directories and then use these values | ||
# in the FIND_PATH() and FIND_LIBRARY() calls | ||
FIND_PACKAGE(PkgConfig) | ||
PKG_CHECK_MODULES(PKG_WAYLAND QUIET wayland-client wayland-server wayland-egl wayland-cursor) | ||
|
||
SET(WAYLAND_DEFINITIONS ${PKG_WAYLAND_CFLAGS}) | ||
|
||
FIND_PATH(WAYLAND_CLIENT_INCLUDE_DIR NAMES wayland-client.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) | ||
FIND_PATH(WAYLAND_SERVER_INCLUDE_DIR NAMES wayland-server.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) | ||
FIND_PATH(WAYLAND_EGL_INCLUDE_DIR NAMES wayland-egl.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) | ||
FIND_PATH(WAYLAND_CURSOR_INCLUDE_DIR NAMES wayland-cursor.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) | ||
|
||
FIND_LIBRARY(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) | ||
FIND_LIBRARY(WAYLAND_SERVER_LIBRARIES NAMES wayland-server HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) | ||
FIND_LIBRARY(WAYLAND_EGL_LIBRARIES NAMES wayland-egl HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) | ||
FIND_LIBRARY(WAYLAND_CURSOR_LIBRARIES NAMES wayland-cursor HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) | ||
|
||
set(WAYLAND_INCLUDE_DIR ${WAYLAND_CLIENT_INCLUDE_DIR} ${WAYLAND_SERVER_INCLUDE_DIR} ${WAYLAND_EGL_INCLUDE_DIR} ${WAYLAND_CURSOR_INCLUDE_DIR}) | ||
|
||
set(WAYLAND_LIBRARIES ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_EGL_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES}) | ||
|
||
list(REMOVE_DUPLICATES WAYLAND_INCLUDE_DIR) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CLIENT DEFAULT_MSG WAYLAND_CLIENT_LIBRARIES WAYLAND_CLIENT_INCLUDE_DIR) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_SERVER DEFAULT_MSG WAYLAND_SERVER_LIBRARIES WAYLAND_SERVER_INCLUDE_DIR) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_EGL DEFAULT_MSG WAYLAND_EGL_LIBRARIES WAYLAND_EGL_INCLUDE_DIR) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CURSOR DEFAULT_MSG WAYLAND_CURSOR_LIBRARIES WAYLAND_CURSOR_INCLUDE_DIR) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIR) | ||
|
||
MARK_AS_ADVANCED( | ||
WAYLAND_INCLUDE_DIR WAYLAND_LIBRARIES | ||
WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES | ||
WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES | ||
WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES | ||
WAYLAND_CURSOR_INCLUDE_DIR WAYLAND_CURSOR_LIBRARIES | ||
) | ||
|
||
ENDIF () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/****************************************************************************** | ||
Copyright (C) 2019 by Jason Francis <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
******************************************************************************/ | ||
|
||
#include "obs-internal.h" | ||
#include "obs-nix-wayland.h" | ||
|
||
#include <wayland-client.h> | ||
|
||
void obs_nix_wayland_log_info(void) | ||
{ | ||
struct wl_display *display = obs_get_platform_display(); | ||
if (display == NULL) { | ||
blog(LOG_INFO, "Unable to connect to Wayland server"); | ||
return; | ||
} | ||
blog(LOG_INFO, "Connected to Wayland server"); | ||
} | ||
|
||
/* | ||
* Placeholders here until wayland gets a global hotkey protocol. | ||
*/ | ||
|
||
static bool | ||
obs_nix_wayland_hotkeys_platform_init(struct obs_core_hotkeys *hotkeys) | ||
{ | ||
UNUSED_PARAMETER(hotkeys); | ||
return true; | ||
} | ||
|
||
static void | ||
obs_nix_wayland_hotkeys_platform_free(struct obs_core_hotkeys *hotkeys) | ||
{ | ||
UNUSED_PARAMETER(hotkeys); | ||
} | ||
|
||
static bool | ||
obs_nix_wayland_hotkeys_platform_is_pressed(obs_hotkeys_platform_t *context, | ||
obs_key_t key) | ||
{ | ||
UNUSED_PARAMETER(context); | ||
UNUSED_PARAMETER(key); | ||
return false; | ||
} | ||
|
||
static void obs_nix_wayland_key_to_str(obs_key_t key, struct dstr *dstr) | ||
{ | ||
UNUSED_PARAMETER(key); | ||
UNUSED_PARAMETER(dstr); | ||
} | ||
|
||
static obs_key_t obs_nix_wayland_key_from_virtual_key(int sym) | ||
{ | ||
UNUSED_PARAMETER(sym); | ||
return OBS_KEY_NONE; | ||
} | ||
|
||
static int obs_nix_wayland_key_to_virtual_key(obs_key_t key) | ||
{ | ||
UNUSED_PARAMETER(key); | ||
return 0; | ||
} | ||
|
||
static const struct obs_nix_hotkeys_vtable wayland_hotkeys_vtable = { | ||
.init = obs_nix_wayland_hotkeys_platform_init, | ||
.free = obs_nix_wayland_hotkeys_platform_free, | ||
.is_pressed = obs_nix_wayland_hotkeys_platform_is_pressed, | ||
.key_to_str = obs_nix_wayland_key_to_str, | ||
.key_from_virtual_key = obs_nix_wayland_key_from_virtual_key, | ||
.key_to_virtual_key = obs_nix_wayland_key_to_virtual_key, | ||
|
||
}; | ||
|
||
const struct obs_nix_hotkeys_vtable *obs_nix_wayland_get_hotkeys_vtable(void) | ||
{ | ||
return &wayland_hotkeys_vtable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/****************************************************************************** | ||
Copyright (C) 2019 by Jason Francis <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
******************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include "obs-nix.h" | ||
|
||
void obs_nix_wayland_log_info(void); | ||
|
||
const struct obs_nix_hotkeys_vtable *obs_nix_wayland_get_hotkeys_vtable(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters