Commit Graph

275 Commits

Author SHA1 Message Date
Florian Müllner
523ba5a719 shell: Remove shell_global_structured_log()
It is now unused.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/579
2019-06-15 15:26:17 +02:00
Olivier Fourdan
443c8347ea locatePointer: Add implementation in gnome-shell
The "locate pointer" functionality was implemented in gnome settings
daemon using X11 protocols and would fail when run under Wayland.

With Wayland, there is no global coordinate space exposed to the clients
so this functionality cannot be implemented as a separate program.

Instead, add the "locate pointer" functionality in gnome-shell so that
it works in both X11 and Wayland.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/981
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/413
https://gitlab.gnome.org/GNOME/mutter/merge_requests/453
https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/merge_requests/19
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/merge_requests/86
2019-06-05 08:15:10 +00:00
Cosimo Cecchi
12bace2721 shell-global: don't warn when unsetting non-existent state
If the state we're trying to delete does not exist, do not log an
error.
Prevents this journal warning at startup:

gnome-shell[1082]: Could not delete runtime/persistent state file: Error removing file /run/user/1000/gnome-shell/runtime-state-LE.:0/screenShield.locked: No such file or directory

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/555
2019-05-27 08:36:17 -07:00
Carlos Garnacho
dd5d7d3b70 shell: Only initialize global->xdisplay on X11 compositors
This is just used to set up things that are relevant to X11 compositors
(XDND, XFixes input region). We can live with it unset on the wayland
compositor cases.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/378
2019-05-24 12:24:06 +02:00
Carlos Garnacho
771b1a0788 shell: Do not set XFixes input region on wayland compositors
This is just needed on the X11 compositor, wayland compositors are known
for handling their own input.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/378
2019-05-24 12:24:06 +02:00
Carlos Garnacho
1ebbd7c768 st: Reimplement StClipboard on top of MetaSelection
And stop using X11/gdk for this.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/331
2019-05-02 15:58:51 +00:00
Carlos Garnacho
b597d5faf0 shell-global: Use MetaLaunchContext instead of GdkLaunchContext
Is functionally the same, without requiring the MetaX11Display.
2019-01-30 13:11:29 +01:00
Carlos Garnacho
86a00b6872 shell-global: Make saving of persistent state asynchronous
This is an expensive operation that is best avoided in the main loop. Given
the call doesn't care much about returning error or status, it can just
be made async within.

Every operation on a given file will be destructive wrt previous
operations on the same file, so we just cancel any pending operation on
it before batching the current one.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/815
2019-01-28 14:56:08 +00:00
Carlos Garnacho
2a1f915f9d global: Drop API to play sounds
All callers have been updated to use MetaSoundPlayer. This drops direct
usage of libcanberra-gtk, and the X11 connection indirectly. One thing
worth noting is that we pass less metadata (eg. event x/y that might be
used for surrounding effects). This was all largely unused, so the
MetaSoundPlayer was made simpler.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/327
2019-01-09 23:09:18 +00:00
Florian Müllner
393d7246cc Replace custom override schema with per-desktop override
GSettings now recognizes per-desktop overrides that can be used
to change schemas' default values for a particular desktop. This
is not entirely unlike our existing custom override mechanism in
mutter, except that it is not limited to keys in org.gnome.mutter,
and it doesn't require a separate schema - the latter means that
we (and gnome-teak-tool) no longer have to figure out the correct
schema for the current login session and just use the original one.

https://bugzilla.gnome.org/show_bug.cgi?id=786496
2018-07-31 18:36:26 +00:00
Jonas Ådahl
47ea10b7c9 Remove usage of MetaScreen
Remove any usage of MetaScreen, as it has been removed from libmutter
in the API version 3. The corresponding functionality has been moved
into three different places: MetaDisplay, MetaX11Display (for X11
specific functionality) and MetaWorkspaceManager.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:56:19 +02:00
Carlos Garnacho
4a17c8f4a9 shell-global: Do not deal with allocated strings as const char
The imagedir and userdatadir variables are not fetched from
constants/environment but created with g_strdup*/g_build*. Acknowledge that
and also free the strings in finalize.
2018-03-14 13:30:47 +00:00
Carlos Garnacho
8c3f5b615f shell: Remove gdk_screen property/getter
It's used nowhere.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
d1bebba77a shell: Remove intricate key event handling code
We no longer need to do contortions with key events, as Clutter
key events will be already handed to IMs through ClutterInputMethod.
2018-02-05 17:46:57 +01:00
Jonas Ådahl
5962be3904 shell-global: Don't set the clutter font DPI
The clutter font DPI is managed by libmutter.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 21:01:48 +08:00
Jonas Ådahl
b18735da52 shell-global: Don't override the X11 window scale
It's already done by libmutter.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 21:01:48 +08:00
Jonas Ådahl
19d0169de4 shell-global: Use MetaSettings for settings
Scale settings were moved from MetaBackend to a new MetaSettings.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-05-26 15:27:25 +08:00
Jonas Ådahl
082bc20bb9 shell-global: Get UI scaling factor from mutter
Let mutter determine the UI scale, while taking things like monitor
layout mode into consideration.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:35 +08:00
Jonas Ådahl
32ea7d763a Don't set clutters 'window-scaling-factor' property
It doesn't exist anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:35 +08:00
Hyungwon Hwang
4b80cbe1cd xdnd: Remove XDnD handling code and receive DnD signals from mutter
Move the XDnD handling code to mutter, and receive DnD handling signals from
mutter directly.

https://bugzilla.gnome.org/show_bug.cgi?id=765003
2017-03-07 08:29:51 +08:00
Hyungwon Hwang
46f3712421 xdnd: Rename XDnD handling signals to more inclusive ones
Rename the signals which have been used to handle XDnd events to more inclusive
ones. So that these signals can be used to handle the DnD events in Wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=765003
2017-03-07 08:29:51 +08:00
Alan Coopersmith
ddfdfaed78 Use /proc/self/cmdline on Solaris as well in shell_global_reexec_self()
Solaris 11.3.5 and later have a Linux-compatible implementation of
/proc/self/cmdline, so the code to use it can be enabled in gnome-shell
on Solaris - if used on an older OS, it simply fails to open the file
and returns without doing anything, just as the code did before enabling
this.

https://bugzilla.gnome.org/show_bug.cgi?id=776199

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-02-10 11:22:30 +01:00
Philip Chimento
83005e27da main: Destroy GjsContext before exit
This will be required in the upcoming version of GJS.

The reference count on ShellGlobal is 2 at this point, because JS holds a
reference due to the "window.global = Shell.Global.get()" line in
ui/environment.js. Therefore, destroy the GjsContext first, then unref
the ShellGlobal object.

Cleaning up ShellGlobal was previously only enabled behind a debug
environment variable, but it should be required now.

https://bugzilla.gnome.org/show_bug.cgi?id=775374
2016-12-07 11:34:15 -08:00
Florian Müllner
3cd8dd0f32 global: Fix a small memory leak 2016-09-21 23:38:42 +02:00
Florian Müllner
af5e65fd79 global: Make timestamp parameter unsigned
Negative values don't make sense to timestamps, and an unsigned
timestamp as returned by shell_global_get_current_time() or
Gdk/Clutter events may exceed the range of signed integers.

https://bugzilla.gnome.org/show_bug.cgi?id=769216
2016-08-11 09:04:22 +02:00
Rui Matos
af28a219be Build with merged mutter/clutter/cogl
https://bugzilla.gnome.org/show_bug.cgi?id=760439
2016-04-27 20:19:59 +02:00
Owen W. Taylor
e65d90d624 Fix text-scaling-factor under wayland.
The text-scaling-factor GSetting was not being properly propagated
to clutter and the Pango font map; under X this is done by Clutter,
which listens to XSETTINGS directly.

https://bugzilla.gnome.org/show_bug.cgi?id=756447
2015-10-20 09:35:47 -04:00
Rui Matos
4f703019ca shell-global: Mark the sync pointer motion event as synthetic
This allows mutter to ignore these events for the purpose of keeping
idle time.

https://bugzilla.gnome.org/show_bug.cgi?id=748541
2015-04-27 19:47:39 +02:00
Ting-Wei Lan
e4718d3f7f shell_global_reexec_self: add support for FreeBSD
https://bugzilla.gnome.org/show_bug.cgi?id=747788
2015-04-15 02:50:19 +08:00
Colin Walters
4da7f20759 Drop use of libgsystem, move single API call into shell-global.c
See https://mail.gnome.org/archives/desktop-devel-list/2015-February/msg00121.html

We presently only indirectly link to it via this one call; until GLib
gains structured logging, simply import the code to wrap the journal
logging in an introspectable API into Shell.

https://bugzilla.gnome.org/show_bug.cgi?id=744457
2015-02-13 04:59:40 -05:00
Jasper St. Pierre
ea552ea157 keyboardManager: Adopt to changes in meta_display_freeze_keyboard 2014-10-14 14:47:23 -07:00
Florian Müllner
93205eefb9 global: Filter out destroyed actors from get_window_actors()
All current code assumes that the list of window actors corresponds to the
list of windows; however as the list returned by meta_get_window_actors()
now includes actors during the destroy animation, that assumption breaks.

Eventually we should make everyone move to a more appropriate API, but
for now make it work again by returning a filtered list of "good"
window actors.

https://bugzilla.gnome.org/show_bug.cgi?id=735927
2014-09-11 16:51:31 +01:00
Jasper St. Pierre
5ce8980db3 shell-global: Remove grab notifier
With the window menus gone, it is no longer possible to have a GTK+ grab
in-process, so remove our code that was tracking GTK+ grabs.
2014-08-14 10:59:43 -04:00
Owen W. Taylor
83adb2a864 clutter.paintCompletedTimestamp: cogl_flush() before glFinish()
Calling glFinish() doesn't give us a reliable timestamp unless we
flush Cogl rendering to GL first.
2014-07-26 16:46:45 +02:00
Owen W. Taylor
9fff972946 perf: add a ShellGlobal property to call glFinish and log the time
It's useful to know how long frames are taking to render on the GPU.
This is impossible to measure in the normal case because frames may
parallelize with previous frames, but by calling glFinish() at the
end of the frame, we can create a (somewhat artificial, but useful)
environment where we have a meaningful timestamp for the frame
finishing drawing.

https://bugzilla.gnome.org/show_bug.cgi?id=732350
2014-07-16 10:37:48 -04:00
Owen W. Taylor
e30925995f Make frame-timestamp logging optional
Instead of always logging frame timestamps for every frame - which
was using >26 bytes of memory per frame, or 5MB per hour of continuous
redrawing - make frame timestamps something that defaults off and is
turned turned on using a new ShellGlobal::frame-timestamps property by
the perf scripts.

https://bugzilla.gnome.org/show_bug.cgi?id=732350
2014-07-16 10:33:59 -04:00
Adel Gadllah
775bd961b6 hidpi: Scale fonts on wayland
On X11 we don't need to scale up fonts because font scaling is already handled
by clutter based xft-dpi. On wayland we need to set the resolution by ourselves
so do that when the scale factor changes.

https://bugzilla.gnome.org/show_bug.cgi?id=732537
2014-07-01 12:02:19 +02:00
Florian Müllner
ae2751a68b main: Move pref overrides back into C
Commit 6c2f3d1d17 moved pref overrides into JS to implement
session mode specific overrides in a clean and generic way.
However that approach comes with a cost - doing the overrides only
after having handled over control to JS means that the core will
be initialized with the non-overridden settings before changing
to the correct values. In the best case this is unnecessary work,
but it can in fact have a worse effect: when initializing workspaces,
we will restore the previous number of workspaces when using
dynamic-workspaces and reset to the configured number otherwise.
As the non-overridden default for dynamic-workspaces is FALSE, we
can easily end up moving the user's windows to the "wrong" workspace.

Now GSettings is expected to grow support for session specific defaults,
which will render our entire override system obsolete (yay!). Given
that, it seems acceptable to use a less generic (and uglier) approach
in the meanwhile, in order to fix aforementioned problems. So move
overrides back before core initialization and just hardcode the
session-mode => override-schema relation.

https://bugzilla.gnome.org/show_bug.cgi?id=695487
2014-06-09 21:52:03 +02:00
Antoine Jacoutot
3584887938 openbsd: fix shell_global_reexec_self()
Rework the way we re-exec the shell on OpenBSD so that it does not only
work the first time it is re-exec'd.
Plug a small leak in the __linux__ case while here.

https://bugzilla.gnome.org/show_bug.cgi?id=727763
2014-05-30 11:26:39 +02:00
Florian Müllner
93c9e031e3 Update (allow-none) annotations
The annotation has been deprecated in favor of (nullable) and/or
(optional).
2014-05-28 22:01:55 +02:00
Owen W. Taylor
5d11941638 Support resource:/// URL's in GNOME_SHELL_JS envvar
It can be useful to augment the shell's search path by doing

 GNOME_SHELL_JS=resource:///org/gnome/shell:<mypath>

But this doesn't work because resource: is split off. Special
case path elements that are just 'resource' and recombine
them with the next element.

https://bugzilla.gnome.org/show_bug.cgi?id=730409
2014-05-19 20:47:05 -04:00
Bastien Nocera
85f811f147 src: Name all the timeouts and idles
https://bugzilla.gnome.org/show_bug.cgi?id=727983
2014-04-10 19:38:04 +02:00
Jasper St. Pierre
ee0c76c2b9 Link to libmutter always
Wayland support was merged into mutter master.
2014-04-09 15:24:09 -07:00
Adel Gadllah
c492415386 hidpi: Make sure gdk and clutter scaling stays disabled when the scale factor changes
Not doing that could led to messy situations when the user changes the scale factor
at runtime.

https://bugzilla.gnome.org/show_bug.cgi?id=726238
2014-03-13 14:16:11 +01:00
Adel Gadllah
5616bbd45b hidpi: Listen for gtk-xft-dpi instead of monitors-changed
Currently we update the scale factor on startup and when we get a
monitors-changed signal, which is not the only cases where the setting changes. We cannot listen for gdk-window-scaling-factor changes because it is not
exported to gdk.

So use gtk-xft-dpi which also indicates a scale factor change.

When someone changes gtk-xft-dpi directly without changing the scale factor
we will just re-read the gdk-window-scaling-factor so no harm is done.

https://bugzilla.gnome.org/show_bug.cgi?id=726238
2014-03-13 14:16:11 +01:00
Jasper St. Pierre
b7eb1f3e8b Don't use get_core_device
clutter_device_manager_get_core_device calls XIGetClientPointer, which
requires a round-trip to the server. Since we do this on StWidget
creation, this means a full round-trip for every created StWidget.
Replace this with get_device with the ID of the VCP/VCK, since mutter
doesn't support MPX, and we know this is what the device is.
2014-02-27 14:55:29 -05:00
Jasper St. Pierre
29addc499c shell-global: Only set the scale factor if get_setting succeeded
If gdk_screen_get_setting fails, like if it's running without XSettings,
then the GValue will have a value of 0. A lot of code tries to divide by
the scale factor. This produces NaN, and combined with the fact that NaN
is "leaky", we very quickly end up spinning out of control.
2014-02-23 10:54:32 -05:00
Adel Gadllah
470ac0eae3 shell_global: Use correct agruments for in update_scale_factor
Otherwise we crash ...

https://bugzilla.gnome.org/show_bug.cgi?id=705410
2014-02-18 23:40:34 +01:00
Adel Gadllah
87abbf9b20 hdpi: Revert hacks
Revert the hacks that where added in response to a bug caused by
commit ba459f4d20

https://bugzilla.gnome.org/show_bug.cgi?id=705410
2014-02-18 23:40:34 +01:00
Adel Gadllah
6f87b01c47 Revert "shell-global: Set high dpi scaling factor"
This reverts commit ba459f4d20.

This breaks gdm.
2014-02-12 22:53:11 +01:00