Commit Graph

1980 Commits

Author SHA1 Message Date
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