Commit Graph

2461 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
0141fef561 st-theme-node: Paint elements in resource-scale scaled surfaces
Pass resource-scale to drawing phase, and use it to create texture
surfaces scaled with the widget current scaling.
Also redraw by default widgets when the resource scale changes.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Jonas Ådahl
5d4a804c90 st-shadow: Ceil size before comparing with texture
A fractional resource scale would mean we never use the fast path for
creating the shadow, because we'd cast the int to a float before
comparing, which would never match.

Instead compare the expected texture size with the source texture, to
actually potentially trigger the fast path.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Jonas Ådahl
6bc3300e5a st-scroll-view-fade: Include outer bound of pixel on border
The fade shader will draw the fade effect up until the border pixel. If
we set the bottom right coordinate to the outer edge of the pixel we
might end up not drawing the fade effect on all of the pixels. This
could for example happen if one logical pixel (clutter stage pixel)
consists of more than one physical pixel.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
15f69bdc3b st-label: Paint shadow using resource-scaled texture
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
0bcf76970a st-private: Scale shadows accordingly to actor resource scaling
Use scaled offscreen framebuffer to paint shadows so that it will match the
scaling applied to the actual actor.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
03c4628cad st-drawing-area: Draw content taking care of the resource_scale
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Jonas Ådahl
9f4ae9618a st-widget: Introduce widget resource scale
This commit makes StWidget manage the scale of which its associated
resources should be multiplied with. The resource scale is calculated
by clutter, and is retrieved by clutter_actor_get_resource_scale(). Due
to the resource scale not always being available, the getter may fail,
and the actual widget that draws the content will have to deal with
this situation.

As the resource scale depends on where on the stage the widget is drawn,
the resource scale will in general be available once the widget is
mapped.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Robert Mader
94a674c008 na-tray-manager: Use gdk_screen_get_default() and gdk_x11_get_default_screen()
instead of explicit screen arguments and `gdk_screen_get_number()`, as nowadays there
is always only one screen. This silences some deprecation warnings and removes
deprecated API.

Bonus: some code style cleanups

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/422
2019-02-27 00:35:04 +01:00
Florian Müllner
ffb9aa1ace test-theme: Stop using ClutterCairoTexture
It's deprecated, so use one of our own types for testing type
inheritance.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/420
2019-02-26 03:04:00 +01:00
Robert Mader
823fd855cf na-tray-child: Silence some deprecation warnings
Use `gdk_x11_display_error_trap_...` instead of `gdk_error_trap_...`

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/417
2019-02-26 01:37:54 +01:00
Robert Mader
f5ee225362 shell-tray-icon: Silence some deprecation warnings
Use `gdk_x11_display_error_trap_...` instead of `gdk_error_trap_...`

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/417
2019-02-26 01:37:46 +01:00
Andrea Azzarone
ff1ea4b1c9 st-clipboard: Remove get/set_property functions.
Remove st_clipboard_get_property and st_clipboard_set_property because they are
identical to the default implementation.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/414
2019-02-26 00:23:36 +00:00
Florian Müllner
81f0e7de9e texture-cache: Use content size for returned images
Since commit deec0bf255, the texture cache is based on ClutterImage
rather than ClutterTexture. As ClutterImage (like all ClutterContent)
is only concerned with painting, it doesn't influence the size of the
actor it is added to at all, and the returned actor will now stay at
size 0x0 after the image has been loaded.

Set up the actor to follow the content's size instead, to get closer
to the previous behavior.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/402
2019-02-10 19:29:13 +00:00
Florian Müllner
8003f8b803 build: Don't introspect ShellMenu
It is now only used internally by ShellApp to track remote actions,
so there's no need to expose it to javascript code.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-02-06 18:29:15 +01:00
Florian Müllner
7df93458d7 build: Remove remote menu support
It is now unused.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-02-06 18:29:15 +01:00
Florian Müllner
753618a19f app: Remove :menu property
It is now unused.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-02-06 18:29:15 +01:00
Florian Müllner
e355756758 app: Don't rely on app menu to check for GtkApplications
As the app menu is being phased out, it is no longer a good indicator
for GtkApplications. Instead, base the check directly on the appropriate
D-Bus properties.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-02-06 18:29:15 +01:00
Carlos Garnacho
b092c5f37d st: Honor button mask on touch events
Even though it's not a "button", we use button1 to map to actions. Seems
fair to refuse to press the StButton if it would not react to button1.
2019-02-05 16:25:54 +01:00
Florian Müllner
446183adee app: Remove unused code
This was overlooked back in the day when application search moved into GIO.
2019-02-05 01:54:17 +01:00
Carlos Garnacho
d8593c5b4a st: Init icon theme in StSettings
This was not initialized, leaving a default icon theme unless
changed later.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/953
2019-02-04 17:13:36 +00:00
Carlos Garnacho
8647922df9 st: Use StSettings for primary-paste setting
If middle-click happens, check whether the setting is enabled
and paste primary selection if so.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 23:18:53 +01:00
Carlos Garnacho
df3068d9ca st: Use StSettings for enable-animations check
Keep a statically allocated one so all widgets will use a single
object.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 23:18:53 +01:00
Carlos Garnacho
036e67049b st-texture-cache: Use GtkIconTheme separate from GTK+
Using the default icon theme just has automatic theme updates as an added
value. We can do that ourselves, and stop relying on XSettings internally.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 23:18:53 +01:00
Carlos Garnacho
fef2bac8ab st: Add StSettings object
This is a GtkSettings lookalike, so the shell can fetch the relevant
settings.
2019-01-30 23:18:53 +01:00
Carlos Garnacho
c59c5eb893 st: Add StDirectionType enum
In order to replace GTK+'s GtkDirectionType. It's bit-compatible with it,
too. All callers have been updated to use it.

This is a purely accessory change in terms of X11 Display usage cleanup,
but helps see better what is left.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 22:50:01 +01:00
Carlos Garnacho
a977c1388a st: Add StPolicyType enum
In order to replace GTK+'s GtkPolicyType. It's bit-compatible with it, too.
All callers have been updated to use it.

This is a purely accessory change in terms of X11 Display usage cleanup,
but helps see better what is left.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 22:50:01 +01:00
Carlos Garnacho
0fdfebdb67 shell: Drop some unused headers and Gdk variables
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 22:50:01 +01:00
Florian Müllner
f4a64f77f2 util: Use (thread-safe) uselocale()
Our helper method to translate a string according to the LC_TIME
setting uses the no-thread-safe setlocale(). While that's not an
issue in practice given that all JS code shares a single thread,
I was pointed to a better alternative when adopting the same
handling in gnome-desktop's wallclock[0].

[0] https://gitlab.gnome.org/GNOME/gnome-desktop/merge_requests/17

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/292
2019-01-30 20:35:04 +01: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
Georges Basile Stavracas Neto
69b1fb699f
app: Replace ClutterTexture by ClutterActor
It apparently uses no ClutterTexture specifics, and instead
only tries to match what StTextureCache used to return.

Since StTextureCache now returns ClutterActor, also use a
ClutterActor on ShellApp.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/373
2019-01-29 17:11:13 -02:00
Georges Basile Stavracas Neto
259f90bbf6
texture-cache: Fix documentation error
It now returns a ClutterActor, not a ClutterTexture.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/371
2019-01-29 16:38:04 -02:00
Georges Basile Stavracas Neto
8665045326
st: Check for ClutterImage when creating shadow pipelines
_st_create_shadow_pipeline_from_actor creates shadow pipelines
from actors. This function special-cases ClutterTexture as a
small performance improvement, since we can have access to the
CoglTexture easily with it. However, recent commits removed all
usage of ClutterTexture from GNOME Shell, rendering this optimization
useless. Instead, actors now may have a ClutterImage set as
their content, that can be used instead.

Replace the check for ClutterTexture with a check for ClutterImage,
and use the texture of the image when it is available.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/371
2019-01-29 16:38:04 -02:00
Georges Basile Stavracas Neto
a7bb8ee639
magnifier: Use a ClutterContent to render mouse sprite
The Magnifier class uses a small subtree of actors to track the
current cursor's position and sprite. Specifically, it uses the
deprecated ClutterTexture to paint the cursor sprites.

Add a new, very simple ClutterContent implementation to track the
cursor sprite, and replace the ClutterTexture by a ClutterActor.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/371
2019-01-29 16:31:57 -02:00
Carlos Garnacho
95a31b0c31 st: Use ClutterKeymap to detect caps lock state changes
This drops usage of Gtk/X11, replacing it with code that is dependent
of the Clutter backend in use. Another positive side effect is that
the keymap state will now be correct on wayland, since there were no
guarantees that X11 key state would reflect the current reality.

https://bugzilla.gnome.org/show_bug.cgi?id=762881
2019-01-29 16:03:22 +00: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
Georges Basile Stavracas Neto
23d6d13d80
st-shadow: Add a CoglFramebuffer argument
The last patch in the series, this one adapts StShadowHelper
to received a CoglFramebuffer. This is where we first touch
JavaScript with Cogl types, and as such, it depends on the
latest Mutter. Earlier versions of Mutter didn't have its
Mutter-Clutter GIR to generate types for various Cogl types.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/283
2019-01-28 12:35:54 -02:00
Georges Basile Stavracas Neto
09addfc87c
st-private: Receive a CoglFramebuffer
Same case of the previous patch; _st_paint_shadow_with_opacity()
uses cogl_get_draw_framebuffer(), and this patch makes it receive
a CoglFramebuffer as a parameter instead.

The cautious reader might notice that this commit apparently goes
against the long-term goal, for it introduces more instances of
cogl_get_draw_framebuffer(). This is not wrong, but these introduced
ones will be removed later on, when ClutterActor.paint() receives
a CoglFramebuffer as a parameter instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/283
2019-01-28 12:35:51 -02:00
Georges Basile Stavracas Neto
a2f27a9409
theme-node-transition: Receive a CoglFramebuffer
This is in preparation for a future where only explicit frambuffer
APIs are available, i.e., cogl_get_draw_framebuffer() does not
exist.

There is absolutely no functional changes in this patch (nor the
following ones in this series), only rearrangements so that various
functions receive a CoglFramebuffer instead of using the draw
framebuffer.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/283
2019-01-28 12:35:41 -02:00
Carlos Garnacho
69ad75cf48 shell-app-system: Cache GAppInfos around
This was called here just to end up emitting ::installed-changed,
which would trigger other g_app_info_get_all() calls. Cache it here
so it may be reused later on.
2019-01-26 22:55:31 +01:00
verdre
99ce3deeb0 st-button: Handle touch-cancel events
Handling those events is neccessary if a touch event that pressed down a
button turns out to be a gesture. In this case the button should be
released without emitting the clicked signal.
2019-01-25 10:31:41 +00:00
Georges Basile Stavracas Neto
3dcb593a71
texture-cache: Simplify function with g_autoptr
st_texture_cache_reset_texture() is slightly easier to
read and follow by using g_autoptr, so use that.
2019-01-24 16:23:58 -02:00
Georges Basile Stavracas Neto
1847a4f4cc
texture-cache: Avoid creating unnecessary ClutterImages
After loading the GdkPixbuf, StTextureCache unconditionally
creates a ClutterImage and, if it's not in the cache, add
it to the cache. That's a waste of resources when the image
is already committed to the texture cache.

Fix that by reusing the ClutterImage of the cache if it is
already there; otherwise, create a new ClutterImage as we
were previously doing.
2019-01-24 16:23:58 -02:00
Georges Basile Stavracas Neto
deec0bf255
texture-cache: Replace ClutterTexture by ClutterImage
ClutterTexture is a deprecated class that is simultaneously
an actor, and the content of the actor. Clutter's new model
is to separate painting (via ClutterContent) from actors.

Currently, StTextureCache relies on ClutterTexture to store
the loaded textures. This not only does not match the latest
practices of Clutter, but also generates various compile-time
warnings.

Port StTextureCache to store ClutterImages instead of storing
ClutterTextures. ClutterImage exposes the internal CoglTexture,
so no helpers are needed to match the current StTextureCache
API. Aspect ratio was dropped, but from my testing, it doesn't
change anything.
2019-01-24 16:23:58 -02:00
Niels De Graef
7c4e43c84f Remove deprecated CoglHandle
Prefer something a bit more type-safe instead and in the meantime use
the newly available `cogl_clear_object` to simplify some code a bit.
2019-01-16 17:54:29 +00:00
Carlos Garnacho
3989cad3db build: Remove Canberra dependency
It is no longer direct, but rather through mutter API.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/327
2019-01-09 23:09:18 +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
925a25da17 st: Avoid integer overflow on unpremultiply
When computing the effective border color, we operate on colors with
premultiplied alpha to simplify the calculations, then unpremultiply
the result. However we miss a bounds check in the last check, so any
color component can overflow the allowed maximum of 0xff and shift the
result in unexpected ways.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/305
2018-12-04 15:55:39 +00:00
Cosimo Cecchi
6743c18fdf StWidget: don't forget to invalidate the paint state if not on stage
If the actor is not on the stage yet (i.e. does not have a theme
node), but has a paint state cached, we currently fail to invalidate
it, which will lead to the actor painting with old contents once it
gets onto the stage.

This commit fixes the issue by changing our invalidation strategy;
previously we were looking at the widget's own theme node to determine
if it should be invalidated or not.
Now we look at the theme nodes of our cached paint states. When the
widget is mapped on stage, those are the same as the widget's own
theme node, but when the widget is not on the stage, we'll still be
able to invalidate them.

As part of this, we move the invalidation API to StThemeNodePaintState,
which is a more natural place for our use case.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/314
2018-12-04 15:52:36 +00:00
Marco Trevisan (Treviño)
4c11d15a07 st-button: Ignore pointer emulated touch events
In X11, pointer emulated touch events are replicated with normal PRESS, RELEASE
pair events which are generated by the server. Thus for a single tap we get:
 - TOUCH_BEGIN -> TOUCH_END, PRESS -> RELEASE

This will cause st-button to send two "clicked" signals, instead of just one,
breaking extensions (like dash-to-dock) that show buttons in the main stage
which will be checked two times or that will receive the same signal two times.
2018-11-26 21:18:25 +00:00
Carlos Garnacho
cdb8ac3a2f shell: Hide/drop unused public API
These static methods won't work as-is as MetaStartupSequence API in
JS bindings. Luckily those are used nowhere there.
2018-11-23 13:58:35 +01:00
Carlos Garnacho
10b3671a99 shell: Use MetaStartupNotification
This is "API compatible" with ShellStartupNotification, so only
C changes are necessary.
2018-11-23 13:58:35 +01:00
Jasper St. Pierre
43041f0464 app-usage: Remove more unused things
https://bugzilla.gnome.org/show_bug.cgi?id=673767
2018-11-17 12:08:33 +00:00
Jasper St. Pierre
c3ec813f6f app-usage: Remove unused open-window-count attribute
Since this has already been unused and was inaccessible, this shouldn't
matter too much.

https://bugzilla.gnome.org/show_bug.cgi?id=673767
2018-11-17 12:08:33 +00:00
Jasper St. Pierre
04d7069d83 app-usage: Remove crufty old "context"s idea
Back in the day, there was a proposed system of tracking apps in a
specific context.

The inspiration was that you may have used apps in multiple modes:
Firefox may have been used in both "Programmer Reference" and
"Kitten Videos" contexts. Early user response to the feedback wasn't
too positive - context switching is something that humans have trouble
doing implicitly, let alone explicitly. The old codebase still has a
few remnants of this around; let's finally put them to rest.

Note that we still write out a dummy context tag to the XML file - old
versions of the shell will flat out crash if you don't have one of those
in there, so just leave it in for compatibility sake.

https://bugzilla.gnome.org/show_bug.cgi?id=673767
2018-11-17 12:08:33 +00:00
Georges Basile Stavracas Neto
361cc6cf92
st: Remove deprecated cogl_texture_new()
cogl_texture_new() is used in a few places in GNOME Shell, but
it's a deprecated Cogl function. The replacement is the less
verbose cogl_texture_2d_new_with_size(), that is very much a
straightforward replacement.

Remove the few places where this function is used, replacing
it by the CoglTexture2d counterpart.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/287
2018-11-12 21:59:36 -02:00
Cosimo Cecchi
ca3f4cfb41 StTextureCache: use right event to detect file changes
StTextureCache installs file monitors that invalidate caches when
contents of the underlying file change.
At the moment, the cache uses the Gio.FileMonitorEvent.CHANGED event
type to make that determination.

However, that is suboptimal for at least two reasons:
- while a file is being written to disk, many CHANGED events will be
  emitted in sequence. That will cause needless cache invalidations,
  and we will risk loading the file before it's fully loaded.
- if an existing file is replaced, e.g. with g_file_replace(), we may
  not get a CHANGED event but a CREATED one instead, so the cache ends
  up never getting invalidated.

The good news is that in both of those cases GFileMonitor will send a
CHANGES_DONE_HINT event after changes have settled, or after the file
is replaced.

This commit fixes both cases by switching from the CHANGED event to
CHANGES_DONE_HINT to determine that a file has in fact changed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/286
2018-11-10 00:42:49 +01:00
Georges Basile Stavracas Neto
127ba318fd
polkit: Only unregister registered handles
If the initialization fails for some reason, for example by
running 'gnome-shell --replace', we should not crash because
of an attempt of unregistering an unregistered agent handle.

Fix that by checking if the handle is not NULL before calling
the unregistering routines.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/66
2018-11-06 13:05:29 -02:00
Georges Basile Stavracas Neto
72fa44d0fd
polkit: Port to G_DECLARE_FINAL_CLASS
So we can remove this old boilerplate code. In order to be able
to use that, the autoptr function for PolkitAgentListener was
added as well.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/66
2018-11-06 13:05:15 -02:00
Georges Basile Stavracas Neto
655234e6c3
shell: Remove ShellGenericContainer
Now that it is no longer used in GNOME Shell, let's
remove this old workaround. This commit also removes
the docs reference from the sgml file.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:44:14 -03:00
Georges Basile Stavracas Neto
b719744e75
st-bin: Destroy child in ClutterActor:destroy vfunc
According to Clutter documentation, "[…] actors implementing the
ClutterContainer interface should override the default implementation
of the class handler of this signal and call clutter_actor_destroy()
on their  children."

StBin was doing that in GObject:dispose() instead. Move the child
destruction to a new ClutterActor:destroy() vfunc override.
2018-10-08 22:43:13 -03:00
Georges Basile Stavracas Neto
2717ca9d08
st-box-layout: Pass correct allocation box to layout manager
StBoxLayout implements StScrollable, which, semantically, means that
the StBoxLayout size may not match the minimum size reported by the
layout manager. In this specific case, the layout manager by is a
ClutterBoxLayout by default. For example:

        +--------------+
        |   Viewport   |
 +------+--------------+-----------------+
 |      |              |                 |
 |      |              |     Content     |
 |      |              |                 |
 +------+--------------+-----------------+
        |              |
        +--------------+

So, assuming that:

 - ContentSize = the minimum size of the content;
 - ViewportSize = the allocated size of the viewport;

When allocating StBoxLayout, it must assume ViewportSize, but must
pass ContentSize to the layout manager. That way, the children of
StBoxLayout are correctly placed within it, even if it's bigger than
ViewportSize.

And here's the problem: right now, StBoxLayout assumes ViewportSize
AND also passes it to layout manager. Commit 77c4c6b6d specifically
exposed this bug by relying entirely on StBoxLayout to arrange the
app and window icons.

Fix that by using ViewportSize to allocate StBoxLayout itself, but
passing ContentSize to the layout manager.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:24 -03:00
Florian Müllner
44b871da92 shell: Fix list of GIR includes
gjs now relies entirely on introspection data to determine parent
types and implemented interfaces, so in order to have all methods
and properties resolve correctly, we must include the corresponding
GIRs of all types used.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/574
2018-09-25 23:57:51 +00:00
Florian Müllner
3e29ab5441 build: Remove obsolete soup dependency
It's unused since commit 96396163c ...

https://gitlab.gnome.org/GNOME/gnome-shell/issues/574
2018-09-25 23:57:51 +00:00
Florian Müllner
87a645aa2b app: Close all closable windows from quit()
There's no relation between a window being hidden from overview/taskbars
and a window not being closable - currently we effectively disable the
fallback quit action for any application with open transients, which
simply doesn't make sense.

Instead, only exclude windows for which the close action has been
explicitly disabled.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/217
2018-09-13 10:54:39 +00:00
Carlos Garnacho
dd59212d3f st: Use ClutterClickAction on StEntry primary/secondary icons
This makes them work on touchscreens as well.

Closes: #116
2018-08-17 18:27:44 +00:00
Florian Müllner
95788c9834 build: Use dedicated resources for helper programs
Using a single resource file for all JS sources saves a couple of
build system instructions, but has some serious downsides:

 - bundling the entire shell code with the tools blows
   up their size unnecessarily

 - the tools are rebuilt unnecessarily for any shell
   code change

Autotools was painful enough to let this slip, but with meson we
don't have any excuses - using the actual dependencies speeds up
the build a tiny bit and reduces the tools' sizes from over 2M
to about 50k.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/192
2018-08-14 17:28:04 +00:00
Florian Müllner
9cf571efbd build: Clean up tools' dependencies
Simply reusing the same dependencies as gnome-shell itself not only
means that we link tons of stuff unnecessarily, but also that we
have to do the whole mutter rpath dance for nothing. Just use the
dependencies those executables actually need for a nice cleanup.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/192
2018-08-14 17:28:03 +00:00
Florian Müllner
dc4128c78b build: Don't modify typelib search path in tools
We need this in the main gnome-shell executable in order to locate
the private Shell and St typelibs, but those aren't useful or even
usable in the extension-prefs/portal helper tools.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/192
2018-08-14 17:28:03 +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
Georges Basile Stavracas Neto
2991f9f102 util: Fix code style
The C code introduced in 49d8ff38e did not follow
GNOME Shell's C code style. This commit adjusts it
to comply with the correct code style.
2018-07-30 21:23:28 -03:00
Daniel Drake
49d8ff38e7 Add check_cloexec_fds debug command
Add a debug command (to be executed manually via Alt+F2) to check
that all of gnome-shell's file descriptors have the CLOEXEC flag set.
This is important so that internal file descriptors do not get passed
to apps when they are launched.

It prints a warning message for every fd that does not have the flag set.

fdwalk() is used from the standard library if available (it is not
available in glibc), otherwise we use the same implementation as glib
has internally.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/132
2018-07-30 23:11:41 +00:00
Daniel Drake
4b522a02c3 shell-app: remove child_setup from app launching
When the amount of free memory on the system is somewhat low, gnome-shell
will sometimes fail to launch apps, reporting the error:
  fork(): Cannot allocate memory

fork() is failing here because while cloning the process virtual address
space, Linux worries that the thread being forked may end up COWing the
entire address space of the parent process (gnome-shell, which is
memory-hungry), and there is not enough free memory to permit that to
happen. This check is somewhat irrelevant because we are only forking
to immediately exec(), which will discard the whole virtual address
space anyway.

This issue can be avoided by using a new optimized gspawn codepath in
the latest glib development version, which uses posix_spawn() internally.

For the optimized codepath to be used, we must not pass a child_setup
function, so the the file descriptor management is reimplemented here
using new glib API to pass fds to the child process. The old API will
continue to be used on older glib versions.

We must also change the spawn flags for this code path to be hit.
I checked that gnome-shell's open file descriptors are all CLOEXEC
so using G_SPAWN_LEAVE_DESCRIPTORS_OPEN should be safe.

This will result in more resilient app launching when memory is low,
since the optimized spawn path avoids cloning the virtual address
space of the parent process (gnome-shell) and avoids the irrelevant
memory overcommit check.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/132
2018-07-30 23:11:41 +00:00
Florian Müllner
3efd296fc3 app: Consider "new-window" action for opening new windows
While can_open_new_window() uses some elaborate heuristics to predict
whether an application can open multiple windows, open_new_window()
will always simply relaunch the application. This is often the best
we can do, but when an application provides a "new-window" action in
its .desktop file or on the bus, it is much more likely to work as
expected than blindly activating the app and hoping for a particular
behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=756844
2018-07-30 19:21:40 +00:00
Florian Müllner
be84a00022 screenshot: Add pick_color() method
Graphical applications like GIMP or GIMP allow picking colors from
any location on-screen. In order to keep supporting this feature
on wayland and in sandboxed apps, we will expose an appropriate
method in the Screenshot interface, so first add a corresponding
method to ShellScreenshot.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/286
2018-07-30 16:55:10 +00:00
Florian Müllner
da537cda43 screenshot: Adopt GIO's async pattern
A custom callback type is more convenient, but only as long as no
other callback type is required. We are about to add functionality
that does not return the filename to a screenshot saved on disk, so
prepare for that by moving to GIO's generic async callback pattern.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/286
2018-07-30 16:55:09 +00:00
Iain Lane
a5937d1d6d Add systemd units
So that we can be started by systemd --user, instead of gnome-session.

There are three units:

  - gnome-shell.service: Start gnome-shell itself.
  - gnome-shell-x11.target, gnome-shell-wayland.target: Sync points for
    units that need to care if x11 or wayland is in use.
    gnome-settings-daemon will use these, for example.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/138
2018-07-17 18:10:06 +00:00
Jasper St. Pierre
50e849a186 st-texture-cache: Obey cache policy in st_texture_cache_load
https://bugzilla.gnome.org/show_bug.cgi?id=663461
2018-07-13 20:50:08 +00:00
Carlos Garnacho
b1b455ff1a st-adjustment: Mark all properties as EXPLICIT_NOTIFY
All adjustment setter functions take good care of avoiding emission of
notify:: when it's not needed. The set_property() implementation already
calls into the setter functions, so mark the properties as EXPLICITY_NOTIFY
in order to optimize notify:: emission away through g_object_set (rather
common from JS code).
2018-07-13 11:53:46 +00:00
Carlos Garnacho
ab4c72d758 st-box-layout: Queue relayout on adjustment changes
The actor allocation doesn't change per-se, but apply_transform()
will practically transform it. In order to have the paint volume
update accordingly, queue a relayout.
2018-07-13 11:53:46 +00:00
Carlos Garnacho
86a520b880 st: Clip StEntry to allocation
The default get_paint_volume() implementation will do the union
of children, and the child ClutterText paint volume may expand
beyond StEntry size when text overflows.

We actually want all content to be clipped to the StEntry, so
implement get_paint_volume() and tell it so.
2018-07-13 11:53:45 +00:00
Carlos Garnacho
4bf033a885 st: Make StScrollables' paint volume reflect the unconstrained view
And constrain it in StScrollView instead (instead of falling back to an
infinite paint volume, as the actor as paint/pick impls, but no
corresponding get_paint_volume one).

Fixes artifacts with the AppView (and possibly other places) when paint
volumes are aggressively cached.
2018-07-13 11:53:45 +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
Marco Trevisan (Treviño)
e39d7152f2 st-private: Warn if creating shadow for unallocated actors 2018-06-29 11:00:25 +02:00
Marco Trevisan (Treviño)
e522e2e804 st-icon: Create shadow pipeline only at paint
Don't try to allocate the shadow after allocation, just do it at paint
as it's done by other shadowed widgets
2018-06-29 10:43:12 +02:00
Marco Trevisan (Treviño)
2ba26407f1 st-icon: Remove unused size values 2018-06-29 10:43:12 +02:00
Marco Trevisan (Treviño)
1f03599d1c st-texture-cache: Save cairo surfaces to a different map
The default keyed_surface is meant to handle CoglTextures thus we can't
add cairo surfaces to it, as the DestroyNotify function won't handle them.

Then the quicker way is to just add another Hash table for handling
such types of textures, with proper destroy function.
2018-06-21 00:56:36 +02:00
Marco Trevisan (Treviño)
a24999b7a3 st-texture-cache: Don't add NULL textures to cache
This might cause a crash when cleaning up the cache as the hash table has
cogl_object_unref as DestroyNotify function but that assumes that
the passed object is a valid CoglObject.

Fixes: #210
2018-06-21 00:48:54 +02:00
Ryan Hendrickson
f56ba0877a st: Add support for font-feature-settings
Cantarell now supports tabular figures, which are useful in places
where digits should either align or not use different widths. In
order to allow elements to request the feature, add support for
the corresponding CSS property[0].

[0] https://www.w3.org/TR/css-fonts-3/#font-rend-desc

https://gitlab.gnome.org/GNOME/gnome-shell/issues/34
2018-06-08 18:45:07 +02:00
Florian Müllner
5ac6201d91 test-theme: Fix a comment 2018-06-08 17:39:13 +02:00
Florian Müllner
7a3927c168 screenshot: Store creation time in metadata
It's useful information, even when we are not using JPEG/Exif - at
least nautilus will show it in its image properties.

https://bugzilla.gnome.org/show_bug.cgi?id=790481
2018-05-31 11:36:27 +00:00
Marco Trevisan (Treviño)
44894262f4 st-label: Unset clutter text instance on disposal
The instance is owned by the actor (being its child), and thus when the
disposal happens for the parent the text is disposed too, thus it's just
safer to nullify its reference so that we won't try to access to invalid
objects later, and this might be the case since the JS objects could be kept
around until they aren't finalized.

https://bugzilla.gnome.org/show_bug.cgi?id=788931
2018-05-29 02:28:26 +03:00
Florian Müllner
a49fb90d86 build: Include Cally in St introspection
CallyActor is exposed indirectly via StAccessible's parent type,
so add the dependency to shut up a gjs warning.

https://bugzilla.gnome.org/show_bug.cgi?id=781471
2018-05-07 21:10:40 +00:00
Milan Crha
0932324d39 calendar-server: Update views only after the time range is set
The gnome-shell-calendar-server calls to refresh queries even when it
has no time range set, which results in:
  a) waste of resources (for example after login),
  b) many runtime warnings in the journalctl log, related to
     incorrect time range being used.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/244
2018-05-02 16:10:33 +02:00
Yussuf Khalil
2d6cf236c4 perf-tool: Fix default value for --extra-filter
While it is theoretically fine to run --perf=hwtest without passing --hwtest,
the test will hang in this case because it fails to start gedit. Always append
Gedit to the default value for --extra-filter when running the "hwtest" test
to make it work fine without --hwtest.
2018-04-29 16:15:16 +00:00
Mario Sanchez Prada
be76b19300 st-entry: Set text-related CSS properties on the internal ClutterText
Call _st_set_text_from_style() when updating the entry's style, so
that CSS style properties such as text-decoration or letter-spacing
are applied over the internal ClutterText instance.
2018-04-18 00:14:05 +00:00
Mario Sanchez Prada
376d696b8b st-private: Add support for letter-spacing in ClutterText based StWidgets
Add support in _st_set_text_from_style(), so that this CSS property can
be used from any StWidget holding an internal ClutterText.
2018-04-18 00:14:05 +00:00
Mario Sanchez Prada
695d61968d st-theme-node: Add new getter st_theme_node_get_letter_spacing
This will be used by ClutterText-backed StWidgets to update their
list of PangoAttributes according to the letter-spacing property.
2018-04-18 00:14:04 +00:00
Florian Müllner
f6a08472a0 st: Do not force allocation updates during shadow creation
If an actor is pending a relayout when get_allocation_box() is called,
the method forces an allocation update. In case of StWidget, this might
then result in a style update and a consecutive invalidation of the
shadow spec.

A helper method that invalidates one of its parameters as a side effect
(and by extension its return value as well) is most unexpected, so cur-
rently _st_create_shadow_pipeline_from_actor() poses an easy trap to
callers to run into.

Remove that trap by calling get_size()/get_position() instead, which
don't have the unintended side effect - it is still a good idea to fix
callers who were running into this to not waste resources on creating
shadows that are invalidated before the next paint, but throwing un-
defined behavior at them is harsh ...

https://bugzilla.gnome.org/show_bug.cgi?id=788908
2018-04-11 19:29:25 +00: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
Florian Müllner
c8e69a2154 menutracker: Fix a small memory leak
https://gitlab.gnome.org/GNOME/gnome-shell/issues/64
2018-03-02 19:43:45 +00:00
Florian Zwoch
6f0c187cf4 shell-recorder: save cursor's image hot x/y coordinates
Whenever a new cursor image is loaded also save it's hot x/y
coordinates. The drawing code already respects these values, however
they were never set. This change will place the cursor image at the
correct location as seen on screen. shell-screenshot.c served as
reference.

https://bugzilla.gnome.org/show_bug.cgi?id=792860
2018-02-07 13:16:36 +01: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
Carlos Garnacho
83accce24e st: Remove StIMText
It is entirely unused now.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
d86b62d1b7 st: Make StEntry rely entirely on ClutterInputMethod/Focus
StIMText is no longer needed here.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
3dd3c1ac34 st: Make st_button_fake_release() work with touch press
The st_button_release() call wouldn't happen because StButton does not
set priv->button_mask on touch events. And if we make it called, we can't
try to unset the device grab at the end of the function, as device/sequence
are unset earlier on.
2018-02-05 17:46:57 +01:00
Carlos Garnacho
40db4a6795 main: Stop acquiring caribou name
This is not necessary anymore.
2018-02-05 17:46:57 +01:00
Florian Müllner
2d79ab6c5c private: Avoid unnecessary conversions in shadow computation
The type was changed from double to float for no apparent reason
when moving code in commit 5060081db5.

https://bugzilla.gnome.org/show_bug.cgi?id=788627
2018-02-05 11:09:01 -05:00
Lubomir Rintel
d71af5e579 network: port to libnm
The libnm-glib is depreacted for a long time already.

https://bugzilla.gnome.org/show_bug.cgi?id=789811
2018-01-12 11:48:49 +01:00
Florian Müllner
3f3e514ff2 networkAgent: Update VPN config path
The location moved a while ago, so update the path to point to
the non-deprecated location.

https://bugzilla.gnome.org/show_bug.cgi?id=791487
2018-01-09 00:25:46 +01:00
Marco Trevisan (Treviño)
891bc45e36 main: use SA_NODEFER to track signals to being able to raise from alarm
After we receive one of the tracked signals, in case we get stuck inside
the gjs_dumpstack () call, we use an alarm to raise the previously emitted
signal, however without using SA_NODEFER, the raise inside the alarm handler
will be ignored.

To avoid to handle new signals caused by the handler calls, once we get the
first signal, we just ignore them all as they could only lead to dirty traces.

Also, cleaning up a bit the code, and disabling the shell log handler
in dump_gjs_stack_alarm_sigaction since this might lead to a new
gjs_dumpstack () request.

https://bugzilla.gnome.org/show_bug.cgi?id=789237
2017-10-24 14:18:45 +08:00
Marco Trevisan (Treviño)
f90b225eaa main: call gjs_dumpstack on aborts and traps and optionally on segfaults
In order to debug issues triggered by JS code we might need to
see the stack of it, this is not normally visible in static stack traces,
thus we need to call gjs_dumpstack () before dying the process.

Intercepting signals SIGABRT, SIGTRAP (needed for catching fatal glib
errors) SIGFPE and SIGIOT by default, while introducing a new
'backtrace-segfaults' flag for the SHELL_DEBUG environment variable to
do the same on SIGSEGV and SIGBUS (this is a precaution to avoid that we
corrupt the stack for automatic errors trackers).

In any case after dumping the stack we raise the signal again, in order
to make the system aware of it.

https://bugzilla.gnome.org/show_bug.cgi?id=789237
2017-10-23 05:05:51 -05:00
Marco Trevisan (Treviño)
f9569912df window-tracker: use generic meta_window_get_sandboxed_app_id
This is valid for both Flatpak's and snaps now, we can use a more generic
API then.

https://bugzilla.gnome.org/show_bug.cgi?id=789277
2017-10-21 13:37:13 -05:00
Mario Sanchez Prada
b5f5a594ba shell-app: Don't transition to STOPPED while still in the STARTING state
Similar to what it's done in _shell_app_add_window(), rely on calling
shell_app_sync_running_state() when removing windows too, to avoid
transitioning to STOPPED while it's still in the STARTING state.

This makes the logic compliant with the startup notification spec and
prevents stopping an application too early if it has a splash screen
that has been closed before the application's main window is shown.

https://bugzilla.gnome.org/show_bug.cgi?id=787905
2017-09-29 18:10:23 +01:00
Florian Müllner
ab0e98dfdd build: Use new mkenums_simple() function
As most libraries use the same mkenums templates, meson now added a
mkenums_simple() variant that works without providing the template.

https://bugzilla.gnome.org/show_bug.cgi?id=786343
2017-09-22 17:43:54 +02:00
Florian Müllner
2ae63691e9 meson: Use build_rpath instead of custom linker args
Meson now warns when specifying the rpath in linker flags instead
of using the newly added build_rpath option - now that we already
depend on the latest release, there's no reason anyway to not use
the nicer syntax.

https://bugzilla.gnome.org/show_bug.cgi?id=786343
2017-09-22 17:43:54 +02:00
Florian Müllner
7f381dd2fe st-icon: Remove some dead code 2017-09-22 17:43:54 +02:00
Florian Müllner
7015bb2ca9 shadow: Only use correctly sized textures for shortcut
When creating a shadow for a ClutterTexture, we currently use the
underlying CoglTexture directly instead of rendering the actor to
an offscreen buffer. This assumes that the CoglTexture is directly
suitable as shadow source, which isn't necessarily the case - it
may have a very different size than what is shown and scaled up or
down by the hardware. In that case we end up with a scaled shadow
texture as well, which messes up the desired blur effect - the
result will be too light when scaling up, or too sharp when scaling
down. To fix this, only take the shortcut when a ClutterTexture's
underlying texture has the correct size and fall back to offscreen
rendering otherwise.

https://bugzilla.gnome.org/show_bug.cgi?id=788039
2017-09-22 17:11:28 +02:00
Ray Strode
90c55e1977 gtk-embed: ensure we only listen for window-created events once
If a tray icon gets a mapped and unmapped and the mapped again
in quick succession, we can end up with multiple handlers
listening for window creation events.

This commit tries to guard against that by only listening for
window-created events when we don't  know the actor associated
with the icon.

https://bugzilla.gnome.org/show_bug.cgi?id=787361
2017-09-15 15:32:46 -04:00
Marc-Antoine Perennou
5ec0ad4e9c StEntry: fix crash when hint actor is NULL
https://bugzilla.gnome.org/show_bug.cgi?id=787580

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-09-12 21:39:30 +02:00
Florian Müllner
053b8da89c app: Work around pkexec restriction when launching
Unless automatic child reaping is disabled in GSpawnFlags, glib's
g_spawn_* functions will reparent the spawned process to init by
double-forking. Unfortunately pkexec bails out in this case[0],
which means that it no longer works in .desktop files since the
PID tracking removal in commit 01c6392c13.
Fix this by going back to manual child reaping.

[0] https://cgit.freedesktop.org/polkit/tree/src/programs/pkexec.c#n728

https://bugzilla.gnome.org/show_bug.cgi?id=763531
2017-09-12 17:32:51 +02:00
Jonas Ådahl
6fc5b0477b theme-node: Fix font family formatting
Unlike pango_font_description_from_string(),
pango_font_description_set_family() requires a already properly
formatted font family string. The proper format is a comma seperated
list of font families, but we generated a "comma space" separated list.
Passing a incorrectly formatted font family string to pango seems to
cause wierd issues, where the wrong font is sometimes selected.

For example, this fixes a font selection issue on zh_TW.UTF-8 locale for
chinese characters, where previously the "Droid Sans" font was selected
instead of "Source Han Sans TW" even though fontconfig had placed
"Source Han Sans TW" before "Droid Sans".

https://bugzilla.gnome.org/show_bug.cgi?id=786868
2017-09-04 17:47:35 +08:00
Florian Müllner
b5d3c4e165 shell-tray-manager: Disconnect theme_widget signals on finalize
The theme widget passed to shell_tray_manager_manager_screen() is simply
a means to receive style information. There is nothing which ties the two
object's life cycles together, so it is entirely possible for the tray to
be finalized with the widget still around - we shouldn't try to update the
stale object on widget style changes, so make sure we properly disconnect
the signal handler.

https://bugzilla.gnome.org/show_bug.cgi?id=786526
2017-08-20 18:03:32 +02:00
Florian Müllner
9fc6caeffb build: Only include enum header in libst dependency
Compiling the generated source for each consumer of the dependency
means we end up trying to register the enum types multiple times,
resulting in a fatal failure on startup. Luckily code outside libst
itself only depends on the header, which doesn't cause those issues.
2017-08-11 17:27:24 +02:00
Florian Müllner
79eedd93ab build: Rename variable for clarity
st_built_sources contains the source and header generated by mkenums,
not any other generated sources. Clarify that in the name, as we are
about to use source and header separately.
2017-08-11 17:27:24 +02:00
Emmanuele Bassi
7992d7c9b3 Add an explicit dependency on libst
This should ensure that the St enumeration header is available by the
time we start building the gnome-shell executable.
2017-08-11 00:21:40 +01:00
Emmanuele Bassi
86995d724e build: Use internal dependencies
We cannot rely on any build order, except the one we specify ourselves.

St depends on various generated files; other targets depend on those
files existing, so they can be included. There is no direct relationship
between targets and files, unless we declare a dependency, using the
Meson declare_dependency() constructor — which allows us to replace the
various `link_with` directives with the more appropriate `dependencies`
one, and also allows us to specify sources that must exist by the time
we build those targets.
2017-08-10 23:30:42 +01:00
Emmanuele Bassi
b0d21c3a37 Define ST_COMPILATION in the St enumeration template
In parallel builds we may end up with st-enum-types.c being built inside
separate targets outside of src/st which may not have the ST_COMPILATION
pre-processor symbol defined. For this reason, we need to define it
ourselves in the source file, before including other headers, to avoid
the single-include guard.
2017-08-10 23:27:56 +01:00
Florian Müllner
6d704cddea build: Remove included Makefiles as well
Whoops, missed those ...
2017-08-10 21:36:59 +02:00
Mario Sanchez Prada
1518a778ed main: Add private libdirs to GIR's list of search paths for scanned libraries
This is not strictly necessary when linking the shell with DT_RPATH as
the runtime paths will be extracted from the introspected libraries and
used from gobject introspection to find them when loading them based on
the typelib files, but when linking with DT_RUNPATH, as it's the case
for some linkers (e.g. ld.gold, or ld.bfd in some distros like Debian).

By explicitly prepending this directory as a library path for GIR, we're
making sure that the wrapped shared objects installed in Mutter's and
GNOME Shell's private directories can be found in all cases.

https://bugzilla.gnome.org/show_bug.cgi?id=777519
2017-08-10 20:48:07 +02:00
Florian Müllner
cf010cfd8f build: Drop autotools support
Complete the switch to meson and drop autotools support ...

https://bugzilla.gnome.org/show_bug.cgi?id=785153
2017-08-10 20:16:06 +02:00
Florian Müllner
dff3e4e0b9 ui: Add InhibitShortcutsDialog
https://bugzilla.gnome.org/show_bug.cgi?id=783342
2017-08-02 11:27:42 +01:00
Florian Müllner
c987d3d2c9 build: Support the meson build system
Meson is on track to replace autotools as the build system of choice,
so support it in addition to autotools. If all goes well, we'll
eventually be able to drop the latter ...

https://bugzilla.gnome.org/show_bug.cgi?id=783229
2017-07-20 00:20:54 +02:00
Florian Müllner
7f4e914b00 build: Move gvc submodule to /subprojects/gvc
When using the meson build system, gvc will be built as a subproject.
As meson restricts submodules to a subprojects/ directory in the
source tree root, move the submodule there.

https://bugzilla.gnome.org/show_bug.cgi?id=783229
2017-07-19 21:24:08 +02:00
Carlos Garnacho
d220e353e0 ui: Implement "window doesn't respond" dialog on gnome-shell
This does allow us to use ClutterActors instead of lousy legacy tools
meant for shell scripting.

https://bugzilla.gnome.org/show_bug.cgi?id=762083
2017-07-16 19:28:57 +02:00
Alessandro Bono
330a28742f shell-util: Fix a typo 2017-07-14 23:38:52 +02:00
Florian Müllner
bcec9f35d5 util: Wrap g_regex_escape_string() 2017-07-14 22:40:25 +02:00
Marco Trevisan (Treviño)
4c2fd513f4 shell-util: ensure we've a valid n_captures when capturing images
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 21:01:48 +08:00
Jonas Ådahl
b099e9a69c shell-util: Fix capturing scaled views
libmutter-clutter fixed stage capturing when views are scaled, and for
that to work properly when compositing the screenshot, we need to deal
with the cairo device scale here too.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 21:01:48 +08: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
60e7db7126 st-icon: Remove unused fields
They were set but then never accessed.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 21:01:48 +08:00
Florian Müllner
d1c71fd00d st: Don't try to create shadow for empty texture
Even though the API documentation doesn't say so, the underlying
Cogl texture of a ClutterTexture may be unset, so check for that
case to avoid a runtime warning.

https://bugzilla.gnome.org/show_bug.cgi?id=784353
2017-07-05 17:10:07 +02:00
Sebastian Keller
a0140fb2c7 calendar-server: Specify the timezone for the view query
Otherwise UTC is used which results in a different interpretation of
floating time events. This then could lead to a mismatch with events
generated e_cal_client_generate_instances_sync() which always uses the
default timezone. Such a mismatch would then cause constant invalidation
and reloading.

https://bugzilla.gnome.org/show_bug.cgi?id=781950
2017-06-16 17:13:50 +02:00
Mario Sanchez Prada
6ed7034a6b st-entry: Add support for a "hint actor"
This allows a full ClutterActor to be used as hint in the entry, instead
of a simple string.

The string case has been now re-implemented on top of the hint actor.

https://bugzilla.gnome.org/show_bug.cgi?id=783484
2017-06-14 14:00:57 -07:00
Cosimo Cecchi
4e07d0b073 st-entry: don't possibly allocate actors a negative size
Clutter will complain about this, so protect the code against such edge
case.

https://bugzilla.gnome.org/show_bug.cgi?id=783484
2017-06-14 14:00:57 -07:00
Mario Sanchez Prada
8783654b38 st-entry: Add support for the text-shadow CSS property
It's supported everywhere else, we should also support it here.

https://bugzilla.gnome.org/show_bug.cgi?id=783484
2017-06-14 14:00:57 -07:00
Cosimo Cecchi
9e0e7a4067 st-im-text: don't require st_im_text_set_event_window() to be called
Tests like tests/interactive/entry.js don't call it; make sure we still
display an entry in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=783484
2017-06-14 13:59:09 -07:00
Cosimo Cecchi
a256a35779 st-entry: don't assume a cursor func has been set
That won't be the case when called from tests.

https://bugzilla.gnome.org/show_bug.cgi?id=783484
2017-06-14 13:59:04 -07:00
Cosimo Cecchi
d5cac6559d st: initialize static variables to NULL
https://bugzilla.gnome.org/show_bug.cgi?id=783484
2017-06-14 13:58:58 -07:00
Cosimo Cecchi
02a72b12bb st-entry: remove unused variable 2017-06-06 14:52:33 -07:00
Mario Sanchez Prada
7f7d18749e st-entry: Add primary-icon and secondary-icon read-write properties
Instead of simply providing a setter, we now provide real properties.

https://bugzilla.gnome.org/show_bug.cgi?id=783484
2017-06-06 14:51:49 -07:00
Matt Watson
2e1e00c3de st: fix "text-shadow: none" to correctly draw no shadow
We would incorrectly create a solid black st-shadow with no blur when
parsing in a "none" value from css.

https://bugzilla.gnome.org/show_bug.cgi?id=783485
2017-06-06 12:40:48 -07:00
Cosimo Cecchi
e2838a7e06 Remove an explicit destroy to the ClutterText actor
This is the same as the previous commit, but for StEntry.
We don't have any need to explicitly destroy this actor in our dispose
implementation, and doing so breaks the assumption that we can access
the clutter_text from within destroy.

https://bugzilla.gnome.org/show_bug.cgi?id=783483
2017-06-06 08:38:45 -07:00
Cosimo Cecchi
ad2cb22785 Remove dangerous explicit destroy
There's no need to explicitly destroy the ClutterText actor inside the
label; doing so is actually harmful, as it will break the normal
reference cycle between container and children.
As StLabel doesn't hold any extra reference to the ClutterText actor and
just uses clutter_actor_add_actor() to add it to itself, let the normal
container dispose cycle run to dispose of the reference.

https://bugzilla.gnome.org/show_bug.cgi?id=783483
2017-06-06 08:38:45 -07:00
Florian Müllner
31a4705789 build: Stop building a separate libgnome-shell-base
The static library was split out to avoid duplicate compilation
of mutter-independent libgnome-shell sources when we had a
wayland/non-wayland split. With the separate libmutter-wayland
library long gone, there's no reason to make the build more
complicated than it needs to be, so fold libgnome-shell-base
back into the regular libgnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=783206
2017-05-30 12:41:16 +02:00
Florian Müllner
e7bf23890b build: Drop check for gjs-console
Nowadays all javascript code is run via small C-wrappers ...

https://bugzilla.gnome.org/show_bug.cgi?id=783206
2017-05-30 12:41:16 +02: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
Florian Müllner
6b3c9539f6 st: Fix doc comment
The trailing colon breaks recent versions of gtk-doc, so drop it.
2017-05-24 23:39:51 +02:00
Michael Biebl
a55599a239 Switch to stable libsecret API
Most of the libsecret API was declared stable in 0.18 and the stable API
now provides everything we need, so switch from libsecret-unstable to
libsecret-1.

https://bugzilla.gnome.org/show_bug.cgi?id=782637
2017-05-21 04:49:11 +02:00
Florian Müllner
94a0ae1ec3 entry: Fix *-icon-clicked handler
Commit ffe4eaf00d broke the handler by fetching the instance private
from the wrong actor - as we don't use the ::primary-icon-clicked signal,
and the ::secondary-icon-clicked signal still works by accident, nobody
noticed until now ...

https://bugzilla.gnome.org/show_bug.cgi?id=782190
2017-05-05 00:38:54 +02: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
Carlos Garnacho
44e80f4c46 st-texture-cache: Plug some pixbuf refcount leaks on async operations
When extracting the sliced image, the GTask grants data ownership on
g_task_propagate_*, so the pixbuf list must be properly freed. On async
load, we just left a dangling reference when returning on the async
task.

https://bugzilla.gnome.org/show_bug.cgi?id=642652
2017-04-07 14:17:59 +02:00
Bastien Nocera
65d93eacd3 gvc: Fix some memory leaks 2017-04-06 15:19:36 +02:00
Florian Müllner
b477d215a8 st: Add missing %NULL check
st_theme_node_get_border_image() may return %NULL, leading to a
segfault in st_border_image_get_file() when glib is compiled with
G_DISABLE_CHECKS.

https://bugzilla.gnome.org/show_bug.cgi?id=780381
2017-03-22 18:51:51 +01:00
Florian Müllner
5de85c708f calendar-server: Remove unused variables and function
The code that used them was removed in commit 7e0e224e0e.

https://bugzilla.gnome.org/show_bug.cgi?id=780381
2017-03-22 18:51:51 +01:00
Florian Müllner
2d814bfc5e main: Remove telepathy-specific log handling
The built-in telepathy integration is far less prominent than it
used to be, and doesn't really justify a link time dependency to
send debug message over D-Bus.

https://bugzilla.gnome.org/show_bug.cgi?id=771721
2017-03-10 17:10:52 +01:00
Florian Müllner
8f8e512b37 main: Use GBusNameOwnerFlags to specify flags
We are still using DBUS_NAME_FLAG_REPLACE_EXISTING from dbus-glib
in some places (whose headers are drawn in via telepathy-glib).
As both GIO and dbus-glib use the values that will end up being
sent on the bus, the define and enum value are interchangeable,
but it's clearly better to consistently use the library that is
explicitly included.

https://bugzilla.gnome.org/show_bug.cgi?id=771721
2017-03-10 17:10:52 +01:00
Florian Müllner
3c828c8387 shell: Remove TpClient
With the telepathy component now being implemented purely in JS, we
can drop the C helper class.

https://bugzilla.gnome.org/show_bug.cgi?id=771721
2017-03-10 17:10:52 +01: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
Piotr Drąg
649d360289 Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772210
2017-02-16 02:07:14 +01:00
Jonas Ådahl
a46ea3f8a0 Use the versioned libmutter*.so versions
Mutter now provides versioned libraries and pkg-config files, meaning
an application using libmutter and friends need to depend on a specific
version of the API.

https://bugzilla.gnome.org/show_bug.cgi?id=777317
2017-02-14 11:23:09 +08:00
Philip Chimento
d017e6749c main: Destroy GjsContext before exit
Here are a few places where I missed it before: the GjsContext must be
unrefed before exiting, or it will crash on exit.

https://bugzilla.gnome.org/show_bug.cgi?id=778425
2017-02-10 13:19:01 -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
Florian Müllner
a870a4d6de widget: Only include visible actors in focus chain
It isn't useful to move the keyboard focus to a hidden actor, so
only include visible actors in the focus chain - this is in fact
the documented behavior of st_widget_get_focus_chain(), so having
the default implementation return all children has always been
unexpected.

https://bugzilla.gnome.org/show_bug.cgi?id=778158
2017-02-08 14:50:36 +01:00
Florian Müllner
e6e786a19c st-theme-node: Fix lookup of time values
We have a time when the content type is seconds *or* milliseconds,
not seconds *and* milliseconds. Whoops ...

https://bugzilla.gnome.org/show_bug.cgi?id=778145
2017-02-06 14:30:18 +01:00
Adrian Perez de Castro
5136369c18 Properly detect changes in .desktop files
This fixes the shell not picking updates to the contents of the underlying
.desktop files for application launchers, or when a .desktop file is
overriden by a user-installed one under ~/.local/share/applications

https://bugzilla.gnome.org/show_bug.cgi?id=773636
2017-01-23 17:25:39 -06:00
Jonas Ådahl
c131c44ef6 gtk-embed: Don't try to compare with unrealized window
After having embedded a Gtk window, we start to listen for the
corresponding MetaWindow to know when it has been mapped by the
compositor. If the embedder does not realize the window immediately,
and some other window is created and mapped before the embedder
realizes the window, we would prior to this patch try to dereference
the not created GdkWindow. Fix this by NULL checking the GdkWindow
before dereferencing. We will never miss the needed MetaWindow creation
since it can not have been mapped have it not yet been realized.

https://bugzilla.gnome.org/show_bug.cgi?id=776130
2016-12-15 19:42:48 +08:00
Philip Chimento
dc110db4e0 tests: Destroy GjsContext before exit
This will be required in the upcoming version of GJS.

https://bugzilla.gnome.org/show_bug.cgi?id=775374
2016-12-09 18:50:39 -08: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
Philip Chimento
56b20ef779 helpers: Destroy GjsContext before exit
This will be required in the upcoming version of GJS.

https://bugzilla.gnome.org/show_bug.cgi?id=775374
2016-12-07 11:34:15 -08:00
Rui Matos
68b671a4f4 shell-wm: Add a size-changed signal to handle the new plugin vfunc
https://bugzilla.gnome.org/show_bug.cgi?id=770345
2016-11-23 18:42:59 +01:00
Florian Müllner
1de1fd44c5 texture-cache: Warn when loading sliced image fails
Sliced images are loaded into a group actor with one child actor
per slice. In case loading the image fails, we currently quietly
return the empty group actor, which makes diagnosing problems
unnecessarily hard - just be a bit more verbose on failure.

https://bugzilla.gnome.org/show_bug.cgi?id=774805
2016-11-22 18:38:10 +01:00
Jonh Wendell
2812afed22 gnome-shell-extension-tool: Add a reload option
This might be a good fit for extension developers: With
this option one doesn't need to restart the whole Shell
in order to see their changes in effect.

https://bugzilla.gnome.org/show_bug.cgi?id=772593
2016-10-28 15:41:32 -02:00
Bastien Nocera
39a840e2c3 shell-app: Add "discrete_gpu" option when launching apps
And adapt existing callers to the new API. This will allow us to
implement a way to launch applications on the discrete GPU for systems
where an "Optimus" system exists.

https://bugzilla.gnome.org/show_bug.cgi?id=773117
2016-10-21 19:26:49 +02:00
Philip Chimento
ed99bef458 extensionUtils: Remove ShellJS library
You can define a new importer object by importing a subdirectory in GJS.
This is undocumented, but it is likely to at least hold until the whole
thing moves to ES6 modules, after which we'll be able to do this purely
in JS with Reflect.Loader.

Since this was the only thing the ShellJS library did, we can remove it
altogether.

This allows us to discontinue use of the gjs-internals-1.0 embedder API.

https://bugzilla.gnome.org/show_bug.cgi?id=772386
2016-10-17 12:36:16 -07:00
Florian Müllner
0c22a21a24 window-tracker: Consider Flatpak ID for window matching
Our window matching currently fails frequently with Flatpak
applications, as one of the primary hints used to link windows
with .desktop files - the WM_CLASS - no longer matches when
flatpak renames the exported .desktop file. Worse, as Flatpak
applications are run in their own PID namespace, different
apps frequently share a common _NET_WM_PID, resulting in
unrelated apps being grouped together by one of the fallback
paths. To match Flatpak applications reliably, take the newly
exported Flatpak ID into account.

https://bugzilla.gnome.org/show_bug.cgi?id=772615
2016-10-10 23:40:39 +02:00
Carlos Garnacho
a22e9ce9cd st: Ignore filtered selection events not meant to our clipboard window
Other windows like the mutter Xwayland selection bridges might deal with
the clipboard, which would result in events visible on st-clipboard event
filters.

In order to avoid unintended results, ignore events that are not meant for
the clipboard window.

https://bugzilla.gnome.org/show_bug.cgi?id=760745
2016-10-09 10:57:47 +02:00
Philip Chimento
f00826f3fb shell-js: Remove usage of deprecated API
This removes all usage of SpiderMonkey API that is deprecated in mozjs24
and will be removed in mozjs31.

https://bugzilla.gnome.org/show_bug.cgi?id=742249
2016-09-27 17:14:47 -07:00
Florian Müllner
3cd8dd0f32 global: Fix a small memory leak 2016-09-21 23:38:42 +02:00
Rui Matos
ff814df03a shell-screenshot: Avoid a crash when the cursor texture is NULL
Analogously to commit 2a7f9f70b8 for the
screen recorder, as a wayland compositor, the cursor texture might not
exist.

https://bugzilla.gnome.org/show_bug.cgi?id=771656
2016-09-19 22:41:51 +02:00
Florian Müllner
373ebb50eb Restore gvc submodule
Commit 68f439425b accidentally dropped the changes from the last
couple of months ...
2016-09-11 19:20:00 +02:00
Fran Dieguez
68f439425b Updated Galician translations 2016-09-11 00:35:39 +02:00
Olivier Fourdan
0b6c5b4620 systray: Bail out if the plug window is gone
Instead of crashing when deferencing a NULL pointer.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=755313
2016-09-08 12:08:02 +02:00
Jonas Ådahl
f9ef80749a recorder: Composite captured images before passing into gstreamer
Mutter may capture the screen in multiple capture regions. If this is
done, take these images and composite them onto one large image, which
is then passed into the gstreamer source.
2016-09-06 15:22:23 +08:00
Jonas Ådahl
22f0d3076e screenshot: Composite multiple captures into one image
When clutter gives us multiple captures (multiple cairo_surface_t's),
composite them into one large image and use that as final screenshot
result. This makes screenshooting work when mutter uses multiple views.

https://bugzilla.gnome.org/show_bug.cgi?id=770128
2016-09-06 15:22:23 +08:00
Timm Bäder
d658a5148a recorder: Print absolute path if output file can't be opened 2016-08-20 16:03:31 +02:00
Piotr Drąg
6e3bedb888 Add translator comments to .desktop files 2016-08-19 23:15:20 +02:00
Florian Müllner
795e7d4b59 build: Say good-bye to intltool
intltool is unmaintained nowadays while upstream gettext gained
support for formats like GSettings schemas and .desktop files,
and offers a mechanism to teach it about other XML formats not
yet supported out of the box which we can use for the rest.
So there's nothing stopping us, just make the switch ...

https://bugzilla.gnome.org/show_bug.cgi?id=769074
2016-08-19 22:13:14 +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
Carlos Garnacho
284cbf3ea7 shell: Remove shell_util_text_insert_keyval()
It is now unused.
2016-08-10 11:25:50 +02:00
Florian Müllner
6e0e37519d calendar-server: Add back missing return value
In commit 7e0e224e0, when moving from e_cal_recur_generate_instances()
to e_cal_client_generate_instances(), the return value of the
ECalRecurInstanceFn callback was accidentally removed; add it
back.

https://bugzilla.gnome.org/show_bug.cgi?id=769156
2016-07-25 18:55:22 +02:00
Jonas Ådahl
f5c058a036 Use clutter_stage_capture instead of cogl's read_pixels
There is no longer any guarantee that there'll be one single
framebuffer to read pixels from. In order to still read pixels from the
stage, use the new clutter_stage_capture API.

https://bugzilla.gnome.org/show_bug.cgi?id=768979
2016-07-20 14:15:32 +08:00
Florian Müllner
2f0039e7dd app: Add a construct-only app-info property
This will allow us to create a ShellApp from JS code, for instance
for .desktop files that aren't known to the AppSystem.

https://bugzilla.gnome.org/show_bug.cgi?id=762206
2016-07-13 01:28:13 +02:00
Florian Müllner
7e0e224e0e calendar-server: Use the actual recurrence ID of events
Instead of querying the client for a list of objects and using
e_cal_recur_generate_instances() to get occurrences for each of
them, we can use e_cal_client_generate_instances_sync() which
combines the functionality of both functions. This doesn't only
save us some lines of code (yay!), but also gives us access to
the real recurrence ID of an event, so we can get rid of the hack
of faking one.

https://bugzilla.gnome.org/show_bug.cgi?id=748226
2016-07-08 18:05:58 +02:00
Florian Müllner
35825cf0c7 calendar-server: Get recurrence ID from occurrences
We use the triplet of source ID, UID and recurrence ID to create
an ID to unambiguously identify an event, which we use to implement
hiding dismissed events from the calendar. However we currently
try to fetch the recurrence ID from the objects returned by
e_cal_client_get_object_list_sync(), which are always the primary
events with no recurrence ID. Instead, we need a recurrence ID
associated with each occurrence.

https://bugzilla.gnome.org/show_bug.cgi?id=748226
2016-07-08 18:05:57 +02:00
Florian Müllner
b2d79b6362 calendar-server: Fetch default zone from client
We are already setting the default zone on the client, no need
to pass it around.

https://bugzilla.gnome.org/show_bug.cgi?id=748226
2016-07-08 18:05:57 +02:00
Florian Müllner
f5e1dc86cd calendar-server: Fix a memory leak
App will take ownership of the location string when the timezone
changes, but not when there was no change - free the memory in
that case.

https://bugzilla.gnome.org/show_bug.cgi?id=748226
2016-07-08 18:05:57 +02:00
Florian Müllner
8c51f0076f calendar-server: Minor optimization
We use the same query string for all sources, so no need to
allocate/free it on each loop iteration.

https://bugzilla.gnome.org/show_bug.cgi?id=748226
2016-07-08 16:11:43 +02:00
Florian Müllner
61070e6ec0 calendar-server: Remove an unnecessary check
calendar_appointment_new() never returns %NULL, so no need to check
for it.
2016-07-07 15:54:57 +02:00
Owen W. Taylor
c4584c20dc run-js-test: fix running in hi-dpi mode 2016-06-30 14:17:19 -04:00
Rui Matos
2a7f9f70b8 shell-recorder: Avoid a crash when the cursor texture is NULL
When running as a wayland compositor, MetaCursorTracker might
legitimately not have a displayed cursor because e.g. a client unsets
the cursor surface.

Note that, under an X session, the assumption that the tracker always
has a cursor texture is true because XFixesGetCursorImage() always
returns data even if the cursor isn't visible.

https://bugzilla.gnome.org/show_bug.cgi?id=767001
2016-06-28 19:03:33 +02:00
Rui Matos
c91085caf7 shell-recorder: Ensure we remove the redraw timeout on finalize
Otherwise we may end up using freed memory and crashing

https://bugzilla.gnome.org/show_bug.cgi?id=767001
2016-06-28 19:03:32 +02:00
Rui Matos
3e93a1bdd6 StShadowHelper: properly use the actor's box to paint the shadow
We're using an unitialized box resulting in an undefined shadow box
size.

_st_paint_shadow_with_opacity() already computes the shadow's bounding
box from the source actor's box so we just need to pass that along.

https://bugzilla.gnome.org/show_bug.cgi?id=767954
2016-06-23 18:57:02 +02:00
Hans Petter Jansson
72bfa91259 theme-node: Fix leak on stylesheet change.
on_custom_stylesheet_changed() would set properties_computed to FALSE
without freeing the old properties, then the properties pointer would
be overwritten in ensure_properties().

https://bugzilla.gnome.org/show_bug.cgi?id=710230
2016-06-12 00:57:18 +02:00
Martin Szulecki
5226d8b086 st: Init framebuffer early to fix gnome-shell crash on NVIDIA drivers
Checking offscreen for COGL_INVALID_HANDLE is not sufficient,
as cogl_offscreen_new_with_texture doesn't initialize framebuffer
objects but lets Cogl solve this the lazy way.
cogl_offscreen_new_with_texture will never return COGL_INVALID_HANDLE
anyways.

https://bugzilla.gnome.org/show_bug.cgi?id=764898
2016-05-17 15:00:04 +02:00
Florian Müllner
387f5143f0 st: Use case-insensitive shortcuts
For shortcuts that involve a letter (like <ctrl>c), we currently only
accept the lower-case variant. This makes shortcuts awkward to use when
caps-lock is active, and is inconsistent with GTK+, so accept upper-case
variants as well.

https://bugzilla.gnome.org/show_bug.cgi?id=766325
2016-05-12 18:10:04 +02:00
Florian Müllner
b7867fe44c build: Set rpath on more executables
We need to point executables to our private cogl/clutter forks.
Commit 093fd54e2 did this for the main executable, but forgot
the extension-prefs tool and other helpers.
2016-05-12 18:10:04 +02:00
Florian Müllner
84da49c715 app: Consider minimized windows for app comparisons
We used to take window visibility into account when comparing apps
until commit 1dfc38d078, following changes in the window switcher
due to auto-minimization. However auto-minimization was abolished
and the window switcher changes reverted, so it makes sense again
to sort apps without non-minimized windows last again.

https://bugzilla.gnome.org/show_bug.cgi?id=766238
2016-05-10 21:36:33 +02:00
Florian Müllner
093fd54e2b build: Point executables to our private lib path
We now link to cogl/clutter forks in a private location, so make
sure we set the rpath of executables to point the runtime linker
to the correct location.
2016-04-28 19:35:05 +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
Florian Müllner
c97626e516 Update gvc submodule
https://bugzilla.gnome.org/show_bug.cgi?id=765607
2016-04-26 15:47:29 +02:00
Florian Müllner
8416ba25de st: Don't assert when corner texture creation fails 2016-04-15 19:05:04 +02:00
Florian Müllner
63f6ff9151 Do not skip CoglError parameters
While CoglError is a define to GError, it doesn't follow the convention
of ignoring errors when NULL is passed, but rather treats the error as
fatal :-(
That's clearly unwanted for a compositor, so make sure to always pass
an error parameter where a runtime error is possible

https://bugzilla.gnome.org/show_bug.cgi?id=765061
2016-04-15 18:22:18 +02:00
Florian Müllner
59c2ace98c st: Do not try to unref NULL CoglObjects
https://bugzilla.gnome.org/show_bug.cgi?id=765061
2016-04-15 18:22:18 +02:00
Florian Müllner
c039a3ddda recorder: Fall back to ~ if XDG_VIDEOS_DIR doesn't exist
Unlike screenshots, recordings fail when the default directory doesn't
exist. Fall back to home instead.

https://bugzilla.gnome.org/show_bug.cgi?id=765015
2016-04-13 21:25:31 +02:00
Aaron Plattner
941513b280 st: Fix offscreen leak if cogl_framebuffer_allocate fails
If cogl_framebuffer_allocate fails in _st_create_shadow_pipeline_from_actor, the
CoglOffscreen* that was allocated earlier in the function is leaked.

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

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2016-03-30 15:59:10 -04:00
Ting-Wei Lan
1de288c5bb build: Fix build with clang -Werror
https://bugzilla.gnome.org/show_bug.cgi?id=755659
2016-02-26 02:06:55 +08:00
Michael Catanzaro
508668107b st-entry: Disable middle-click-paste when entry is not editable
Should only allow pasting the primary selection when the entry is
editable.

https://bugzilla.gnome.org/show_bug.cgi?id=762507
2016-02-23 06:48:50 -06:00
Florian Müllner
00814dd159 shell: Fix another indentation warning
The compiler doesn't know about preprocessor conditionals, so indentation
changes confuse -Wmisleading-indentation.
2016-02-16 18:05:14 +01:00
Florian Müllner
57f9ffcaa7 shell: Fix an indentation issue ...
...pointed out by GCC's new -Wmisleading-indentation warning.
2016-02-16 17:35:39 +01:00
Florian Müllner
ce83f378a5 shell: Fix coding style 2016-02-16 17:35:39 +01:00
Lubomir Rintel
346ffd14d7 NetworkAgent: correctly identify the VPN secret requests
The non-interactive requests for 'vpn' settings are forwarded to the UI because
it is able to talk to the auth helpers. However, the VPN requests are identified
by the connection type instead of setting type. That is incorrect and the UI
is not prepared to handle such requests; tries to construct a dialog and fails
miserably:

  Gjs-Message: JS LOG: Invalid connection type: vpn

  (gnome-shell:13133): Gjs-WARNING **: JS ERROR: Error: No property 'text' in property list (or its value was undefined)
  NetworkSecretDialog<._init@resource:///org/gnome/shell/ui/components/networkAgent.js:60
  wrapper@resource:///org/gnome/gjs/modules/lang.js:169
  _Base.prototype._construct@resource:///org/gnome/gjs/modules/lang.js:110
  Class.prototype._construct/newClass@resource:///org/gnome/gjs/modules/lang.js:204
  NetworkAgent<._handleRequest@resource:///org/gnome/shell/ui/components/networkAgent.js:724
  wrapper@resource:///org/gnome/gjs/modules/lang.js:169
  NetworkAgent<._newRequest@resource:///org/gnome/shell/ui/components/networkAgent.js:715
  wrapper@resource:///org/gnome/gjs/modules/lang.js:169

https://bugzilla.gnome.org/show_bug.cgi?id=760999
2016-01-26 17:31:34 +01:00
Rui Matos
c25c143b24 st-widget: Avoid passing NULL to atk_object_get_role()
This never worked since the code landed but apparently no-one noticed
until now.

The intent here is to return the accessible's default role if none has
been explicitly set on the StWidget instance.

https://bugzilla.gnome.org/show_bug.cgi?id=760945
2016-01-21 16:49:06 +01:00
Rui Matos
b87da87252 st-widget: Fix a potentially infinite recursion
Commit ffe4eaf00d changed this code to
call st_widget_get_accessible_role() instead of using the value
directly which would be an infinite recursion if that function didn't
have a bug. As it is, this just resulted in

CRITICAL **: atk_object_get_role: assertion 'ATK_IS_OBJECT
(accessible)' failed

https://bugzilla.gnome.org/show_bug.cgi?id=760945
2016-01-21 16:49:05 +01:00
Christophe Fergeau
021cecbce2 NetworkAgent: Fix double-unref in get_secrets_keyring_cb()
In get_secrets_keyring_cb, we own a ref on the 'attributes' hash table
from secret_item_get_attributes), and a ref on the 'secret' object (from
secret_item_get_secret(), but in the SHELL_KEYRING_SK_TAG case, we unref
these once before breaking out of the loop, and the second time after
breaking out of the loop.

https://bugzilla.gnome.org/show_bug.cgi?id=759708
2016-01-07 15:27:42 +01:00
Florian Müllner
03bf6fa399 theme-node: Use the correct framebuffer in paint_* methods
Since commit 48a54e8ac4, paint() has an explicit framebuffer parameter,
however a couple of submethods are still using the draw framebuffer,
which breaks when rendering to an offscreen buffer.
2015-11-19 14:08:14 +01:00
Florian Müllner
f777e761c0 st: Fix some more cogl deprecations
Replace the remaining cogl_set_source* calls with the explicit
pipeline/framebuffer API.
2015-11-19 14:07:24 +01:00
Florian Müllner
9a7b47c23f st: Fix Gaussian kernel calculation
The result of subtracting unsigned operands is unsigned, which throws
off our calculation in case it should be negative.

This partly reverts 18b6f13395.

https://bugzilla.gnome.org/show_bug.cgi?id=757779
2015-11-12 01:02:05 +01:00
Florian Müllner
c634718dfa shell: Fix crash in polkit agent
The polkit agent does not take ownership of the request's cancellable,
so it may no longer be valid after the request finished and we need
to disconnect it before that. Before the GTask port in 8b4249ef2,
it was safe to do that when freeing the request data because requests
completed in an idle, but now we need to do it before returning the
task result.

https://bugzilla.gnome.org/show_bug.cgi?id=757668
2015-11-10 11:56:37 +01:00
Kalev Lember
df0b465e76 StTextureCache: Fix a fallout from GTask port
Set the task data that load_pixbuf_thread func expects.

https://bugzilla.gnome.org/show_bug.cgi?id=757418
2015-11-01 00:27:35 +01:00
Owen W. Taylor
8b7464c648 st_theme_node_prerender_shadow: guard against failure to allocate a texture
If we are trying to render a shadow at a size that is very large in one
direction, but small in the other direction (so that we don't 9-slice
the texture), then allocating the backing texture for the offscreen
buffer may fail due to texture-size limits. Don't crash in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=757150
2015-10-27 15:51:40 -04:00
Owen W. Taylor
6d22670307 Defend against failure of cairo_pattern_get_surface()
There are quite a few crashes in retrace.fedoraproject.org that are a result of
of cairo_pattern_get_surface() failing, then a subsequent call to
cairo_image_surface_get_width() crashing because no surface was returned to the
out parameter. Knowing what causes these is hard - my best guess is widgets getting
allocated at ridiculous sizes - but avoiding the crash makes sense in any case.

See https://bugzilla.redhat.com/show_bug.cgi?id=1206754

https://bugzilla.gnome.org/show_bug.cgi?id=756983
2015-10-22 15:14:55 -04: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
Florian Müllner
48a54e8ac4 theme-node: Pass an explicit framebuffer to paint()
This allows us to paint to an offscreen buffer without using the
deprecated cogl_push_framebuffer/cogl_pop_framebuffer functions.
2015-10-16 00:16:38 +02:00
Florian Müllner
113a854048 st: Rename *material to *pipeline
... since the last commit changed the type from CoglMaterial to
CoglPipeline.
2015-10-15 23:42:19 +02:00
Florian Müllner
882f5fa79e st: Fix a bunch of cogl deprecations 2015-10-15 23:05:11 +02:00
Florian Müllner
9acdb8012c tray: Get rid of deprecation warnings
gdk_window_set_composited() is deprecated, and we don't need it as
we end up setting it to the default anyway.
We do need gtk_widget_set_double_buffered() though, which has been
deprecated as well because it is only meaningful on X11 - but so
is XEmbed, so just shut up that warning.
2015-10-15 23:05:11 +02:00
Florian Müllner
731d64e0e4 tray: Don't use gdk_display_supports_composite()
Composite is a hard requirement for mutter's compositor, so if we get
to the point of managing the tray, we already know that the extension
is supported. So let's get rid of yet another deprecation warning.
2015-10-15 23:05:11 +02:00
Florian Müllner
ccf1bd9f27 tray-manager: Don't use GdkColor
It has been deprecated for a while in favor of GdkRgba, though in our
case translating ClutterColors to an intermediate color type before
setting _NET_SYSTEM_TRAY_COLORS is a bit silly, so just move to
ClutterColor as the rest of the code base.
2015-10-15 23:05:11 +02:00
Florian Müllner
c164a8fe03 st: Use ClutterCanvas for StDrawingArea
Stop chasing down cogl deprecations by delegating all texture
handling to a ClutterCanvas.
2015-10-15 23:01:11 +02:00
Florian Müllner
1a39666f7c shell: Port to GTask 2015-10-15 22:59:49 +02:00
Florian Müllner
f2731d4d6a st: Port to GTask
GSimpleAsyncResult has been deprecated for a while.
2015-10-15 22:59:48 +02:00
Florian Müllner
3e63fb7abe Port screenshot to GTask 2015-10-15 22:59:48 +02:00
Florian Müllner
8b4249ef26 Port polkit agent to GTask 2015-10-15 22:59:48 +02:00
Florian Müllner
bf0be6ef12 hotplug-sniffer: Port to GTask
GSimpleAsyncResult is deprecated.
2015-10-15 22:59:48 +02:00
Florian Müllner
294702d3f1 shell: Use G_DECLARE_*_TYPE macros
Cut down on boilerplate by using the (no longer that) new helper
macros. We don't care about breaking ABI in private libraries, so
use G_DECLARE_FINAL_TYPE even where the class struct used to be
exposed in the header, except for types we inherit from ourselves
(obviously) or where the class exposes any vfuncs (where changes
could affect inheritance in extensions).
2015-10-15 22:58:28 +02:00
Florian Müllner
58f3b7c748 shell: Drop questionable vfuncs
Both ShellAppSystem and ShellTrayManager are used as singletons, which
significantly reduces the usefulness of inheritance - it's unlikely for
extensions to inherit from them anyway (AND use any of the vfuncs), so
drop them to allow defining the types as final in an upcoming commit.
2015-10-15 22:13:18 +02:00
Florian Müllner
e25502aeb2 shell: Use G_DEFINE_TYPE_WITH_PRIVATE() and friends 2015-10-15 22:03:06 +02:00
Florian Müllner
ffe4eaf00d st: Use G_DECLARE_*_TYPE
Cut down on boilerplate by using the (no longer that) new helper
macros. We don't care about breaking ABI in private libraries, so
use G_DECLARE_FINAL_TYPE even where the class struct used to be
exposed in the header, except for types we inherit from ourselves
(obviously) or where the class exposes any vfuncs (where changes
could affect inheritance in extensions).
2015-10-15 22:02:35 +02:00
Florian Müllner
2f88a7a1e1 st: Drop vfuncs from StThemeNodeTransition
They are unused, as we don't use them ourselves and the class is not
exposed to introspection. Drop them to allow defining the type as final
in an upcoming commit.
2015-10-15 21:43:08 +02:00
Florian Müllner
cd7d564125 st: Use G_DEFINE_TYPE_WITH_PRIVATE() and friends 2015-10-15 21:05:22 +02:00
Florian Müllner
ede81017ec hotplug-sniffer: Modernize GObject usage 2015-10-15 21:04:07 +02:00
Florian Müllner
a539e6236a calendar-server: Modernize GObject usage 2015-10-15 21:04:07 +02:00
Florian Müllner
508e751ffd box-layout: Support replacing layout manager
There is nothing preventing callers from replacing the internal
layout manager, and as long as the replacement is a (or derives
from) ClutterBoxLayout, everything should work fine except for
losing a bit of automatic property mapping - and the latter is
easily fixable by moving the setup out of the constructor.

https://bugzilla.gnome.org/show_bug.cgi?id=708472
2015-10-15 19:21:15 +02:00
Cosimo Cecchi
207c847762 windowManager: add animations for fullscreen and unfullscreen
We use the newly introduced feature from Mutter to hook up our own
fullscreen and unfullscreen animations.
To give the illusion of a transition as smooth as possible, we create a
snapshot of the current contents of the actor before its state is
changed, and crossfade between the two states while the size changes.

https://bugzilla.gnome.org/show_bug.cgi?id=707248
2015-10-14 12:10:58 -04:00
Cosimo Cecchi
674ae262c8 Change incorrect parameter names
These were renamed a while ago.
2015-10-12 15:38:44 -04:00
Owen W. Taylor
db297e7fdb Don't crash on accesses to stale window-backed apps
The JS code could still be holding on to a reference to a window-backed app
after all windows have vanished. (For example, the dash queues an idle to
refetch apps and display them.) Avoid dying with an error message if we
attempt to activate or otherwise manipulate such a window.

https://bugzilla.gnome.org/show_bug.cgi?id=674799
2015-10-11 15:31:39 -04:00
Rui Matos
44047ac881 shell-glsl-quad: Set the pipeline blend string explicitly
The default pipeline color is opaque white and blending is turned
off. If we only draw with that color (e.g. because animations are
disabled and we're always drawn with opacity == 255), blending is kept
disabled since cogl_pipeline_set_color() returns early if the color
doesn't change from what was there before.

In our case we always want blending to be enabled which we can achieve
by setting the blending string ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=755827
2015-10-08 18:27:07 +02:00
Florian Müllner
464d5d8a13 st-button: Don't rely on hover to accept clicks
Since commit 4f1f226828 we only consider buttons clicked when the
release event had a corresponding press event. However as we use
the hover state to check whether a release event actually occurred
on the button, we dismiss any clicks in cases where we missed the
enter event - most likely due to some other actor holding a grab.
Instead, check whether the button contains the event's source, which
should be less error-prone.

https://bugzilla.gnome.org/show_bug.cgi?id=748919
2015-10-07 15:05:36 +02:00
Emmanuele Bassi
2036e4c85c st: Remove wrong indentation
GObject-Introspection started warning for wrong annotations, and
StGenericAccessible::set-current-value has a return value annotation
even if it returns nothing. This generates the warning:

src/st/st-generic-accessible.c:146: Warning: St:
StGenericAccessible::set-current-value: invalid return annotation

Which, coupled with fatal warnings, breaks the Shell build.
2015-10-05 12:04:55 +01:00
Matthias Clasen
18c7138237 Check error of g_dbus_proxy_new_sync call
Otherwise errors pile up and we crash later on.
2015-09-24 13:33:47 -04:00
Matthias Clasen
3f0fbae7e2 shell_dbus_acquire_name: Don't leak the result
The GVariant returned by g_dbus_proxy_call_sync must be
freed with g_variant_unref, to prevent a leak.
2015-09-24 13:33:47 -04:00
Matthias Clasen
7f1a258ff9 shell_dbus_acquire_name: Don't leak error
If fatal is not set, we return from this function in the error
case. Don't leak the GError if that happens.
2015-09-24 13:33:45 -04:00
Florian Müllner
84eda6e459 st: Don't avoid parameter list
Meh, C ...
2015-09-23 21:32:50 +02:00
Florian Müllner
f5e7530fc7 st: Add default case to switch statements 2015-09-23 21:32:50 +02:00
Florian Müllner
f983b34784 st: Handle all possible enum values in switch statements 2015-09-23 21:32:50 +02:00
Florian Müllner
36bbe64898 st: Fix constness in assignment 2015-09-23 21:32:50 +02:00
Florian Müllner
627a393ed6 st: Don't mix declarations and code 2015-09-23 21:32:50 +02:00
Florian Müllner
a025b151ef st: Don't shadow existing variables 2015-09-23 21:32:50 +02:00
Florian Müllner
18b6f13395 st: Fix signed-unsigned comparisons 2015-09-23 21:32:50 +02:00
Florian Müllner
051413550f st: Don't duplicate declarations from G_DEFINE_TYPE 2015-09-23 21:32:50 +02:00
Florian Müllner
3e10574736 shell: Add default case to switch statements
... to shut up a compiler warning.
2015-09-23 21:32:50 +02:00
Florian Müllner
9a3041004b shell: Don't shadow existing variables 2015-09-23 21:32:50 +02:00
Florian Müllner
87f71b8ce1 shell: Don't mix declarations and code 2015-09-23 21:32:50 +02:00
Florian Müllner
825146f1e3 shell: Fix signed-unsigned comparisons 2015-09-23 21:32:50 +02:00
Florian Müllner
52995416fd shell: Don't avoid parameter list
Meh, C ...
2015-09-23 21:32:50 +02:00
Florian Müllner
6c43d0247a main: Fix constness mismatches 2015-09-23 21:32:49 +02:00
Florian Müllner
9aa98d9f0c menutracker: Don't shadow existing variables 2015-09-23 21:32:49 +02:00
Florian Müllner
c3a29d6df1 theme-node: Rewrite switch statement
Some compilers warn about unhandled enum values in switch statements,
so don't use one where only two out of 21 possible values make sense.
2015-09-23 21:32:49 +02:00
Florian Müllner
82f84416a9 recorder: Rewrite switch statement
Avoid compiler warnings about unhandled enum values by using a
regular if-else statement.
2015-09-23 21:32:49 +02:00
Florian Müllner
9dd3162dbe recorder-src: Rewrite switch statement
Avoid compiler warnings about unhandled enum values by using a
regular if-else statement.
2015-09-23 21:32:49 +02:00
Florian Müllner
7ef519756a Update gvc submodule 2015-09-23 21:32:49 +02:00
Florian Müllner
444fa2e0ab calendar-server: Adjust to EDS service version bump 2015-08-10 17:30:38 +02:00
Florian Müllner
e92f43b83e shell: Fix C99'ism 2015-07-31 20:26:47 +02:00
Florian Müllner
fed79ce4e6 appDisplay: Handle non-UTF8 filename encodings more gracefully
It may be 2015, but users still stumble upon the occasional .desktop
file that uses a filename encoding other than UTF-8. We currently
fail quite spectacularly in that case by not displaying any apps at
all - handle this case more gracefully, by only filtering out the
offending apps.

https://bugzilla.gnome.org/show_bug.cgi?id=651503
2015-07-31 16:52:42 +02:00
Florian Müllner
c3e5d983b9 st: Replace deprecated key symbols 2015-07-22 16:00:56 +02:00
Florian Müllner
d21edcfed5 st: Replace deprecated macros 2015-07-22 16:00:55 +02:00