summaryrefslogtreecommitdiff
path: root/src/core/stack.c
Commit message (Collapse)AuthorAgeFilesLines
* core: Move remaining default focus window handling to workspaceSebastian Wick2022-09-201-124/+1
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2489>
* window: Move some display level window processing to MetaDisplayJonas Ådahl2022-02-071-0/+2
| | | | | | | | | | | meta_window_(un)queue() was implemented with global arrays in window.c that managed MetaLater handle IDs and lists of window queues. In order to rely less on scattered static variables and making it clearer that we're dealing with per display window management and not something specific to a single window, move the window resize/calc-showing queue management to MetaDisplay. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2264>
* stack: Add prerequisites to some stack APICarlos Garnacho2021-12-011-0/+8
| | | | | | | | Passing a NULL workspace does not make sense, since it silently returns no windows. Mandate that a workspace is explicitly requested, and while at it check the other arguments as well. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2124>
* util: Remove push/pop no msg prefix loggingJonas Ådahl2021-11-211-3/+0
| | | | | | | | Used to log multiple line entries. Just make continue prefix things, no need to mess with maybe-prefixing; it'll just complicate using some less custom logging functionality. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2094>
* stack: Check workspace in get_default_focus_window()Alexander Mikhaylenko2021-08-121-4/+9
| | | | | | Check against the window argument, instead of active workspace. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/850>
* main: Move rect related macro to util-private.hJonas Ådahl2021-05-171-1/+0
| | | | | | | No reason that it should be in main-private.h, lets place it in util-private.h. This also mean we can remove main-private.h. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1833>
* stack: Add some trace instrumentationJonas Ådahl2020-12-011-0/+4
| | | | | | | | The stack and stack tracker tend to cause missed frames from time to time, especially when there are many open windows. Add some instrumentation to make it this easily verifiable when profiling. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1616>
* Remove misplaced line break in g_* logging functionsJonas Ådahl2020-10-081-1/+1
| | | | | | They resulted in empty lines in the log. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1466
* Make meta_* logging utilities not require line breakJonas Ådahl2020-10-081-20/+21
| | | | | | | | Unlike g_* logging utilities, the meta_* counterparts behave like odd printf() functions. Lets change that so they fit better into how logging is done everywhere else. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1466
* *: Fix spelling mistakes found by codespellBjörn Daase2020-08-291-1/+1
| | | | https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1410
* cogl: Install cogl-trace.h and include from cogl.hJonas Ådahl2020-03-261-1/+1
| | | | | | | | | | This is so that cogl-trace.h can start using things from cogl-macros.h, and so that it doesn't leak cogl-config.h into the world, while exposing it to e.g. gnome-shell so that it can make use of it as well. There is no practical reason why we shouldn't just include cogl-trace.h via cogl.h as we do with everything else. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1059
* stack: Delegate layer calculation to a window vfuncFlorian Müllner2019-11-291-127/+1
| | | | | | | | | | | | | While most of the code to compute a window's layer isn't explicitly windowing backend specific, it is in practice: On wayland there are no DESKTOP windows(*), docks(*) or groups. Reflect that by introducing a calculate_layer() vfunc that computes (and sets) a window's layer. (*) they shall burn in hell, amen! https://gitlab.gnome.org/GNOME/mutter/merge_requests/949
* window: Add get_default_layer() helperFlorian Müllner2019-11-291-6/+1
| | | | | | | | | Most of the layer computation that the stack does actually depends on the windowing backend, so we will move it to a vfunc. However before we do that, split out the bit that will be shared. https://gitlab.gnome.org/GNOME/mutter/merge_requests/949
* stack: Move HAS_TRANSIENT_TYPE macro to window-privateFlorian Müllner2019-11-291-12/+5
| | | | | | | We'll soon need it elsewhere, so move it to a shared location. While at it, convert it to a function. https://gitlab.gnome.org/GNOME/mutter/merge_requests/949
* stack: Allow promoting transient windows to their parent's layerFlorian Müllner2019-11-281-2/+5
| | | | | | | | | | | | | | When a window that should be stacked above another one is placed in a lower layer than the other window, we currently allow promoting it to the higher layer when it has a "transient type". We should do the same when the window is an actual transient of the other window. This is particularly relevant for wayland windows, where types play a much smaller role: Transient windows like non-modal dialogs (and since commit 666bef7a, popup windows as well) currently end up underneath their always-on-top parent. https://gitlab.gnome.org/GNOME/mutter/issues/587
* meta: Move private defines to a private headerCarlos Garnacho2019-10-151-0/+1
| | | | | | | These defines are unused outside of mutter, and actually not desirable to export. Move them to a private header. https://gitlab.gnome.org/GNOME/mutter/merge_requests/859
* meta: Add META namespace to macrosRobert Mader2019-10-141-1/+1
| | | | | | To silence warnings during GIR generation. https://gitlab.gnome.org/GNOME/mutter/merge_requests/822
* core: Trace various window management actionsJonas Ådahl2019-09-021-0/+7
| | | | https://gitlab.gnome.org/GNOME/mutter/merge_requests/765
* core: Move Stack to StackTracker synchronization back to stack.cCarlos Garnacho2019-08-261-0/+86
| | | | | | | | | | We indirectly were relying on the MetaX11Stack for this. We strictly need the _NET_CLIENT_LIST* property updates there, so move our own internal synchronization to common code. Fixes stacking changes of windows while there's no MetaX11Display. https://gitlab.gnome.org/GNOME/mutter/merge_requests/730
* stack: Style and introspection doc fixesMarco Trevisan (Treviño)2019-07-081-22/+21
| | | | https://gitlab.gnome.org/GNOME/mutter/merge_requests/669
* stack: Add a function to get a sorted list of focus candidatesMarco Trevisan (Treviño)2019-07-081-13/+42
| | | | | | | Use a static function if a window can be the default focus window, and use such function to return a filtered list of the stack. https://gitlab.gnome.org/GNOME/mutter/merge_requests/669
* x11: Add MetaX11Stack objectCarlos Garnacho2019-05-241-252/+5
| | | | | | | | | | | | This object takes care of the X11 representation of the window stack, namely the _NET_CLIENT_LIST and _NET_CLIENT_LIST_STACKING root window properties. This code has been lifted from src/core/stack.c into src/x11 as it's dependent on the X11 display availability. This also leaves MetaStack squeaky clean of x11 specifics. https://gitlab.gnome.org/GNOME/mutter/merge_requests/420
* core: Turn MetaStack into a GObjectCarlos Garnacho2019-05-241-20/+130
| | | | | | So we can have it emit signals and whatnot. Those are unused, yet. https://gitlab.gnome.org/GNOME/mutter/merge_requests/420
* window: Return focusable ability looking at properties onlyMarco Trevisan (Treviño)2019-02-141-0/+3
| | | | | | | | | | | As per commit 43633d6b, we mark an unmanaging window as not focusable, while this is true, it might cause not resetting the current focused window when unmanaging it causing a crash. Also this wouldn't allow to check if a window can be focused when unmanaging it, so let's revert the previous behavior. Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/462
* window: Add is_focusable class methodMarco Trevisan (Treviño)2019-02-131-4/+1
| | | | | | | Implement is_focusable for both x11 and wayland and just use this check so that we can abstract things more and be less dependent on window backend. https://gitlab.gnome.org/GNOME/mutter/merge_requests/421
* stack: Don't place Wayland popups in o-r layerJonas Ådahl2018-12-041-1/+11
| | | | | | | | | | Placing persistant Wayland popups (e.g. not menus etc) in the o-r layer breaks stacking order with other window trees (e.g. other client windows), as the menu would get stuck in the o-r layer, i.e. on top, even if the parent of the popup got lowered. Fix this by placing the popups in the normal layer, relying on transient-ness to keep stacking correct.
* Clean up include macros messJonas Ådahl2018-11-061-11/+12
| | | | | | The order and way include macros were structured was chaotic, with no real common thread between files. Try to tidy up the mess with some common scheme, to make things look less messy.
* Move workspace related code from MetaDisplay to MetaWorkspaceManagerArmin Krezović2018-07-061-7/+18
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=759538
* Rename errors.[ch] to meta-x11-errors.[ch]Armin Krezović2018-07-061-1/+1
| | | | | | | Also rename meta_error_trap_* to meta_x11_error_trap_* and move meta-x11-errors.c to src/x11 https://bugzilla.gnome.org/show_bug.cgi?id=759538
* Stop using MetaScreen where it is unnecessaryArmin Krezović2018-07-061-5/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=759538
* Move workspace handling to MetaDisplay and MetaX11DisplayArmin Krezović2018-07-061-7/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=759538
* Move rest of non-X11 specific objects from MetaScreenArmin Krezović2018-07-061-1/+1
| | | | | | | | | | This moves following objects from MetaScreen to MetaDisplay - workareas_later and in_fullscreen_later signals and functions - startup_sequences signals and functions - tile_preview functions https://bugzilla.gnome.org/show_bug.cgi?id=759538
* Move stack tracking and guard_window outside of MetaScreenArmin Krezović2018-07-061-20/+20
| | | | | | Move stack, stack_tracker to MetaDisplay guard_window to MetaX11Display https://bugzilla.gnome.org/show_bug.cgi?id=759538
* Start populating MetaX11DisplayArmin Krezović2018-07-061-6/+7
| | | | | | | | | | | - Moved xdisplay, name and various atoms from MetaDisplay - Moved xroot, screen_name, default_depth and default_xvisual from MetaScreen - Moved some X11 specific functions from screen.c and display.c to meta-x11-display.c https://bugzilla.gnome.org/show_bug.cgi?id=759538
* window: Defer stack placement without a bufferOlivier Fourdan2018-01-111-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | When closing a window and showing a new one, the new one may not be granted input focus until it gets a buffer on Wayland. If another window is chosen to receive focus and raised on top of stack, the newly mapped window is focused but placed underneath that other window. Meaning that for Wayland surfaces, we need to defer adding the window to the stack until we actually get to show it, once we have a buffer attached. Rather that checking the windowing backend prior to decide if a window is stackable or not, introduce a new vfunc is_stackable() which tells if a window should be added to the stack regardless of the underlying windowing system. Also add meta_window_is_in_stack() API rather than checking the stack position directly (replacing the define WINDOW_IN_STACK only available in stack.c) and remove a window from the stack only if it is present in the stack, so that the test in meta_stack_remote() becomes irrelevant. https://bugzilla.gnome.org/show_bug.cgi?id=780820
* monitor-manager: Move logical monitor into its own fileJonas Ådahl2017-01-251-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=777732
* stack: Stack docks below other windows on fullscreen monitorsRui Matos2016-11-021-2/+2
| | | | | | | | | | | | | | Commit fcc7501eb8dab5c1749e5421e31311fd14fd73f0 had the side-effect of stacking fullscreen windows below docks which went unnoticed since we don't use docks in GNOME anymore. Instead of re-introducing the fullscreen layer, which we don't need otherwise, we can fix this issue by ensuring we stack docks below all other windows when the monitor they're on is marked fullscreen. This has the added benefit that the visibility rule for 3rd party docks becomes the same as gnome-shell's chrome. https://bugzilla.gnome.org/show_bug.cgi?id=772937
* core: Remove META_LAYER_FULLSCREENRui Matos2016-07-061-41/+2
| | | | | | | | | | | | | This layer isn't really being used and in fact, it causes meta_stack_get_default_focus_window() to return a fullscreen window even if the naturally topmost window in the stack isn't a fullscreen one. Note that commit a3bf9b01aa7019798924b618160fcb184e096a3c changed how we choose the default focus window from the MRU to the topmost in the stack. https://bugzilla.gnome.org/show_bug.cgi?id=768221
* stack: Don't add wayland windows to _NET_CLIENT_LISTRui Matos2016-05-121-22/+18
| | | | | | | Window->xwindow is None (i.e. 0) for wayland windows and there's no point in adding them to these X specific properties. https://bugzilla.gnome.org/show_bug.cgi?id=764844
* stack: Stack both wayland and X hidden windows below the guard windowRui Matos2016-05-121-8/+7
| | | | | | | | | | | | | | | Stacking hidden X windows below the guard window is a necessity to ensure input events aren't delivered to them. Wayland windows don't need this because the decision to send them input events is done by us looking at the clutter scene graph. But, since we don't stack hidden wayland windows along with their X siblings we lose their relative stack positions while hidden. As there's no ill side effect to re-stacking hidden wayland windows below the X guard window we can fix this by just doing it regardless of window type. https://bugzilla.gnome.org/show_bug.cgi?id=764844
* stack: Fix 32-bit issuesJasper St. Pierre2016-04-081-2/+3
| | | | | | | | Since g_array_append_val isn't smart enough to do a proper upcast, we have to do it manually, lest we get junk. This fixes various RAISE_ABOVE: window not in stack: 0x8100c8003 warnings that appear on 32-bit systems.
* Revert "window: Remove old tiling code"Florian Müllner2016-01-101-0/+30
| | | | This reverts commit 8bded7d497f493cf7c3c5bb0ff5a353e34981215.
* window: Remove old tiling codeJasper St. Pierre2016-01-091-30/+0
| | | | | | We'll soon replace this with a better scheme https://bugzilla.gnome.org/show_bug.cgi?id=751857
* META_DEBUG_STACK: Fix message about the dumped window orderOwen W. Taylor2015-10-121-1/+1
| | | | | | A change in the code made the windows list bottom-to-top instead of top-to-bottom, but the message printed out still said "Top to bottom."
* Avoid shadowing existing variablesFlorian Müllner2015-09-241-5/+1
|
* Don't calculate the main window monitor every time it`s neededJonas Ådahl2015-07-161-2/+1
| | | | | | | | The main monitor of a window is maintained as 'window->monitor' and is updated when the window is resized or moved. Lets avoid calculating it every time it`s needed. https://bugzilla.gnome.org/show_bug.cgi?id=744934
* stack: Don't prefer windows in the same group as not_this_oneJasper St. Pierre2015-07-051-39/+4
| | | | | | | | The only time we ever execute this code is when we're minimizing or hiding a window, in which case we should respect stacking order. This fixes weird "bugs" where windows from the same app magically pop up over other windows.
* stack: Don't try to focus hidden windowsFlorian Müllner2015-06-301-4/+1
| | | | | | | | | A window may be hidden even if not minimized itself, for instance when an ancestor is minimized. As meta_window_focus() will refuse to actually focus the window in that case, don't pick it in the first place. https://bugzilla.gnome.org/show_bug.cgi?id=751715
* stack: Fix a leakFlorian Müllner2015-01-211-0/+1
|
* Fix stacking of the guard windowOwen W. Taylor2014-09-241-4/+4
| | | | | | | | | With the change to how hidden windows are stacked, the position of the guard window with respect to the hidden windows got flipped and the guard window was at the bottom of everything; fix it to be on top of the hidden windows. https://bugzilla.gnome.org/show_bug.cgi?id=737233