1
0
Fork 0
Commit graph

26 commits

Author SHA1 Message Date
Ivan Molodetskikh
bcf6ee5e55 Name unnamed sources
These names show up in GLib traces in sysprof, so let's make sure they
exist.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1928>
2022-03-04 10:10:05 +03:00
Jonas Ådahl
18d670e69f backends: Introduce MetaIdleManager
This object takes over the functionality of meta-idle-monitor-dbus.c,
meta-idle-monitor.c and meta-backend.c, all related to higher level
management of idle watches etc.

The idle D-Bus API is changed to be initialized by the backend instead
of MetaDisplay, as it's more of a backend functionality than what
MetaDisplay usually deals with.

It also takes over the work of implementing "core" idle monitors. The
singleton API is replaced with thin wrapper functions on the backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1859>
2021-05-18 13:19:36 +00:00
Robert Mader
6eeeffdc68 src: Stop using GSlice
It has been inofficially deprecated for years, is known to cause issues
with valgrind and potentially hides memory corruption.
Lets stop using it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1512>
2021-02-22 13:52:27 +01:00
Carlos Garnacho
1ecfdb1748 backends: Drop meta_idle_monitor_get_for_device()
As far as public API is concerned, there's only one idletime monitor
from now on.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1039
2020-02-12 22:07:55 +00:00
Carlos Garnacho
e9fbbd5853 backends: Do not use device IDs on idle monitors
Device IDs are somewhat x11 specific, seems better to avoid those
on public API. We can rely everywhere on ClutterInputDevice, so use
it instead.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
2020-01-30 18:11:23 +01:00
Robert Mader
8e172aeecb cleanup: Use g_clear_handle_id() for g_source_remove()
It makes sure we do not forget to zero the id and lets us avoid
zero checks before. We use it for all new code, lets clean up the
existing code base.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/947
2019-11-22 01:27:40 +01:00
Tim Klocke
81ee8886ce backends: Update inhibited state for the monitor and respect that state
The inhibited state of the monitor was after the initializiation never
updated. meta_idle_monitor_reset_idletime didn't respect the inhibited
state, so it set timeouts if it shouldn't have.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/573
2019-10-09 09:53:32 +00:00
Jonas Ådahl
0e69fe0781 idle-monitor: Reset timeout before firing watch
The watch might be removed during firing, meaning the source is
destroyed after returning. Avoid use-after-free by unsetting the timeout
before firing. Returning G_SOURCE_CONTINUE in that case is harmless, as
source is destroyed.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/796

https://gitlab.gnome.org/GNOME/mutter/merge_requests/799
2019-09-16 18:08:18 +00:00
Jonas Ådahl
26b08d87a8 idle-monitor: Remove redundant type cast
No need to type cast a `MetaIdleMonitorWatch *` to a
`MetaIdleMonitorWatch *`.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/799
2019-09-16 18:08:18 +00:00
Jonas Ådahl
321ab3b367 idle-monitor: Make helper function static
It wasn't used outside the file, so no reason to not have it static.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/799
2019-09-16 18:08:18 +00:00
Jonas Ådahl
1ca0fdc928 idle-monitor: Postpone dispatching of idle timeout if not ready
If we update the ready time while the source is already in the
to-dispatch list, changing the ready time doesn't have any effect, and
the source will still be dispatched. This could cause incorrect idle
watch firing causing the power management plugin in
gnome-settings-daemon to sometimes turn off monitors due to it believing
the user had been idle for some time, while in fact, they just logged
back in.

Fix this by not actually dispatching the idle timeout if the ready time
is in the future when actually dispatching.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/543
2019-05-02 23:46:43 +00:00
Jonas Ådahl
23a8ea2821 idle-monitor: Use G_SOURCE_CONTINUE instead of TRUE
Returning TRUE is confusing, as it doesn't carry any relevant meaning.
Use G_SOURCE_CONTINUE to make it clearer that the source is here to
stay.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/543
2019-05-02 23:46:43 +00:00
Jonas Ådahl
2f4a68c8c3 Clean up include macros mess
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.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
7c06e21e5a idle-monitor: Store either 1 or 0 in the inhibited gboolean
Wrap the flag checking in !!(..) to make sure we always either store
TRUE or FALSE in the gboolean.
2018-08-14 15:14:05 +00:00
Jonas Ådahl
a3269dde95 idle-monitor: NULL check cached InhibitedActions property variant
We might not have a cached "InhibitedActions" property available for us,
so do as elsewhere in this file and NULL check before processing it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/130
2018-06-14 17:52:11 +02:00
Florian Müllner
2319cd9c40 idle-monitor: Don't try to auto-start SessionManager
The interface is provided by gnome-session and not activatable.

https://gitlab.gnome.org/GNOME/mutter/issues/134
2018-04-30 13:55:41 +00:00
Bastien Nocera
4af00ae296 idle-monitor: Take idle inhibition into account
Take idle inhibitions into account for when to fire idle watches as
requested by OS components.

This should stop gnome-session and gnome-settings-daemon considering
the session idle when they have been inhibited for longer than their
timeout, for example to avoid the screensaver activating, or the
computer suspending after watching a film.

https://bugzilla.gnome.org/show_bug.cgi?id=705942
2018-04-16 13:28:03 +02:00
Bastien Nocera
7945ee5beb backends: Remove X11 idle-monitor backend
And use the old "native" backend for both X11 and Wayland. This will
allow us to share fixes between implementations without having to delve
into the XSync X11 extension code.

https://bugzilla.gnome.org/show_bug.cgi?id=705942
2018-04-16 13:28:03 +02:00
Rui Matos
7d54631ebf backends: Make MetaBackend available to introspection
This moves meta-backend.h under meta/ and, for now, just exposes to
introspection the methods that we actually need in gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=734301
2014-08-07 11:31:59 +02:00
Florian Müllner
d380d30ef4 Update (allow-none) annotations
The annotation has been deprecated in favor of (nullable) and/or
(optional).
2014-05-28 21:55:03 +02:00
Jasper St. Pierre
25a16c3379 Remove trailing whitespace 2014-05-02 09:34:48 -04:00
Jasper St. Pierre
00ea9bf14b backends: Start on an initial MetaBackend object
This isn't great so far -- all we did is put the idle monitors here
instead. We'll soon have separate backend subclasses for the two
backends.
2014-04-21 20:25:21 -04:00
Jasper St. Pierre
f3ee9be4cb idle-monitor: Use the XSync idle monitor under X11 nested 2014-04-21 20:25:20 -04:00
Jasper St. Pierre
c1e3a6b742 idle-monitor: Actually get the check for is_wayland_compositor correctly
If we're a Wayland compositor we shouldn't be taking this path, ever.
2014-04-01 16:05:53 -04:00
Jasper St. Pierre
bce1d5117b Start creating different subdirectories for each backend 2014-03-31 23:44:47 -04:00
Jasper St. Pierre
229360b248 Start molding out a new src/backends/ dir
Right now this just has all of the files in one directory. We'll
be introducing more structure to this in the future, and build
a proper backend system.
2014-03-31 22:11:00 -04:00
Renamed from src/core/meta-idle-monitor.c (Browse further)