Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/processing_glfw/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ workspace = true

[features]
wayland = ["glfw/wayland"]
x11 = []
x11 = ["dep:x11"]
static-link = ["glfw/static-link"]

[dependencies]
x11 = { version = "2", features = ["xlib"], optional = true }
bevy = { workspace = true }
glfw = "0.60.0"
processing_core = { workspace = true }
Expand Down
29 changes: 29 additions & 0 deletions crates/processing_glfw/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,35 @@ impl GlfwContext {
.unwrap();

window.set_all_polling(true);

// Set _NET_WM_WINDOW_TYPE_DIALOG so tiling WMs (i3, sway) float the window
#[cfg(all(target_os = "linux", feature = "x11"))]
unsafe {
use std::ffi::CString;
let display = window.glfw.get_x11_display() as *mut x11::xlib::Display;
let xwindow = window.get_x11_window() as x11::xlib::Window;
let net_wm_window_type = x11::xlib::XInternAtom(
display,
CString::new("_NET_WM_WINDOW_TYPE").unwrap().as_ptr(),
0,
);
let net_wm_window_type_dialog = x11::xlib::XInternAtom(
display,
CString::new("_NET_WM_WINDOW_TYPE_DIALOG").unwrap().as_ptr(),
0,
);
x11::xlib::XChangeProperty(
display,
xwindow,
net_wm_window_type,
x11::xlib::XA_ATOM,
32,
x11::xlib::PropModeReplace,
&net_wm_window_type_dialog as *const _ as *const u8,
1,
);
}

window.show();

Ok(Self {
Expand Down
2 changes: 1 addition & 1 deletion crates/processing_pyo3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ crate-type = ["cdylib"]
default = ["wayland", "static-link"]
wayland = ["processing/wayland", "processing_glfw/wayland"]
static-link = ["processing_glfw/static-link"]
x11 = ["processing/x11"]
x11 = ["processing/x11", "processing_glfw/x11"]
webcam = ["processing/webcam", "dep:processing_webcam"]
cuda = ["dep:processing_cuda", "processing_cuda/cuda", "processing/cuda"]

Expand Down