Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Wayland/EGL support #124

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft

Conversation

Schievel1
Copy link
Contributor

@Schievel1 Schievel1 commented Oct 17, 2024

This adds wayland support and rendering via EGL instead of GLX.

Adds configure flags —with-x11 and —with-wayland.
If built with both, it detects the environ variable WAYLAND_DISPLAY at Startup and if found it starts as a wayland surface. Otherwise it starts as X11 window and renders with GLX as before.
—with-x11 is set by default, switching it off only drops the dependency on Xrender (yet).
—with-wayland adds the configure flag —with-libdecor and a dependency on libxkbcommon. —with-libdecor adds a dependency on libdecor. Libdecor is used to draw client side decorations if the compositor doesn’t support server side decorations. Without libdecor electric sheep starts without window decorations if the compositor does not support server side decorations.

When running as a wayland client it is possible to direct the output to wlr_layer_shell and run electric sheep as an animated background. For this set environment variable ELECTRICSHEEP_BACKGROUND. (Maybe going to put this in config GUI or via startup flag)

Double click to toggle full screen (if compositor is ok with it). Otherwise it uses the same key binds like electric sheep on X11.

--with-wayland adds dependencies dev-libs/wayland, media-libs/libglvnd (needed for wayland/EGL output), x11-libs/libxkbcommon and build dependency dev-util/wayland-scanner
--with-libdecor adds dependency gui-libs/libdecor (needed for client side decorations)

Since freeglut has no functioning wayland build (see freeglut/freeglut#72, freeglut/freeglut#141), xwayland is still needed for Elecritsheep to function properly, even when completely on wayland. (Will show Unable to open display '' when display variable is not set, see freeglut/freeglut#51)

  • test configure flags and desired effect on dependencies
  • currently this is rudimentary output handling. If made full screen it always goes full screen on the first output wayland finds. -> does not matter, when started in compositor the compositor handles this.
  • double tap with touch should toggle full screen as well as mouse
  • add wayland protocol extension using Autotools and wayland-scanner instead of putting in the sources manually -> will add build-dep on dev-util/wayland-scanner
  • proper handling of mouse
  • handling of touch (maybe double touch = toggle fullscreen) (DONE but untested because no device)
  • setup wlr_layer_shell glviewport porperly
  • make work with swaylock-plugin to use as screensaver
  • write some instruction for usage with wayland, libdecor, wlr_layer_shell
  • needs some major clean up of the code in egl.cpp, egl.h

Signed-off-by: Pascal Jäger <[email protected]>
Signed-off-by: Pascal Jäger <[email protected]>
Signed-off-by: Pascal Jäger <[email protected]>
future me: make sure you have videos in ~/.electricsheep/content/mpeg.
Sometimes it takes ages to download those

Signed-off-by: Pascal Jäger <[email protected]>
server side or using libdecor
adds --with-libdecor configure flag

Signed-off-by: Pascal Jäger <[email protected]>
Signed-off-by: Pascal Jäger <[email protected]>
Signed-off-by: Pascal Jäger <[email protected]>
Signed-off-by: Pascal Jäger <[email protected]>
disabled fullscreen for now

Signed-off-by: Pascal Jäger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant