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

Basic support for web wallpapers (#153) #196

Merged
merged 20 commits into from
May 5, 2024
Merged

Conversation

Pasalc
Copy link
Contributor

@Pasalc Pasalc commented Jan 6, 2024

Fix for issue #153.

Short description

Added support for simple web wallpapers(like 3026516467 consisting of single html file) . If wallpaper have dependencies(like 3108493067), then program prints to user that dependencies are not supported and closes.

@Pasalc Pasalc changed the title Basic support for web wallpapers (Issue #153) Basic support for web wallpapers (#153) Jan 6, 2024
endif()
endif()
include(DownloadCEF)
DownloadCEF("${CEF_PLATFORM}" "${CEF_VERSION}" "${CMAKE_SOURCE_DIR}/third_party/cef")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Download CEF to third_party/cef directory

@@ -41,9 +100,19 @@ include_directories(
${FREEIMAGE_INCLUDE_DIR}
${PULSEAUDIO_INCLUDE_DIR}
src
${CEF_INCLUDE_PATH}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not needed, because of 403 line

@@ -324,7 +397,16 @@ add_executable(
${WAYLAND_SOURCES}
)

target_link_libraries(linux-wallpaperengine
COPY_FILES(linux-wallpaperengine "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${TARGET_OUTPUT_DIRECTORY}")
COPY_FILES(linux-wallpaperengine "${CEF_RESOURCE_FILES}" "${CEF_RESOURCE_DIR}" "${TARGET_OUTPUT_DIRECTORY}")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy files needed for CEF

if(!g_CEFused){
sLog.debug("No web wallpapers, shutting down CEF");
CefShutdown();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If wallpaper is not web, than close CEF

if (property != nullptr)
project->insertProperty (property);
std::string dependency = jsonFindDefault<std::string> (content, "dependency", "No dependency");
if(dependency=="No dependency"){
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If wallpaper have no dependencies, proceed normally

@@ -0,0 +1,387 @@
# Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CopyPasted this file

)
list(APPEND CEF_CXX_COMPILER_FLAGS
# -fno-exceptions # Disable exceptions
# -fno-rtti # Disable real-time type information
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't compile with this flag

libEGL.so
libGLESv2.so
libvk_swiftshader.so
# libvulkan.so.1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want this file

appPointer = nullptr;
if(g_CEFused){
sLog.debug("Shutting down CEF");
CefShutdown();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shutdown CEF if we had web wallpaper


sLog.exception ("Unsupported wallpaper type");
else if (wallpaper->is <Core::CWeb> ())
return new WallpaperEngine::Render::CWeb (wallpaper->as <Core::CWeb> (), context, audioContext, scalingMode);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Web is now supported

@Almamu
Copy link
Owner

Almamu commented May 5, 2024

PR looks good and the backgrounds I tested seemed to work fine as long as no dependencies were required. Lacks support for multiple screens but I think this is something I can add on my own or can be done in a different PR. I'm merging it! Thanks for your contribution and sorry for the delay

@Almamu Almamu merged commit ca3c737 into Almamu:main May 5, 2024
4 checks passed
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.

2 participants