I am currently working with C and SDL2, and I need to know whether Wayland is currently used as the windowing system (Obviously because I want to use Wayland, but SDL2 defaults to Xwayland). While SDL_VIDEODRIVER=wayland does work, it won't work if you are in X11, saying that the video driver is unavailable. So, what I am looking for, is a low-level way of getting the current windowing system (Possibly by asking the compositor?) on GNU/Linux. It also needs to be unmodifiable, that is, no application or user will be able to change it unless the session ends.
Is there a way to find whether theuser is using Wayland instead of X11, WITHOUT enviroment variables? (C)
920 Views Asked by AggelosT At
1
There are 1 best solutions below
Related Questions in C
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in LINUX
- Is there some way to use printf to print a horizontal list of decrementing hex digits in NASM assembly on Linux
- Why does Hugo generate different taxonomy-related HTML on different OS's?
- Writes in io_uring do not advance the file offset
- Why `set -o pipefail` gives different output even though the pipe is not failing
- what really controls the permissions: UID or eUID?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Docker container unable to make HTTPS requests to external API
- Whow to use callback_query_handler in Python 3.10
- Create kea runtime directory at startup in Yocto image
- Problem on CPU scheduling algorithms in OS
- How to copy files into the singularity sandbox?
- Android kernel error: undefined reference to `get_hw_version_platform'
- Is there a need for BPF Linux namespace?
- Error when trying to execute a binary compiled in a Kali Linux machine on an Ubuntu system
- Issue with launching application after updating ElectronJs to version 28.0.0 on Windows and Linux
Related Questions in SDL
- Brick Breaker Ball Bounce
- SDL create bordrerless window with rounded corner
- About the Euler 'ZXY' Rotation Matrix
- How to handle structs/abstract data types in multiple files in C/SDL2
- Visual Studio CMakeList.txt can't find SDL.dll file
- C/SDL program, render not working with my renderer
- Homebrew can't install SDL_image and SDL_ttf (macos verson 10.13.6 High Sierra)
- macos unable to find SDL2/SDL.h file even with compiler args
- Inconsitent detection of joystick button input using SDL in C# with the use of TPL
- separating gameloop input from simulation
- framerate-independent movement (c++ and SDL)
- C language server on Zed for SDL
- How to handle collision after a diagonal movement with rectangles
- Why does this code work on Desktop but not Android?
- Slight delay when pressing key in SDL. How can I fix it?
Related Questions in WAYLAND
- How to render Font/Text in wayland in Ubuntu with egl?
- How to configure XWayland to accept remote X client connections in Debian 12?
- Synchronizing input, desktop video capture, and sound capture on Linux
- Custom event type on wayland/weston
- sdl2 c program on wayland doesn't show window
- How do I fix sway waybar not displaying my custom module?
- Weston VNC together with QT
- Raspberry PI5 & QtWebEngine errors :page_allocator_internals_posix.h(225)] Check failed: . : Invalid argument (22)
- Do you have to implement all listener functions?
- Setting the resolution of QTile as a wayland compositor
- Use wlr-randr from a second user
- Scenebuilder don't work correctly under wayland
- Difference of shell execution between command mode and interactive mode
- No wayland-egl support when building Qt from source on Raspberry Pi 5
- Force The Location Of A Gtk4 Window On A Wayland WM
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Initialize SDL with no subsystem via
SDL_Init(0)then ask SDL to connect to whatever Wayland session is running viaSDL_VideoInit("wayland"); if that call succeeds you're good to go with the usualSDL_Init(SDL_INIT_EVERYTHING)& window creation.Though for more robustness you should iterate over the
SDL_GetNumVideoDrivers()/SDL_GetVideoDriver()string list to verify the SDL install in use was even built with Wayland support.See the test program here for video driver enumeration & testing.