summaryrefslogtreecommitdiff
path: root/src/core/window.c
AgeCommit message (Collapse)AuthorFilesLines
2021-06-04window: Do not render shadows on left/right tiled windowsMartin Wimpress1-0/+12
This pull request prevents shadows being rendered for left and right side titled windows. This behaviour is consistent with maximised windows, which also do not render shadows. The rationale for this change is so that when two windows are titled along side each other, it prevents central shadows bleeding into the touching points of the windows. metacity-theme-x.xml has provision to style left/right titled windows. This patch makes it possible to to create window themes that present clean side-by-side tiled windows.
2021-06-04iconcache: Use GDesktopAppInfo to find correct application iconsVictor Kareh1-0/+1
Some files do not report their application icons correctly in the window properties. This patch allows the marco UI to search for the corresponding .desktop file and render the icon in the desktop info on both the alt-tab popup and the window mini-icon.
2021-05-28window: Track window rectangle before corner tilingVictor Kareh1-4/+16
When corner-tiling a maximized window, we should keep track of the saved rectangle so that tiling does not reset our window size. Otherwise, untiling the previously maximized window will end up with an unmaximized full-size window, rather than the original window size.
2021-05-26window: Track window rectangle before tilingVictor Kareh1-1/+5
When tiling a maximized window, we should keep track of the saved rectangle so that tiling does not reset our window size. Otherwise, untiling the previously maximized window will end up with an unmaximized full-size window, rather than the original window size.
2021-04-30window: Only unmaximize when the window is already maximized.Zhiyi Zhang1-60/+64
When handling a ClientMessage event that removes _NET_WM_STATE_MAXIMIZED_HORZ or _NET_WM_STATE_MAXIMIZED_VERT from _NET_WM_STATE, marco always restore the window rectangle to the saved rectangle. So if an application window is already unmaximized and the application sends such a ClientMessage event, marco will reset the window rectangle regardless. EWMH doesn't specify what must be done when handling such events. It seems best to avoid restoring window rectangles like other window managers in this case. Fix a related bug: https://bugs.winehq.org/show_bug.cgi?id=50381 This revert a change introduced by 6219f8e8bcaeefb9185a3c3f5f20de4e2fa8f18f. Signed-off-by: Zhiyi Zhang <[email protected]>
2021-03-06i18n: Use glib's gettext support macrosrbuj1-0/+2
2021-03-01window: turn into a GObjectrbuj1-23/+47
2020-09-27window: do not unfocus on new window.rcaridade1451-17/+1
Fix keyboard input on fullscreen VLC. Based on Metacity commit https://gitlab.gnome.org/GNOME/metacity/-/commit/bf17c79
2020-08-18window: expand tile size cycling supportraveit651-0/+3
2020-08-04Remove multiple empty linesrbuj1-14/+0
find . \( -name '*.h' -o -name '*.c' \) -exec sed -i 'N;/^\n$/D;P;D;' {} \;
2020-08-04Remove trailing spaces/tabsrbuj1-20/+20
find . \( -name '*.h' -o -name '*.c' \) -exec sed -i 's/[[:space:]]*$//' {} \; find . \( -name '*.h' -o -name '*.c' \) -exec sed -i 's/\t*$//' {} \;
2020-05-27workspace: Don't try to use per-workspace MRU lists as a hint for focusingrcaridade1451-2/+0
A prior commit switched from focusing the topmost window as the default window to focusing the MRU window. This was done in alignment with the introduction of per-workspace MRU lists to avoid problems where the window stack was inadvertently changed when focusing windows during window switches. Now that focusing windows don't have as big an impact on the stacking order, we can revert back to focusing the top window, which is less confusing to the user. For now, leave per-workspace MRU lists, as they're a pretty good approximation of a global MRU list, and it works well enough. https://bugzilla.gnome.org/show_bug.cgi?id=620744 Based on commit https://gitlab.gnome.org/GNOME/metacity/-/commit/f628d8f8901f46fa9e00707ae9d7ccfd1e85f427
2020-05-27compositor: fix possible crash closing/destroying window . Fixes to previous ↵rcaridade1451-0/+11
commit. Partially restore call to destroy_win in compositor when calling meta_window_free. This is needed to ensure that we never call meta_window_get_frame_bounds while windows is destroying. https://bugzilla.gnome.org/show_bug.cgi?id=751833 Based on commit https://gitlab.gnome.org/GNOME/metacity/-/commit/a9f28dbc26f5211ef08889109db3dc8c7ba76aca
2020-05-27window: fix crash if workspace is nullrcaridade1451-1/+2
Based on commit https://gitlab.gnome.org/GNOME/metacity/-/commit/24d35569bdb78d1da3b53ed1a6d81d365d60bed0
2020-02-21remove warning: 'GTimeVal' is deprecatedrbuj1-29/+16
2020-02-06window: handle legacy fullscreen requestsrcaridade1451-1/+30
https://gitlab.gnome.org/GNOME/metacity/commit/1fafd279006ece8cf664fd777143cdfafbefad6d window: handle legacy fullscreen requests Doing this on the actual resize requests makes more sense than handling it as a window-manager imposed constraints, so move the code accordingly. Adapted from mutter patch by Florian Müllner: https://git.gnome.org/browse/mutter/commit/?id=fba022cc06b8c7e80ef36f48d6577a251384cc4b https://bugzilla.gnome.org/show_bug.cgi?id=781946 Bug 781946 - Non-native decorated windows stuck maximised on secondary screen with Marco/Metacity
2019-10-31window: Add optional tile size cyclingVictor Kareh1-12/+41
Adding a new option to allow tile size cycling. When enabled, using the keyboard shortcut for tiling multiple times in a row cycles the window through different sizes (1/2 -> 1/3 -> 1/4 -> 3/4 -> 2/3 -> Untiled).
2019-10-27tabpopup: Draw transparent OSD-style popupsVictor Kareh1-1/+1
2019-09-04window.c: remove unused variablePavel Shlyak1-3/+0
2019-08-10window: add _GTK_THEME_VARIANT to initial window propertiesmonsta1-1/+2
2019-07-13window: Update allowed action hintsVictor Kareh1-7/+30
When changing window state, we want to change the allowed action hints so that other applications, mainly the taskbar, can disable menu entries that do not make much visual sense. For example, unmaximizing a minimized window: even though this operation is possible, it causes user confusion as there is no visibility until the user unminimizes it.
2019-06-05update window->has_resize_func at the right time when unfullscreeningVictor Kareh1-3/+5
Since the frame window size that meta_window_move_resize() uses depends on whether the window has horizontal/vertical resize functionality, we need to update this flag before we resize the window. https://bugzilla.gnome.org/show_bug.cgi?id=659854 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/c66d83a7
2019-06-05window: Correct coordinates for the configure eventVictor Kareh1-4/+8
We should still correct the coordinates for withdrawn windows. upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/9da3004e
2019-06-05window: Fix _NET_FRAME_EXTENTS to work properlyVictor Kareh1-4/+7
_NET_FRAME_EXTENTS should contain the difference between where a window asked to be placed, and where it is. Ideally, this should be the same as the visible extents. https://bugzilla.gnome.org/show_bug.cgi?id=659848 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/a3630d7c
2019-06-05window: Fix window placement to exclude invisible bordersVictor Kareh1-4/+4
A window can specify geometry that it is placed at. We need to exclude invisible borders when calculating where to place the window, otherwise the window will have a strange offset. https://bugzilla.gnome.org/show_bug.cgi?id=659848 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/95373187
2019-06-05MetaWindow: Repurpose get_outer_rect and add get_input_rectVictor Kareh1-10/+48
get_outer_rect now returns the visible region, and a new get_input_rect method returns the boundaries of the full frame, including the possible invisible regions. When undecorated, both do the samething. https://bugzilla.gnome.org/show_bug.cgi?id=644930 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/dfedc7df
2019-06-05MetaWindow: Compensate for invisible border changesVictor Kareh1-20/+20
https://bugzilla.gnome.org/show_bug.cgi?id=644930 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/85e15225
2019-06-05Only shadow ARGB windows with a frame outside the frameVictor Kareh1-6/+39
An ARGB window with a frame is likely something like a transparent terminal. It looks awful (and breaks transparency) to draw a big opaque black shadow under the window, so clip out the region under the terminal from the shadow we draw. Add meta_window_get_frame_bounds() to get a cairo region for the outer bounds of the frame of a window, and modify the frame handling code to notice changes to the frame shape and discard a cached region. meta_frames_apply_shapes() is refactored so we can extract meta_frames_get_frame_bounds() from it. https://bugzilla.gnome.org/show_bug.cgi?id=635268 NOTE: Applied only partially, compositor part is still missing... upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/0f2e32d1
2019-06-05window: initialize few variablesVictor Kareh1-0/+2
upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/5b880ff3
2019-06-05window: Parse _GTK_THEME_VARIANT propertyVictor Kareh1-0/+2
Since version 3.0, GTK+ has support for style variants. At the moment, themes may provide a dark variant, which can be requested by applications via GtkSettings. The requested variant is exported to X11 via the _GTK_THEME_VARIANT property - support this property, in order to pick up the correct style variant in the future. https://bugzilla.gnome.org/show_bug.cgi?id=645355 NOTE: Patch is adapted for marco. upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/341d0945
2019-06-05Replace public MetaFrameGeometry with MetaFrameBordersVictor Kareh1-35/+34
There were actually *two* MetaFrameGeometry structs: one in theme-private.h, one in frame.h. The latter public struct was populated by a mix of (void*) casting and int pointers, usually pulling directly from the data in the private struct. Remove the public struct, replace it with MetaFrameBorders and scrap all the pointer hacks to populate it, instead relying on both structs being used in common code. This commit should be relatively straightforward, and it should not do any tricky logic at all, just a sophisticated find and replace. https://bugzilla.gnome.org/show_bug.cgi?id=644930 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/72224a165 NOTE: Patch copied from metacity and adapted for marco.
2019-04-23window: set atom__NET_WM_STATE_FOCUSED for meta_window_appears_focusedraveit651-1/+1
2019-04-23window: make docks and spashscreens appear focusedraveit651-1/+9
Set the NET_WM_STATE_FOCUSED property on windows of type dock or spashscreen so that they don't get the state GTK_STATE_FLAG_BACKDROP set by default. Based on: https://gitlab.gnome.org/GNOME/metacity/commit/b3ef887 origin xfwm4 commit: https://git.xfce.org/xfce/xfwm4/commit/?id=0feb29e78bb3
2019-04-23make icon size configurableosch1-1/+4
2019-04-11Replace meta_free_gslist_and_elements with g_slist_free_fullrbuj1-2/+2
Use g_slist_free_full
2019-03-28Improve performance by removing unused assignmentsrbuj1-8/+1
2019-03-13window: avoid clang warning: garbage valuePablo Barciela1-9/+15
avoid Clang static analyzer warning: core/window.c:3580:34: warning: The right operand of '+' is a garbage value new_w = window->rect.width + fgeom.left_width + fgeom.right_width; ^ ~~~~~~~~~~~~~~~~
2019-01-31screen: Remove get_current_monitor in favor of get_current_xineramaVictor Kareh1-2/+2
Since xinerama already contains information on the monitor and its rectangle, there is no need to go through Gdk to get this information again.
2019-01-07'meta_error_trap_push' instead 'meta_error_trap_push_with_return'Pablo Barciela1-5/+5
both functions have the same code
2018-08-28theme: replace mutter/metacity with marcoVictor Kareh1-2/+2
2018-08-28Optionally attach modal dialogsMaxim Ermilov1-0/+71
Add a preference /apps/mutter/general/attach_modal_dialogs. When true, instead of having independent titlebars, modal dialogs appear attached to the titlebar of the parent window and are moved together with the parent window. https://bugzilla.gnome.org/show_bug.cgi?id=612726 NOTE: Patch copied from mutter and adapted for metacity.
2018-08-28Add meta_window_get_transient_for() methodDavyd Madeley1-0/+23
NOTE: Patch copied from mutter and adapted for metacity.
2018-04-29Correct resize popup position on HiDPI displaysVictor Kareh1-2/+5
2018-02-26window: add _NET_WM_STATE_FOCUSED hint to _NET_WM_STATEmonsta1-5/+18
ported from: https://github.com/GNOME/metacity/commit/4ccb99a50c54f345c4c7d9ac77f1ea76bc6c7c74
2018-01-15Bugfix for monitors of different sizesOmar Zeidan1-12/+20
2018-01-15Restructured monitor keybinds and adjust save_rectOmar Zeidan1-0/+58
2018-01-02Fix wrong result in meta_window_titlebar_is_onscreen() for windows without a ↵Björn Weber1-1/+1
frame
2018-01-02Add support for gtk3 _GTK_SHOW_WINDOW_MENU eventBjörn Weber1-0/+21
2018-01-02Implemented a setting to disable top tilingOmar Zeidan1-6/+7
2017-12-30Reset tile_resized to false when fullscreeningOmar Zeidan1-1/+6
After resizing a tiled window, tile_resized gets set to true. Since it never got set back to false when fullscreening, it lead to weird behavior when unfullscreening the window.