Created
May 15, 2021 12:45
-
-
Save NikitaKarnauhov/3e8d19db835d14e21520ebcc18c28ab3 to your computer and use it in GitHub Desktop.
Patch to make muffin ignore offscreen windows when unredirecting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ur muffin-4.8.1-orig/src/compositor/compositor.c muffin-4.8.1/src/compositor/compositor.c | |
--- muffin-4.8.1-orig/src/compositor/compositor.c 2021-01-14 16:47:56.000000000 +0700 | |
+++ muffin-4.8.1/src/compositor/compositor.c 2021-05-15 18:29:05.519684385 +0700 | |
@@ -1265,15 +1265,24 @@ | |
GList *l; | |
MetaCompositor *compositor = data; | |
GSList *screens = compositor->display->screens; | |
- MetaWindowActor *top_window; | |
+ MetaWindowActor *top_window = NULL; | |
MetaWindowActor *expected_unredirected_window = NULL; | |
if (compositor->windows == NULL) | |
return TRUE; | |
- top_window = g_list_last (compositor->windows)->data; | |
+ for (l = g_list_last (compositor->windows); l; l = l->prev) | |
+ { | |
+ MetaRectangle *rect = &meta_window_actor_get_meta_window (l->data)->rect; | |
+ if (rect->x + rect->width > 0 && rect->y + rect->height > 0) | |
+ { | |
+ top_window = l->data; | |
+ break; | |
+ } | |
+ } | |
- if (meta_window_actor_should_unredirect (top_window) && | |
+ if (top_window != NULL && | |
+ meta_window_actor_should_unredirect (top_window) && | |
compositor->disable_unredirect_count == 0) | |
expected_unredirected_window = top_window; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment