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

feat: add transparency to framebuffer on linux #2172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/mvViewport_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ mvShowViewport(mvViewport& viewport, bool minimized, bool maximized)
glfwSetErrorCallback(glfw_error_callback);
glfwInit();

// specifies whether the window framebuffer will be transparent
// if enabled and supported by the system, the window framebuffer
// alpha channel will be used to combine the framebuffer with
// the background (this does not affect window decorations).
glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);

if (!viewport.resizable)
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
if (viewport.alwaysOnTop)
Expand Down Expand Up @@ -221,13 +227,13 @@ mvShowViewport(mvViewport& viewport, bool minimized, bool maximized)

// Setup Platform/Renderer bindings
ImGui_ImplGlfw_InitForOpenGL(viewportData->handle, true);


// Setup callbacks
glfwSetWindowSizeCallback(viewportData->handle, window_size_callback);
glfwSetWindowCloseCallback(viewportData->handle, window_close_callback);
}

void
mvMaximizeViewport(mvViewport& viewport)
{
Expand Down