Mutter - on window maximize & undecorate, fires 'window-added' signal?



Hi all,

I'm trying to track down a bug that occurs only when my extension is
enabled with another one.
I don't expect that anyone will be able to spot the bug (haven't
provided enought details), but I just want to see if some of its
symptoms can be explained.

My main question is, why could a 'window-added' signal be fired (from
a workspace) when a window gets maximized and undecorated? Or what can
cause an existing window to be re-added to a workspace?

I can make this happen in GNOME 3.2 which is Mutter 3.2.2; can't test
in 3.4 til later.

My extension:
- listens to 'window-added' event
- listens to 'maximize' event --> undecorates the window that gets maximized

Other extension:
- has buttons to maximize, minimize etc a window.

What happens:
* I use the buttons on the other extension to maximize a window
(metaWindow.maximize(Meta.MaximizeFlags.HORIZONTAL |
Meta.MaximizeFlags.VERTICAL)).
* The window maximizes and my extension catches
global.window_manager's 'maximize' signal
* My extension undecorates the window via an external `xprop` call
* ???? something happens
* My extension then catches a 'window-added' signal from the workspace
with the undecorated window.

Now usually maximizing & undecorating doesn't fire a 'window-added'
signal, and I need to know why it is firing one in this case. Does
this smell like anything to you?

I can *only* reproduce this behaviour when I maximize using the
buttons on this other extension (if I use the system 'maximize' button
or drag the window so it snap-maximizes, I don't get the
'window-added' signal, even if the other extension is enabled).

I would suspect the other extension, but it does not listen to
'maximize' (it does listen to 'window-added', upon which it listens to
that window's 'notify::appears-focused', 'notify::title',
'notify::urgent', 'notify::demands attention', only to do some
.add_style_pseudo_class). Also, all it uses to maximize is
`this.metaWindow.maximize([horizontal | vertical flags])`, and given
that the window *does* maximize I'm guessing it's the right window.

So, what could it be? What can cause an existing window to be
re-added? Is there something to do with the order of events (which is:
window maximizes; maximize signal caught; window undecorates;
window-added signal caught)? Does the window need to be focused before
maximizing (tried that)? Add a magical Mainloop.idle_add to give
something the chance to process something?

I'm clutching at straws here.

cheers!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]