summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* placement: Ignore struts from windows on other monitorsOlivier Fourdan2021-02-284-69/+95
| | | | | | | | | | | | | | | | | | | | | The EWMH[1] “specification” defines truts are relative to the entire X11 screen, which include all monitors. Under some configuration, when montors are placed one on top of the other, that struts set on the monitor above would invalidate the entire lower monitor, preventing from placing windows on that monitors. To avoid that issue, xfwm4 was computing the actual struts area and would simply ignore any struts greater than a quarter of the screen. This is largely inefficient and only very partially solve the problem. Instead, simply apply struts for windows on that monitor and ignore those from the other monitors, so that a panel placed on the monitors above would simply be ignored on the monitor below. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/517
* focus: Check for user focus for when passing focusOlivier Fourdan2021-02-211-8/+1
| | | | | | | | Otherwise we may be focusing a window which is being unmapped and we end up with the no-focus window as fallback. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/514
* compositor: Disable GLX vblank with virglOlivier Fourdan2021-02-211-0/+1
| | | | | | | | For some reason enabling virtio gives a complete black image when xfwm4 uses GLX for vblank, add "virgl" for now to the list of renderers for which we want to avoid enabling GLX. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* startup-notification: Reduce timeout to 10 secondsOlivier Fourdan2021-02-211-1/+1
| | | | | | | | | | | If a client doesn't start within 10 seconds, no need to wait for it any longer. That avoids having the cursor waiting for 30 log seconds with apps which fail to implement startup notification. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/495
* compositor: Add support for adaptive vsync with GLXOlivier Fourdan2021-02-212-9/+20
| | | | | | | | | | Adaptive vsync, or its proprietary equivalent g-sync, works by using -1 as the swap interval. Add support for GLX_EXT_swap_control_tear to check whether this is safe to use, so that we can support adaptive vsync where available. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* compositor: Do not set deprecated compositor selectionOlivier Fourdan2021-02-061-3/+0
| | | | | | | | | | | | | | | | | Zaphod mode support was removed in GTK3 a while ago, support for multiple-screen in xfwm4 is only on a best effort basis. The deprecated compositor atom selection used to inform that a compositor is running opn a display is not mutli-screen (aka Zaphod) compatible. As a result, xfwm4 would falsely detect a compositor already running when dealing with multiple X11 screen wheres it was its own selection. To avoid the issue, avoid setting the deprecated atom selection and use only the newer one which is mutli-scren aware. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* compositor: Disable GLX on mutli-screen (Zaphod)Olivier Fourdan2021-02-061-1/+7
| | | | | | | | | | | | Zaphod mode support was removed in GTK3 a while ago, support for multiple-screen in xfwm4 is only on a best effort basis. GLX doesn't seem to work reliably when using multiple X11 screens (aka Zaphod) and produces a black image on all but one screen. Disable GLX on the additional X11 screens. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* Added radio buttons and checkboxes to window menuStephen Robinson2021-02-053-46/+65
| | | | | | | Radio buttons select window layer. Checkbox button for workspace pinning. Signed-off-by: Stephen Robinson <stephen@drsudo.net>
* cleanup: Don't use parenthesis when returning constantsOlivier Fourdan2021-02-029-20/+20
| | | | Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* netwm: Do not use _NET_WM_PING in multi-screenOlivier Fourdan2021-02-021-1/+9
| | | | | | | | | | | | | | GDK dropped support for multi-screen several years ago. Unfortunately, the code in GDK's _gdk_wm_protocols_filter() checks for the default root window when dealing with _NET_WM_PING messages, and that will cause an event loop when trying to use it on a multi-screen setup. Avoid the issue by not using _NET_WM_PING on multi-screen setups. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes:https://gitlab.xfce.org/xfce/xfwm4/-/issues/506
* settings: Enable either windows wrap or tilingOlivier Fourdan2021-01-231-1/+2
| | | | | | | | Both options are incompatible, make sure to allow either one or the other, but not both. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/504
* compositor: Add throttled repaintOlivier Fourdan2021-01-231-4/+29
| | | | | | | | | | | | | | When using vblank while the screen is turned off, only 1 notification per second is triggered. In such a case, there is no need for the compositor to retry repainting the screen at such a high pace as when when the screen is on. To avoid wasting power resources, simply throttle repaints after 100 unsuccessful retries. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes:https://gitlab.xfce.org/xfce/xfwm4/-/issues/502
* compositor: Do not clear timeout on retryOlivier Fourdan2021-01-231-2/+9
| | | | | | | | | | | | | | | | | | | | | | When using vblank (either GLX or Xpresent), a previous paint request may still be pending while new damage notifications are triggered by clients updates. If that occurs, xfwm4 does not cancel the existing timeout previously created timeout (so it will retry automatically) but clears the timeout id. As a result, if new damage occurs, a new timeout would be created while an existing one is still running. When using Xpresent while the screen is turned off, no Xpresent event notification occur, which increases the risk of the above occuring. Clear the timeout id only when the repaint succeeded, so we don't pile up multiple retries. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> See-also: https://gitlab.xfce.org/xfce/xfwm4/-/issues/502
* compositor: Fix repaint timeoutOlivier Fourdan2021-01-231-2/+2
| | | | | | | | | | | | | | | | Commit 2fa246ca ("Add define for compositor_timeout_cb interval") replaced g_timeout_add() with g_timeout_add_full() to separate the timeout and priority. Unfortunately, in doing so, it confused the timeout and priority and decreased the priority slightly, causing the repaint timeout to occur less often, causing delays in repaint. Fix the priority and timeout as intended. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Fixes: 2fa246ca - Add define for compositor_timeout_cb interval Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/503
* log: Prefer stdoutOlivier Fourdan2021-01-092-3/+3
| | | | | | | | | g_message() logs to stderr, while with debug enabled, stderr is redirected to a file (or even /dev/null). Use either g_info() or g_print() instead. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* compositor: Do not prefer Xpresent for AMD/RadeonOlivier Fourdan2021-01-091-1/+6
| | | | | | | | | | | | There is a bug in the amdgpu DDX which causes an image corruption when Xpresent is used. We should not prefer Xpresent for those, as people upgrading from 4.14 would possibly see this as a regression. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/490 See-also: https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/-/issues/10
* events: Allow resizing regardless of modifiersOlivier Fourdan2021-01-051-16/+8
| | | | | | | | | | | | | | xfwm4 expects no keyboard modifiers (other than the usual locks) in button events to allow interactive resizing. There is no reason to be so picky, especially considering there is no such check when moving windows. Relax the requirements for resizing and allow interactive resize with the mouse regardless of the modifiers being pressed. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/487
* netwm: Un-tile before fullscreenOlivier Fourdan2021-01-051-0/+1
| | | | | | | | | | | | If a client switches to fullscreen, tiling would prevent the window from being resized correctly, and the client window remains tiled even when fullscreen. Make sure to first un-tile the client window when transitioning to fullscreen. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/478
* hints: Guard against XErrors with systrayOlivier Fourdan2021-01-051-0/+3
| | | | | | | The systray window is an external window, any X request has the potential for failure. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* compositor: Guard against more XErrorsOlivier Fourdan2021-01-051-3/+9
| | | | | | | | Protect against possible XErrors which could occur while adding a new window to the compositor. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/486
* events: Protect against error from XGetWMHints()sfan52020-12-261-0/+3
|
* compositor: Ignore XError when changing background pictureOlivier Fourdan2020-12-251-0/+3
| | | | | | | | | | | If xfwm4 is compiled with support for the root pixmap in the compositor, changing the background image may cause an XError if the external pixmap is already freed. Guard against such XError. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/476
* hints: Protect against XError from XGetTransientFor()Olivier Fourdan2020-12-181-1/+7
| | | | | Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/472
* netwm: Allow above/below only for regular windowsOlivier Fourdan2020-12-171-2/+5
| | | | | | That makes it consistent with what xfwm4 allows from its own UI. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* netwm: Mark splashscreen as transient for groupsOlivier Fourdan2020-12-171-0/+8
| | | | | | | | | | | | | | KDE applications such as Krita place their splashscreen window above other windows, but may display a dialog at startup, and that dialog would end up underneath the splashscreen. Make the splashscreen windows transient for groups, so that if another window from the same applications is eventually mapped, the splashscreen will be sent back automatically at the same layer as the application and will not hide it. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Fixes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/470
* client: Complete client state even on different workspacesOlivier Fourdan2020-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | When a client is restored from session management and ends up on another, non visible workspace, xfwm4 would simply not show it. But that's not sufficient, when the client is eventually shown on workspace switch, the client window would end up in a weird state, marked as "IsViewable" and showing reparented in "xwininfo -tree", yet xprop would still return the properties from the WM parent window which has no property set. Many X11 mechanisms, including drag and drop, rely on X11 properties and those would simply fail when that happens. Make sure to complete the client frame even for windows placed on a separate workspace, the clientShow() will eventually take care of not making those visible, but the client window will be in a correct state. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/469
* build: Increase GTK+ requirement to 3.22Dridi Boukelmoune2020-12-163-89/+0
| | | | | | | | | Since 4.14 this is the minimum version for all of Xfce, which allows to remove a bunch of dead code. Refs !3 Signed-off-by: Dridi Boukelmoune <dridi@fedoraproject.org>
* Add `cycle_minimized` optionx4e2020-12-153-1/+9
| | | | | | | | | | | | | This option allows minimized windows to be cycled in their MRU (Most Recently Used) order along side non minimized windows. With this option disabled the old behaviour will continue, where minimized windows are always at the end of the MRU cycle order. This option is disabled by default. The code in this commit was provided by @evandrocoan . Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/438
* compositor: Release overlay window lastOlivier Fourdan2020-12-141-11/+11
| | | | | | | | The root picture applies to the output window, which in turn is the overlay window (when supported), therefore the overlay window should be released last to avoid XErrors when disabling the compositor. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* compositor: Free GLX data when really using GLXOlivier Fourdan2020-12-141-1/+1
| | | | Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* compositor: Remove useless trace messageOlivier Fourdan2020-12-141-4/+0
| | | | Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* compositor: Release current GLX context on teardownOlivier Fourdan2020-12-141-0/+2
| | | | | | Prior to freeing the GLX context, make sure it's released. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* display: Remove custom XError handlerOlivier Fourdan2020-12-121-16/+0
| | | | | | | | | GDK already implements its own XError handler mechanisnm, using a custom one is not only useless, but discouraged as well. Remove our own custom XError handler. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* compositor: Check for XError when adding windowsOlivier Fourdan2020-12-121-1/+6
| | | | | | | | | | When adding windows, the compositor needs to get various attributes, and that can fail if the client window is already gone. Check and protect against any XError when adding windows to the compositor as well. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* compositor: Trap XErrors when disabling compositorOlivier Fourdan2020-12-121-0/+10
| | | | Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* main: Enable compositor by defaultOlivier Fourdan2020-12-121-1/+1
| | | | | | | Previous commit inadvertently disabled the compositor by default, restore expected behavior. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* compositor: Remove automatic redirect supportOlivier Fourdan2020-12-123-118/+17
| | | | | | | Automatic redirection is of little use for xfwm4, remove support for it and save a significant amount of code and complexity. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* main: Add short command line optionsOlivier Fourdan2020-12-121-3/+3
| | | | Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* main: Add debug command line optionOlivier Fourdan2020-12-121-13/+29
| | | | | | | | | | | | When building from git, debug mode is now automatically enabled, meaning that xfwm4 will log debug messages to a file which can quickly grow fast. To avoid filling innocent users' home directories with debug messages from xfwm4, add a "--debug" command line option to enable logging to a file. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* pixmap: Use a safer strncpy()Olivier Fourdan2020-12-121-2/+12
| | | | | | | | | | strncpy() may not copy the trailing NULL terminator and newer gcc warns about it. Add a safer strncpy() implementation which makes sure to always put a NULL terminator and mute gcc warning. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* Revert "compositor: Do not damage on opaque region update"Olivier Fourdan2020-12-081-5/+25
| | | | | | | | | | | | Thunderbird is acting really weird with its opaque region, it sometimes set a (wrong) opaque region for a very short time during resize and immediately remove it, but that can prevent non-opaque regions such as drop shadows with client side decorations from being damaged correctly. While this is clearly a client bug, it shows that damaging the difference on opaque region update can be useful. This reverts commit 1e80481ac8da9cdeddc204c2c8e9c2f5841564ef.
* compositor: Check if compositor is enabledOlivier Fourdan2020-12-071-22/+49
| | | | | | | Add more check for the compositor being enabled, to avoid running into potential XErrors. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* compositor: Avoid XError when disabling compositorOlivier Fourdan2020-12-051-1/+2
| | | | | | | | When disabling the compositor, X11 events may still be queued and trigger and XError after the compositor output is disabled. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> https://gitlab.xfce.org/xfce/xfwm4/-/issues/462
* compositor: Warn for missing epoxy GL functionOlivier Fourdan2020-12-052-12/+24
| | | | | | | Older epoxy versions may miss some GL functions, warn at build time if that occurs. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* netwm: Do not raise window if activate is set to noneOlivier Fourdan2020-12-051-1/+3
| | | | | | | | | If activate action is set to "none" and focus stealing prevention is enabled, set the demand attention flag rather that raising the window, so it doesn't come into the way of the user. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/441
* Remove GSourceFunc castsOlaf Hering2020-12-014-9/+9
| | | | | | | The function prototypes are already a GSourceFunc, no need to cast the pointer. Remove a gpointer casts. Signed-off-by: Olaf Hering <olaf@aepfle.de>
* compositor: Fix build with older epoxy versionsOlivier Fourdan2020-11-291-1/+12
| | | | | | | | | Older epoxy versions may not provide all GL functions, causing the build to fail. Make sure to check for function availability. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
* settings: Add 'Always on top' to the double click actionPeter de Ridder2020-11-293-0/+8
| | | | | | | Note: This cannot work with CSD (client-side decoration), as double- click is handled by the client and not by the window manager with CSD. Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/1
* compositor: Handle XFixes XErrorOlivier Fourdan2020-11-281-4/+5
| | | | | | | | | | XFixesSetPictureClipRegion() with the region from the client window can cause a RenderBadPicture error. Make sure to include it within the XError trap. Signed-off-by: Olivier Fourdan <fourdan@xfce.org> https://gitlab.xfce.org/xfce/xfwm4/-/issues/460
* compositor: Add support for GL_ARB_syncOlivier Fourdan2020-11-282-0/+39
| | | | | | | | | | | | | | | | | | | When using GLX, xfwm4 relies on glXSwapBuffers() for vblank. Normally, glXSwapBuffers() is non blocking, unless the previous call is still pending. That means that if xfwm4 queues glXSwapBuffers() faster than the refresh rate, the following calls will be blocking, stalling the window manager completely, which is bad for obvious reasons. To avoid queuing a new glXSwapBuffers() before the previous one is complete, use a GL sync mechanism. Typically, we insert a GL Sync object just after the glXSwapBuffers() command, and check if the GL Sync is triggered before redrawing again, just like we do with Xpresent. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>