Skip to content

Commit

Permalink
AGL Compositor
Browse files Browse the repository at this point in the history
-working example agl-simple-shm
-XdgOutput protocol implementation to find primary display
-set width and height to match the configured maximized state

Signed-off-by: Joel Winarske <[email protected]>
  • Loading branch information
jwinarske committed May 3, 2024
1 parent 34792fc commit b816db5
Show file tree
Hide file tree
Showing 28 changed files with 1,149 additions and 100 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ for developers to build Wayland-based applications using C++.

## Tested Compositors

* AGL (Coming)
* Automotive Grade Linux (AGL)
* Mutter
* Weston
* WLRoots
Expand Down
19 changes: 11 additions & 8 deletions cmake/wayland.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ if (ENABLE_DRM_LEASE_CLIENT)
add_protocol(${WAYLAND_PROTOCOLS_BASE}/staging/drm-lease/drm-lease-v1.xml)
endif ()

add_protocol(${WAYLAND_PROTOCOLS_BASE}/stable/presentation-time/presentation-time.xml)
message(STATUS "Presentation Time ..... ${HAS_WAYLAND_PROTOCOL_PRESENTATION_TIME}")

#
# Optional
#
add_protocol(${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml)
message(STATUS "XDG Decoration ........ ${HAS_WAYLAND_PROTOCOL_XDG_DECORATION_UNSTABLE_V1}")

add_protocol(${WAYLAND_PROTOCOLS_BASE}/staging/fractional-scale/fractional-scale-v1.xml)
message(STATUS "Fractional Scale ...... ${HAS_WAYLAND_PROTOCOL_FRACTIONAL_SCALE_V1}")

Expand All @@ -100,8 +100,11 @@ message(STATUS "Viewporter ............ ${HAS_WAYLAND_PROTOCOL_VIEWPORTER}")
add_protocol(${WAYLAND_PROTOCOLS_BASE}/staging/tearing-control/tearing-control-v1.xml)
message(STATUS "Tearing Control ....... ${HAS_WAYLAND_PROTOCOL_TEARING_CONTROL_V1}")

add_protocol(${WAYLAND_PROTOCOLS_BASE}/stable/presentation-time/presentation-time.xml)
message(STATUS "Presentation Time ..... ${HAS_WAYLAND_PROTOCOL_PRESENTATION_TIME}")
add_protocol(${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-output/xdg-output-unstable-v1.xml)
message(STATUS "XDG Output Manager .... ${HAS_WAYLAND_PROTOCOL_XDG_OUTPUT_UNSTABLE_V1}")

add_protocol(${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml)
message(STATUS "XDG Decoration ........ ${HAS_WAYLAND_PROTOCOL_XDG_DECORATION_UNSTABLE_V1}")

#
# External
Expand Down Expand Up @@ -129,9 +132,9 @@ if (ENABLE_DRM_LEASE_CLIENT)
target_compile_definitions(wayland-gen PUBLIC ENABLE_DRM_LEASE_CLIENT)
endif ()

string(REPLACE ";" " " WAYLAND_PROTOCOLS "${LIST_WAYLAND_PROTOCOLS}")
message(STATUS "DEFINITIONS: ${WAYLAND_PROTOCOLS}")
target_compile_definitions(wayland-gen PUBLIC ${WAYLAND_PROTOCOLS})
string(REPLACE ";" " " WAYLAND_PROTOCOL_DEFINES "${LIST_WAYLAND_PROTOCOLS}" GLOBAL)
message(STATUS "DEFINITIONS: ${WAYLAND_PROTOCOL_DEFINES}")
target_compile_definitions(wayland-gen PUBLIC ${WAYLAND_PROTOCOL_DEFINES})

if (IPO_SUPPORT_RESULT)
set_property(TARGET wayland-gen PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
Expand Down
43 changes: 30 additions & 13 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ if (ENABLE_XDG_CLIENT)

add_sanitizers(simple-shm)

if (FALSE)
#
# presentation-shm
#
add_executable(presentation-shm presentation-shm.cc)
target_include_directories(presentation-shm PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)
if (FALSE)
#
# presentation-shm
#
add_executable(presentation-shm presentation-shm.cc)
target_include_directories(presentation-shm PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)

target_link_libraries(presentation-shm PRIVATE waypp wayland-gen cxxopts::cxxopts)
target_link_libraries(presentation-shm PRIVATE waypp wayland-gen cxxopts::cxxopts)

if (IPO_SUPPORT_RESULT)
set_property(TARGET presentation-shm PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()
if (IPO_SUPPORT_RESULT)
set_property(TARGET presentation-shm PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()

add_sanitizers(presentation-shm)
endif ()
add_sanitizers(presentation-shm)
endif ()

#
# simple-ext-protocol
Expand All @@ -80,4 +80,21 @@ endif ()

add_sanitizers(simple-ext-protocol)
endif ()
endif ()

endif ()

if (ENABLE_AGL_SHELL_CLIENT)
#
# agl-simple-shm
#
add_executable(agl-simple-shm agl-simple-shm.cc)
target_include_directories(agl-simple-shm PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)

target_link_libraries(agl-simple-shm PRIVATE waypp wayland-gen cxxopts::cxxopts)

if (IPO_SUPPORT_RESULT)
set_property(TARGET agl-simple-shm PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()

add_sanitizers(agl-simple-shm)
endif ()
Loading

0 comments on commit b816db5

Please sign in to comment.