mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-12 23:51:28 -04:00
fix: foreign toplevel mon change
This commit is contained in:
parent
b263cd2b75
commit
daff80fe73
3 changed files with 58 additions and 25 deletions
|
|
@ -6,7 +6,7 @@ void handle_foreign_activate_request(struct wl_listener *listener, void *data) {
|
|||
Client *c = wl_container_of(listener, c, foreign_activate_request);
|
||||
uint32_t target;
|
||||
|
||||
if (c->swallowing)
|
||||
if (c->swallowing || !c->mon)
|
||||
return;
|
||||
|
||||
if (c->isminimized) {
|
||||
|
|
@ -28,7 +28,7 @@ void handle_foreign_maximize_request(struct wl_listener *listener, void *data) {
|
|||
Client *c = wl_container_of(listener, c, foreign_maximize_request);
|
||||
struct wlr_foreign_toplevel_handle_v1_maximized_event *event = data;
|
||||
|
||||
if (c->swallowing)
|
||||
if (c->swallowing || !c->mon)
|
||||
return;
|
||||
|
||||
if (c->ismaximizescreen && !event->maximized) {
|
||||
|
|
@ -46,7 +46,7 @@ void handle_foreign_minimize_request(struct wl_listener *listener, void *data) {
|
|||
Client *c = wl_container_of(listener, c, foreign_minimize_request);
|
||||
struct wlr_foreign_toplevel_handle_v1_minimized_event *event = data;
|
||||
|
||||
if (c->swallowing)
|
||||
if (c->swallowing || !c->mon)
|
||||
return;
|
||||
|
||||
if (!c->isminimized && event->minimized) {
|
||||
|
|
@ -71,7 +71,7 @@ void handle_foreign_fullscreen_request(struct wl_listener *listener,
|
|||
Client *c = wl_container_of(listener, c, foreign_fullscreen_request);
|
||||
struct wlr_foreign_toplevel_handle_v1_fullscreen_event *event = data;
|
||||
|
||||
if (c->swallowing)
|
||||
if (c->swallowing || !c->mon)
|
||||
return;
|
||||
|
||||
if (c->isfullscreen && !event->fullscreen) {
|
||||
|
|
@ -98,10 +98,6 @@ void handle_foreign_destroy(struct wl_listener *listener, void *data) {
|
|||
wl_list_remove(&c->foreign_fullscreen_request.link);
|
||||
wl_list_remove(&c->foreign_close_request.link);
|
||||
wl_list_remove(&c->foreign_destroy.link);
|
||||
}
|
||||
|
||||
void remove_foreign_topleve(Client *c) {
|
||||
wlr_foreign_toplevel_handle_v1_destroy(c->foreign_toplevel);
|
||||
c->foreign_toplevel = NULL;
|
||||
}
|
||||
|
||||
|
|
@ -144,7 +140,23 @@ void add_foreign_toplevel(Client *c) {
|
|||
}
|
||||
}
|
||||
|
||||
void reset_foreign_tolevel(Client *c) {
|
||||
remove_foreign_topleve(c);
|
||||
add_foreign_toplevel(c);
|
||||
void reset_foreign_tolevel(Client *c, Monitor *oldmon, Monitor *newmon) {
|
||||
if (!c)
|
||||
return;
|
||||
|
||||
if (!c->foreign_toplevel) {
|
||||
add_foreign_toplevel(c);
|
||||
return;
|
||||
}
|
||||
|
||||
if (oldmon == newmon)
|
||||
return;
|
||||
|
||||
if (oldmon)
|
||||
wlr_foreign_toplevel_handle_v1_output_leave(c->foreign_toplevel,
|
||||
oldmon->wlr_output);
|
||||
|
||||
if (newmon)
|
||||
wlr_foreign_toplevel_handle_v1_output_enter(c->foreign_toplevel,
|
||||
newmon->wlr_output);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue