Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quasar-wayland
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
quasar-wayland
Compare revisions
f70b3901b1cde6853215f1f07ab2492b4ae7d045 to 0cf000f60a8fe63fc01e31b8b2200a53085e5008
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
jens/quasar-wayland
Select target project
No results found
0cf000f60a8fe63fc01e31b8b2200a53085e5008
Select Git revision
Branches
master
wrong_configure_serial
Swap
Target
jens/quasar-wayland
Select target project
jens/quasar-wayland
1 result
f70b3901b1cde6853215f1f07ab2492b4ae7d045
Select Git revision
Branches
master
wrong_configure_serial
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (3)
Add compositorGlobal
· cbf4c384
Jens Nolte
authored
2 years ago
cbf4c384
Fix server example
· 010b3a16
Jens Nolte
authored
2 years ago
010b3a16
Update nixpkgs
· 0cf000f6
Jens Nolte
authored
2 years ago
0cf000f6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
examples/Server.hs
+28
-1
28 additions, 1 deletion
examples/Server.hs
flake.lock
+3
-3
3 additions, 3 deletions
flake.lock
flake.nix
+1
-1
1 addition, 1 deletion
flake.nix
src/Quasar/Wayland/Server.hs
+16
-0
16 additions, 0 deletions
src/Quasar/Wayland/Server.hs
with
48 additions
and
5 deletions
examples/Server.hs
View file @
0cf000f6
...
...
@@ -2,12 +2,39 @@ module Main (main) where
import
Quasar
import
Quasar.Prelude
import
Quasar.Wayland.Surface
import
Quasar.Wayland.Server
import
Quasar.Wayland.Server.Registry
import
Quasar.Wayland.Protocol
import
Quasar.Wayland.Protocol.Generated
main
::
IO
()
main
=
runQuasarAndExit
(
stderrLogger
LogLevelWarning
)
do
registry
<-
newRegistry
let
shmGlobal
=
createGlobal
@
Interface_wl_shm
maxVersion
(
\
_
->
traceM
"wl_shm not implemented"
)
layerShellGlobal
=
createGlobal
@
Interface_zwlr_layer_shell_v1
maxVersion
(
\
x
->
setRequestHandler
x
layerShellHandler
)
registry
<-
newRegistry
[
compositorGlobal
@
ShmBufferBackend
,
shmGlobal
,
layerShellGlobal
]
server
<-
newWaylandServer
registry
listenAt
"example.socket"
server
sleepForever
layerShellHandler
::
RequestHandler_zwlr_layer_shell_v1
layerShellHandler
=
RequestHandler_zwlr_layer_shell_v1
{
get_layer_surface
=
\
wlLayerSurface
_
_
_
_
->
setRequestHandler
wlLayerSurface
layerSurfaceHandler
,
destroy
=
pure
()
}
layerSurfaceHandler
::
RequestHandler_zwlr_layer_surface_v1
layerSurfaceHandler
=
RequestHandler_zwlr_layer_surface_v1
{
set_size
=
\
_
_
->
pure
()
,
set_anchor
=
\
_
->
pure
()
,
set_exclusive_zone
=
\
_
->
pure
()
,
set_margin
=
\
_
_
_
_
->
pure
()
,
set_keyboard_interactivity
=
\
_
->
pure
()
,
get_popup
=
\
_
->
pure
()
,
ack_configure
=
\
_
->
pure
()
,
destroy
=
pure
()
,
set_layer
=
\
_
->
pure
()
}
This diff is collapsed.
Click to expand it.
flake.lock
View file @
0cf000f6
...
...
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 16
59077768
,
"narHash": "sha256-
P0XIHBVty6WIuIrk2DZNvLcYev9956y1prT4zL212H8
=",
"lastModified": 16
60396586
,
"narHash": "sha256-
ePuWn7z/J5p2lO7YokOG1o01M0pDDVL3VrStaPpS5Ig
=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "
2a93ea177c3d7700b934bf95adfe00c435f696b8
",
"rev": "
e105167e98817ba9fe079c6c3c544c6ef188e276
",
"type": "github"
},
"original": {
...
...
This diff is collapsed.
Click to expand it.
flake.nix
View file @
0cf000f6
...
...
@@ -21,7 +21,7 @@
];
};
in
rec
{
default
=
quasar-wayland
;
quasar-wayland
=
pkgs
.
haskell
.
packages
.
ghc92
3
.
quasar-wayland
;
quasar-wayland
=
pkgs
.
haskell
.
packages
.
ghc92
4
.
quasar-wayland
;
}
);
...
...
This diff is collapsed.
Click to expand it.
src/Quasar/Wayland/Server.hs
View file @
0cf000f6
...
...
@@ -4,6 +4,7 @@ module Quasar.Wayland.Server (
newWaylandServer
,
newWaylandServerConnection
,
listenAt
,
compositorGlobal
,
)
where
import
Control.Monad.Catch
...
...
@@ -13,8 +14,10 @@ import Quasar.Prelude
import
Quasar.Wayland.Connection
import
Quasar.Wayland.Protocol
import
Quasar.Wayland.Protocol.Generated
import
Quasar.Wayland.Region
import
Quasar.Wayland.Server.Registry
import
Quasar.Wayland.Server.Socket
import
Quasar.Wayland.Surface
data
WaylandServer
=
WaylandServer
{
...
...
@@ -58,3 +61,16 @@ listenAt socketPath server = disposeOnError do
asyncWithUnmask_
\
_
->
forever
do
socket
<-
atomically
$
takeTMVar
var
newWaylandServerConnection
server
socket
compositorGlobal
::
forall
b
.
BufferBackend
b
=>
Global
compositorGlobal
=
createGlobal
@
Interface_wl_compositor
maxVersion
bindCompositor
where
bindCompositor
::
Object
'Server
Interface_wl_compositor
->
STM
()
bindCompositor
wlCompositor
=
setMessageHandler
wlCompositor
handler
handler
::
RequestHandler_wl_compositor
handler
=
RequestHandler_wl_compositor
{
create_surface
=
initializeServerSurface
@
b
,
create_region
=
initializeServerRegion
}
This diff is collapsed.
Click to expand it.