-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Moving window to another display does not work as expected #1
Comments
Hi Lewin,
The case of abnormal behaviour, if no windows are open on one monitor, I currently can't reproduce myself with sway on my local system. Can you perhaps describe your monitor setup and the order of actions to reproduce more in-detail? |
Thanks for your response, sorry for missing context and bad explanation. So first of all, the versions: Okay, so in general, enkei does its job, meaning the background is displayed correct on both monitors. It is also not possible to move the enkei window anywhere. In Sway, it is possible to move an open window (e.g. a terminal) by pressing the Modifier key (e.g the meta key) and holding down the left mouse button, dragging it where you want it to be placed (indicated by a blue transparent while dragging). With this method, Mod+LeftMous, it is also possible to move an open window to another monitor by drag. Example: Additional scenario: Hope that this explanation is a bit clearer than the small first one? :) |
The clarification helped a lot, I can reproduce this issue now :D
output->surface = wl_compositor_create_surface(output->state->compositor);
assert(output->surface);
// Empty input region
struct wl_region *input_region =
wl_compositor_create_region(output->state->compositor);
assert(input_region);
wl_surface_set_input_region(output->surface, input_region);
wl_region_destroy(input_region);
output->layer_surface = zwlr_layer_shell_v1_get_layer_surface(
output->state->layer_shell, output->surface, output->wl_output,
ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND, "wallpaper");
assert(output->layer_surface);
zwlr_layer_surface_v1_set_size(output->layer_surface, 0, 0);
zwlr_layer_surface_v1_set_anchor(output->layer_surface,
ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT |
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT);
zwlr_layer_surface_v1_set_exclusive_zone(output->layer_surface, -1);
zwlr_layer_surface_v1_add_listener(output->layer_surface,
&layer_surface_listener, output);
wl_surface_commit(output->surface);
}
let window = gtk::Window::new(gtk::WindowType::Toplevel);
app.add_window(&window);
gls::init_for_window(&window);
// Push other windows out of the way
gls::set_exclusive_zone(&window, -1);
// Anchors are if the window is pinned to each edge of the output
gls::set_margin(&window, gls::Edge::Left, 0);
gls::set_margin(&window, gls::Edge::Right, 0);
gls::set_margin(&window, gls::Edge::Top, 0);
gls::set_margin(&window, gls::Edge::Bottom, 0);
gls::set_layer(&window, gls::Layer::Background);
gls::set_monitor(&window, monitor);
// Set up a widget
window.add(img);
window.show_all(); It could be in the way that I experimented with btw: Thanks for raising this issue, I simply never used this feature so I weren't aware of this^^ |
Hey, so I got around to have a deeper look into this problem. I just experimented with wayland-client and created a small mockup example and this confirms the suspicion of the empty input region, as this works as expected. Though this makes it hard to deal with this in Though this; and other annoyances with If you or anyone reading have a suggestion on how to properly handle this issue with Another point to start: https://gitlab.gnome.org/GNOME/gtk/-/blob/master/gdk/wayland/gdksurface-wayland.c |
Hey @emirror-de, so back to this issue. I just released a new version I'll close this issue for now, but if you find any other troubles you're very welcome to open a new issue :) |
Awesome, works perfectly fine! Thanks for this great update! |
Hi there,
thanks for this great project. I ran into a problem, wondering if there is an easy fix for it:
Trying to move a window from one monitor to another in a multi monitor setup does not work. However, when there are windows opened on both monitors, it works.
I am using sway as the compositor.
Best regards,
Lewin
The text was updated successfully, but these errors were encountered: