Skip to content
Snippets Groups Projects
Commit 26c34d41 authored by Jens Nolte's avatar Jens Nolte
Browse files

Move getBuffer to server module

parent 5b291d5e
No related branches found
No related tags found
No related merge requests found
module Quasar.Wayland.Server.Surface (
initializeServerSurface,
initializeWlBuffer,
getBuffer,
) where
import Control.Monad.Catch
import Quasar.Prelude
import Quasar.Wayland.Protocol
import Quasar.Wayland.Protocol.Generated
......@@ -104,3 +106,10 @@ initializeWlBuffer wlBuffer buffer = do
-- TODO propagate buffer destruction
destroy = destroyBuffer buffer
}
getBuffer :: forall b. BufferBackend b => Object 'Server Interface_wl_buffer -> STM (Buffer b)
getBuffer wlBuffer = do
ifd <- getInterfaceData @(Buffer b) wlBuffer
case ifd of
Just buffer -> pure buffer
Nothing -> throwM $ InternalError ("Missing interface data on " <> show wlBuffer)
......@@ -5,7 +5,6 @@ module Quasar.Wayland.Surface (
newBuffer,
lockBuffer,
destroyBuffer,
getBuffer,
-- * Surface
Damage(..),
......@@ -76,14 +75,6 @@ tryFinalizeBuffer buffer = do
releaseBufferStorage @b buffer.content
getBuffer :: forall b. BufferBackend b => Object 'Server Interface_wl_buffer -> STM (Buffer b)
getBuffer wlBuffer = do
ifd <- getInterfaceData @(Buffer b) wlBuffer
case ifd of
Just buffer -> pure buffer
Nothing -> throwM $ InternalError ("Missing interface data on " <> show wlBuffer)
class SurfaceRole a where
surfaceRoleName :: a -> String
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment