Commit Graph

122 Commits

Author SHA1 Message Date
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
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
Giovanni Campagna
3227d4f3ed ShellApp+ShellGlobal: unify app launch context code
Extend shell_global_create_app_launch_context() with the required
parameters and use that for shell_app_launch() too.

https://bugzilla.gnome.org/show_bug.cgi?id=669603
2014-01-19 18:51:48 +01:00
Tim Lunn
7296bedd8e remove direct access to jsapi
with js24 its not possible to access jsapi directly from C code

https://bugzilla.gnome.org/show_bug.cgi?id=711052
2013-10-30 07:44:34 +11:00
Jasper St. Pierre
1ac4ab7edc shell-global: Add new APIs for saving/loading persistent state
https://bugzilla.gnome.org/show_bug.cgi?id=710137
2013-10-21 14:13:21 -04:00
Giovanni Campagna
11c2933e23 ShellGlobal: remove cursor manipulation functions
Use the new API in MetaScreen instead, which is automatically
routed to MetaCursorTracker as appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=707467
2013-09-12 10:34:22 +02:00
Jasper St. Pierre
3582ba0c77 layout: Don't use the input mode to block events to windows
Instead, use the standard Clutter scene graph and our Chrome system.

This also removes our last use of the input mode, so remove that as
well.

https://bugzilla.gnome.org/show_bug.cgi?id=700735
2013-07-08 17:05:17 -04:00
Jasper St. Pierre
93dc7a51c0 Rework window / actor focus handling
The duality of the Clutter's key focus and mutter's window focus has long been
a problem for us in lots of case, and caused us to create large and complicated
hacks to get around the issue, including GrabHelper's focus grab model.

Instead of doing this, tie basic focus management into the core of gnome-shell,
instead of requiring complex "application-level" management to get it done
right.

Do this by making sure that only one of an actor or window can be focused at
the same time, and apply the appropriate logic to drop one or the other,
reactively.

Modals are considered a special case, as we grab all keyboard events, but at
the X level, the client window still has focus. Make sure to not do any input
synchronization when we have a modal.

At the same time, remove the FOCUSED input mode, as it's no longer necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=700735
2013-07-08 17:05:16 -04:00
Rui Matos
944c28f3b3 status/keyboard: Synchronize input source switching with key events
Currently we simply set the gsettings key when activating an input
source. This obviously introduces a time window, between the event that
activates the switch and when the switch is complete, under which key
events are being delivered to applications and interpreted according
to the previous input source.

The patches in bug 696996 introduce a DBus API in g-s-d that allows us
to know when an input source if effectively active. Using that and
freezing keyboard events in the X server until we hear back from g-s-d
we can ensure that events won't be misinterpreted after an input
source switch.

https://bugzilla.gnome.org/show_bug.cgi?id=697007
2013-05-27 14:05:50 +02:00
Colin Walters
ccfa3d3be1 Re-lock the screen if we're restarted from a previously crashed shell
This way we "fail closed", which is better for security.

See https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/1064584

https://bugzilla.gnome.org/show_bug.cgi?id=691987
2013-05-23 16:10:03 -04:00
Jasper St. Pierre
9a79c71e88 global: Remove support for the NONREACTIVE input mode
As it's unused, this is a quick cleanup before we can go onto
more important things.

https://bugzilla.gnome.org/show_bug.cgi?id=700735
2013-05-22 12:11:19 -04:00
Giovanni Campagna
c30661c44c NotificationDaemon: support sound in notifications
The notifications spec has two hints for playing a sound, sound-file
and sound-name. We can support them using the existing code that
wraps libcanberra.

https://bugzilla.gnome.org/show_bug.cgi?id=642831
2013-02-14 18:54:08 +01:00
Jasper St. Pierre
c0279df3c6 layout: Port to the new mutter-based barrier wrappers
As pressure barriers need a signalling mechanism to provide
information about when and where they are hit, an object which
provides a signal is a more appropriate abstraction for a pointer
barrier than a functional ID-based approach. Mutter has gained
pointer barrier wrappers, so use its objects instead of ours.

https://bugzilla.gnome.org/show_bug.cgi?id=677215
2013-02-08 14:27:42 -05:00
Giovanni Campagna
427750d6af ShellGlobal: improve code to emit sound events
Use libcanberra-gtk3 and improve the set of context properties to correctly
associate the sounds with the shell.

https://bugzilla.gnome.org/show_bug.cgi?id=642831
2013-01-21 18:03:23 +01:00
Cosimo Cecchi
dd19459e18 Add a SelectArea() DBus method
This will be useful for e.g. selecting an area for a screenshot.

https://bugzilla.gnome.org/show_bug.cgi?id=687954
2013-01-03 12:56:45 +01:00
Jasper St. Pierre
85728f0d15 layout: Use a MetaBackgroundActor, not a custom ClutterX11TexturePixmap
While looking at how the plymouth implementation was built, I was so
short-sighted and focused on the string "_XROOTPMAP_ID" that I didn't
realize it was the name of the standard background on the root window.
Remove our own implementation, and switch to using a standard mutter
MetaBackgroundActor.

https://bugzilla.gnome.org/show_bug.cgi?id=682428
2012-10-26 11:54:25 -04:00
Jasper St. Pierre
5e12e5f42a layout: Add a fake root pixmap actor at startup, and fade it out
This provides us with a smooth transition between plymouth and gdm.

https://bugzilla.gnome.org/show_bug.cgi?id=682428
2012-09-19 11:45:24 +02:00
Jasper St. Pierre
cb9062f818 calendar: Launch the calendar server with DBus autostart
The supposed reason for launching the calendar server in a peculiar
way was so that the process would be killed when the Shell was killed,
but that didn't actually work. Launch the calendar server through auto-start,
and persist all throughout the session.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-03 18:14:53 -03:00
Cosimo Cecchi
85bc8ccccc shell-global: remove shell_global_gc()
It's unused now.

https://bugzilla.gnome.org/show_bug.cgi?id=679832
2012-07-12 20:11:39 -04:00
Cosimo Cecchi
e82fe14f00 shell-global: remove unused shell_global_maybe_gc()
It's not used anywhere, and we're removing the manual garbage collection
invocations anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=679832
2012-07-12 20:11:38 -04:00
Florian Müllner
e49b94658c Remove SessionType type
SessionType has now completely been replaced by the finer-grained
session-mode, so remove the remaining type definition.

https://bugzilla.gnome.org/show_bug.cgi?id=676156
2012-05-22 19:42:28 +02:00
Florian Müllner
19318a1eeb global: Remove session_type property
ShellGlobal:session-type is now unsed, remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=676156
2012-05-22 19:42:28 +02:00
Florian Müllner
940ddb104c global: Add session-mode property
Add a session-mode property on ShellGlobal which corresponds to the
new --mode switch. Make the existing ShellGlobal:session-type property
readonly and base it on ShellGlobal:session-mode to avoid conflicts.

https://bugzilla.gnome.org/show_bug.cgi?id=676156
2012-05-22 19:42:27 +02:00
Adel Gadllah
4516e4cc3b screenshot: Split into separate file / class
Split the screenshot functionality from ShellGlobal into its own class.

https://bugzilla.gnome.org/show_bug.cgi?id=670086
2012-02-14 21:10:08 +01:00
Adel Gadllah
b2ec340f9e screenshot: Add include_cursor parameter
Add a boolean parameter to Screenshot and ScreenshotWindow which draws the cursor on the screenshot when set
to true.

https://bugzilla.gnome.org/show_bug.cgi?id=670086
2012-02-14 21:10:08 +01:00
Jasper St. Pierre
b2f33e2895 Split off the extension importing stuff into a new library, 'ShellJS'
This allows us to create a separate utility to import things from
shell extensions that does not have the entire Shell stack built up

https://bugzilla.gnome.org/show_bug.cgi?id=668429
2012-02-07 16:00:37 -05:00
Cosimo Cecchi
049a561466 screenshot: add a 'flash' boolean flag to screenshot methods
Add a flag to these methods that allows flashing the area of the
screenshot directly from the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=668618
2012-01-25 19:20:09 -05:00
Adel Gadllah
882fe48d80 Screenshot: Move filesystem I/O to a thread
Writting the screenshot to a file can take a relativly long time
in which we block the compositor, so do that part in a separate
thread to avoid the hang.

https://bugzilla.gnome.org/show_bug.cgi?id=652952
2012-01-22 11:47:56 +01:00
Adel Gadllah
f4d8a35b9d altTab: Don't refuse to work when a pointer grab is in place
Allow push_modal to optionally only work with a keyboard only grab and
use that in altTab as a fallback to allow switching windows while a pointer grab
is in effect (like during DND operations).

https://bugzilla.gnome.org/show_bug.cgi?id=660457
2011-10-21 09:12:17 +02:00
Colin Walters
36bfe8c533 memory: Add display of elapsed seconds since a garbage collection
This is useful information for debugging.

https://bugzilla.gnome.org/show_bug.cgi?id=659254
2011-09-17 10:16:35 -04:00
Ray Strode
5088f22388 global: Add concept of "session type"
This commit introduces a "session type" for
gnome-shell.  It essentially defines what
mode of operation the shell runs in
(normal-in-a-users-session mode, or at-the-login-screen mode).

Note this commit only lays the groundwork.  Actually
looking at the key and appropriately differentiating
the UI will happen in subsequent commits.

https://bugzilla.gnome.org/show_bug.cgi?id=657082
2011-08-28 12:22:38 -04:00
Adel Gadllah
b7fd78b254 Add screenshot interface
Adds methods to shell_global to allow taking screenshots
save the result into a specified png image.

It exposes three methods via shellDBus applications like
gnome-screenshot:

*) Screenshot (screenshots the whole screen)
*) ScreenshotWindow (screenshots the focused window)
*) ScreenshotArea (screenshots a specific area)

https://bugzilla.gnome.org/show_bug.cgi?id=652952
2011-08-24 16:06:13 +02:00
Dan Winship
aed50e2a39 shell-global: add a "display" property
and update callers to fetch that rather than doing
"global.screen.get_display()"

https://bugzilla.gnome.org/show_bug.cgi?id=654639
2011-08-03 09:09:55 -04:00
Dan Winship
64b2b4a7d4 layout: new file handling shell layout
Remove ShellGlobal's monitor-related methods, and have
Main.layoutManager provide that information instead. Move
Main._relayout() to LayoutManager, and have other objects connect to
the layout manager's 'monitors-changed' signal to know when the screen
geometry has changed.

https://bugzilla.gnome.org/show_bug.cgi?id=636963
2011-07-06 08:38:35 -04:00
Colin Walters
26aa4333a5 shell_global_set_property_mutable: Remove
All introspection properties are now writable;
See https://bugzilla.gnome.org/show_bug.cgi?id=646633

https://bugzilla.gnome.org/show_bug.cgi?id=652597
2011-06-20 17:58:40 -04:00
Colin Walters
aa03734d39 Add "Memory" tab to lg
shell_global_get_memory_info() is a new function which extracts a few
global counters we have already, namely glibc's mallinfo, spidermonkey's
JSGC_BYTES, and gjs' counters for boxed/object/etc wrappers.

There is some slight overlap with perf; ultimately though I'd
like this function to do some more extensive analysis, so it wouldn't
be quite the same.

perf is going to be mainly concerned with how big the whole process
over time is; memory_info is for debugging memory leaks.

https://bugzilla.gnome.org/show_bug.cgi?id=650692
2011-06-07 14:44:35 -04:00
Dan Winship
8e4a5f1ac5 Shell: sort, align, clean up shell-global.h and shell-util.h
https://bugzilla.gnome.org/show_bug.cgi?id=648755
2011-05-16 14:51:35 -04:00
Dan Winship
61577e176e shell: move non-ShellGlobal functions from shell-global to shell-util
shell-global had become a dumping ground for functions that didn't
have anywhere else to be. Make shell-util the dumping ground instead,
and have shell-global only have methods that involve the ShellGlobal
object.

https://bugzilla.gnome.org/show_bug.cgi?id=648755
2011-05-16 14:51:35 -04:00
Dan Winship
4b008b1ada shell-global: Remove unused ShellGlobal parameters
Remove the ShellGlobal parameter from any method that isn't actually
ShellGlobal-related (and rename them to not have "global" in the
name).

https://bugzilla.gnome.org/show_bug.cgi?id=648755
2011-05-16 14:51:35 -04:00
Dan Winship
79927faaec shell-global: remove some no-longer-used methods
https://bugzilla.gnome.org/show_bug.cgi?id=648755
2011-04-27 15:32:26 -04:00
Guillaume Desmottes
227da25776 Move Telepathy utility functions from shell-global to shell-tp-client
https://bugzilla.gnome.org/show_bug.cgi?id=645585
2011-04-27 10:43:17 +02:00
Colin Walters
92f09a60f6 Add shell_get_file_contents_utf8_sync(), use it instead of gio temporarily
Adding correct annotations to Gio.File.load_contents revealed that gjs
doesn't actually support array+length combinations.  For 3.0 this would
be invasive to fix, so add a method to ShellGlobal which does what
we need.

https://bugzilla.gnome.org/show_bug.cgi?id=646333
2011-04-04 09:08:33 -04:00
Alexander Larsson
1518dc9b60 Add pointer barriers to panel and message tray
If you have XFixes 5 (and corresponding xserver support) then we
add barriers on the panel and in the message tray corner so that
its easy to reach the corners even when there are monitors to the
sides of the primary monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=622655
2011-03-21 21:03:19 +01:00
Dan Winship
2782011ce8 shell-global: try to resync the pointer state after grabs
If the pointer moves on or off the stage while another process has a
grab, we will lose track of it. One example of this is that if you use
a popup menu from a message tray trayicon, the tray will stay up after
the menu goes away, because the shell never saw the pointer leave it.

Add a new method shell_global_sync_pointer() that causes clutter to
recheck what actor is under the pointer and generate leave/enter
events if appropriate.

Of course, we can't actually tell for sure when another process has a
grab, so we need a heuristic of when to call this. Currently we call
it from Chrome._windowsRestacked(), which is not really the right
thing at all, but does fix the menu-from-trayicon case...

https://bugzilla.gnome.org/show_bug.cgi?id=630842
2011-03-21 14:56:53 -04:00
Alexander Larsson
d8bd9f5a66 Add and export shell_global_get_primary_monitor_index
https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-16 20:33:25 +01:00
Colin Walters
b4f16c4df8 Add shell_global_report_error()
Move the "system notification error" handling out of
util.js, and add it to ShellGlobal so we can start
calling it from across the codebase better (including
C).

https://bugzilla.gnome.org/show_bug.cgi?id=644402
2011-03-16 15:07:21 -04:00
Jasper St. Pierre
525da01a62 shell-global: Add wrappers for TelepathyLogger
gjs can't support more than one callback in the same function,
so work around this with yet another shell-global wrapper.

https://bugzilla.gnome.org/show_bug.cgi?id=643377
2011-03-14 18:49:31 -04:00
Jasper St. Pierre
ebcb87c163 shell-global: Add shell_get_self_contact_features
This is another workaround for the lack of gjs supporting array
arguments, this time wrapping tp_connection_upgrade_contacts to
add new features to the connection's self contact.

https://bugzilla.gnome.org/show_bug.cgi?id=642793
2011-03-14 18:48:18 -04:00
Dan Winship
e187961d72 src: update for mutter include reorganization
https://bugzilla.gnome.org/show_bug.cgi?id=641724
2011-03-07 18:33:33 -05:00