Commit Graph

529 Commits

Author SHA1 Message Date
Jasper St. Pierre
40b895d16b st-theme-node-drawing: Depend less on the paint state in some helper functions
We want to put the paint state in the actor rather than in the theme
node, as having two actors with different sizes but the same theme node
is now much less efficient.

https://bugzilla.gnome.org/show_bug.cgi?id=697274
2013-05-03 10:50:30 -04:00
Alban Browaeys
e96d9e0ea1 st-icon: check if gicon is null before unref.
Commit a6b49fe7d6
introduced a check for equality of priv->gicon vs gicon
and unref then return early if so. But if both are null,
we should not unref gicon. Only return.

https://bugzilla.gnome.org/show_bug.cgi?id=698863
2013-05-02 09:51:32 +02:00
Giovanni Campagna
ef9c50e63a StIcon: use g_signal_connect_object() for safety
Prevent a crash in case an icon is destroyed before the texture
finishes loading, and something else is keeping the texture alive
for any reason.

https://bugzilla.gnome.org/show_bug.cgi?id=696720
2013-04-29 00:19:59 +02:00
Jasper St. Pierre
c3775c0f56 st-theme-node: Disable transitions if animations-enabled is off
https://bugzilla.gnome.org/show_bug.cgi?id=698391
2013-04-19 14:34:06 -04:00
Florian Müllner
2b439ef209 theme-node: Add lookup_url/get_url() methods
Similar to the existing generic getter methods, add lookup functions
for URL properties like the standard background-image/border-image
properties.

https://bugzilla.gnome.org/show_bug.cgi?id=693688
2013-04-16 19:10:40 +02:00
Rui Matos
86c92c37d2 st-im-text: Override ClutterText's cursor_event to set cursor position
This is both more efficient and accurate than doing it from the paint
vfunc.

https://bugzilla.gnome.org/show_bug.cgi?id=697722
2013-04-10 17:27:28 +02:00
Giovanni Campagna
8b659f0f4c St: support -st-natural-width/height CSS properties
It is sometimes desirable to specify the size of a box from CSS without
changing the minimum-width too.
This property implements that.

https://bugzilla.gnome.org/show_bug.cgi?id=664411
2013-04-08 19:25:45 +02:00
Adel Gadllah
6ef9ab6a0b st-scroll-view-fade: Don't fade out gradient
The changes from commit b4f5f1e461 and b394d184cc increased the
instructions required for the fade fragment shader. This is over the limit
for some hardware (like intel gen3), which causes the driver to fallback
to software rendering for the shader. The result is that painting a scrollview
that has a fade effect takes around 30 (!!) seconds.

So lets go back to the old effect for 3.8 until we find a solution.

https://bugzilla.gnome.org/show_bug.cgi?id=696404
2013-03-22 19:56:13 +01:00
Adel Gadllah
45fc7ec01f st-scroll-view-fade: Don't use return in the shader
Returing from main() makes llvmpipe unhappy (produces black output color),
so rework the logic to avoid the return.

https://bugzilla.gnome.org/show_bug.cgi?id=695607
2013-03-14 22:43:14 +01:00
Adel Gadllah
a6b49fe7d6 st-icon: Don't cause a redraw by replacing the icon with itself
Check if the two icons match before setting a new icon, if they
do don't do anything.

Based on patch from Owen Taylor <otaylor@fishsoup.net>

https://bugzilla.gnome.org/show_bug.cgi?id=694988
2013-03-05 00:03:29 +01:00
Florian Müllner
b52f4ed25b st-entry: Disable cut/copy actions in password entries
Curently it is possible to copy the content of password entries,
and paste it elsewhere in clear text. This is undesirable, so
follow GTK+'s behavior and disable the cut/copy actions for
password entries.

https://bugzilla.gnome.org/show_bug.cgi?id=695104
2013-03-04 16:43:59 +01:00
Adel Gadllah
ea55c36a3a st-widget: Don't add hidden actors to the paint volume
We are not painting them anyway.
2013-03-01 19:13:22 +01:00
Florian Müllner
b394d184cc scroll-view-fade: Tweak easing at edges
Since commit b4f5f1e461, the effect is eased in at the scroll
view's edges so that it does not appear out of nowhere. However,
the linear easing used is not the best option, as now the effect
appears so late that content near the edges ends up just being
cut off rather than faded out.
So adjust the easing function to have the effect appear faster.

https://bugzilla.gnome.org/show_bug.cgi?id=694327
2013-03-01 17:30:01 +01:00
Florian Müllner
1bd8c67041 st-scroll-view: Add :overlay-scrollbars property
If enabled, scrollbars take away from the allocation given to the
view's content. This is usually preferrable to painting the bars on
top of the content, but there are exceptions, for instance when the
content needs to be centered with regard to the view as a whole.
Add a :overlay-scrollbars property to account for those cases.

https://bugzilla.gnome.org/show_bug.cgi?id=694261
2013-02-22 10:57:50 +01:00
Cosimo Cecchi
a4a5492782 st-bin: fix a typo in the property setter
This got unnoticed for more than 3 years!

https://bugzilla.gnome.org/show_bug.cgi?id=694234
2013-02-20 00:06:52 -05:00
Florian Müllner
5d275389af scroll-view-fade: Fix [vh]fade_offset property getters
The two were mixed up all along, and nobody noticed ...

https://bugzilla.gnome.org/show_bug.cgi?id=694125
2013-02-18 22:44:23 +01:00
Giovanni Campagna
5e87fea1ee StEntry: reset the cursor when unmapped
We cannot reset the cursor at the next leave event, as that might
happen on a NULL stage and cause a BadWindow error, so do it on
unmap (which is guaranteed to happen before the stage is cleared).

https://bugzilla.gnome.org/show_bug.cgi?id=694057
2013-02-18 18:08:57 +01:00
Jasper St. Pierre
7fc2b33a0a st-texture-cache: Use async variants of the icon loading API
While we were relying on gtk_icon_info_load_icon and friends being
thread-safe, there was no such guarantee, and recent caching that
was added to GTK+ made it non-threadsafe. To replace it, _async()
variants of the icon loading code were added that are thread-safe.
Use those instead of using our own worker threads.

https://bugzilla.gnome.org/show_bug.cgi?id=692845
2013-02-14 16:16:00 -05:00
Jasper St. Pierre
a5d3f7785a st-texture-cache: Add one simple way to free texture load data
https://bugzilla.gnome.org/show_bug.cgi?id=692845
2013-02-14 16:09:04 -05:00
Jasper St. Pierre
f1cdce38a6 st-texture-cache: Remove a no-op scale pixbuf
We already passed GtkIconTheme the size when it wanted to load it,
so it knows the desired size and will scale it to what we want.

https://bugzilla.gnome.org/show_bug.cgi?id=692845
2013-02-14 16:09:04 -05:00
Neil Roberts
777f145128 st-clipboard: Use GDK for the event filters instead of Clutter
Instead of using Clutter to add an event filter for X events it now
uses the GDK API. The Clutter API won't work if Clutter is not using
an X11-based backend such as if Mutter is directly running with the
KMS backend. This is a step towards making Mutter be its own display
server and a step towards being a Wayland compositor. In this case GDK
will still be using the X backend because it will connect to the
headless X server.

https://bugzilla.gnome.org/show_bug.cgi?id=693438
2013-02-11 09:48:45 +00:00
Adel Gadllah
a10a294a2e st-im-text: Remove unused variable
https://bugzilla.gnome.org/show_bug.cgi?id=693522
2013-02-10 13:39:30 +01:00
Neil Roberts
33f69481f7 Don't rely on implicit type conversion in the scroll view shader
Before version 1.2 of GLSL it would not implicitly convert from int to
float which meant that if you compare a float variable with an integer
constant it will generate a compile error. In particular this means
that on GLES2 (which uses GLSL 1.0) the scroll view shader will not
compile on pedantic compilers, which includes Mesa. This patch just
changes it to use floating point constants.

https://bugzilla.gnome.org/show_bug.cgi?id=693339
2013-02-08 12:03:38 +00:00
Jasper St. Pierre
eaf184b585 st-entry: Implement middle click paste
https://bugzilla.gnome.org/show_bug.cgi?id=645019
2013-02-07 04:51:30 -05:00
Jasper St. Pierre
0616261a94 st-clipboard: Add the ability to choose the clipboard type
https://bugzilla.gnome.org/show_bug.cgi?id=645019
2013-02-07 04:51:30 -05:00
Adel Gadllah
11bd7dc7de scroll-view-fade: Remove explicit GLSL version
Cogl sets this for us since commit 2701b93f159bf2d3387cedf2d06fe921ad5641f3.

Setting it twice is illegal and causes compile failures:
error C0204: version directive must be first statement and may not be repeated.
2013-02-05 20:32:08 +01:00
Giovanni Campagna
a8c8df6ee8 StImText: don't translate keyboard state again
Clutter translates keyboard state internally, and clears the lock bits
from modifier state, so translating again results in the wrong keysym.
Given that Clutter already gives us a fine keysym, we don't need this.

https://bugzilla.gnome.org/show_bug.cgi?id=692586
2013-02-03 16:45:28 +01:00
Florian Müllner
655dce6a4b st-theme-node: Recalculate properties on stylesheet changes
As theme nodes keep a cache of matched properties, we need to make
sure to update it when the list of stylesheets changes. In particular
this fixes a regression from commit dc2ec0a8f9, which caused
extensions with stylesheets to crash the shell when re-enabled (for
instances when coming back from the lock screen).

https://bugzilla.gnome.org/show_bug.cgi?id=692994
2013-02-01 17:28:40 +01:00
Florian Müllner
2cf403a3e9 st-theme: Add "custom-stylesheets-changed" signal
StThemeNodes cache matched properties from stylesheets, so when the
list of custom stylesheets changes, the node may miss better matches
(when a stylesheet was added) or have pointers to invalid memory in
the list (when a stylesheet was removed).
In order to allow theme nodes to listen for stylesheet changes, add
an appropriate signal to StTheme.

https://bugzilla.gnome.org/show_bug.cgi?id=692994
2013-02-01 17:28:39 +01:00
Cosimo Cecchi
426581eb1e scroll-view: reserve scrollbar allocation when policy is automatic
This is useful to avoid reflowing the layout when there's a
center-aligned block and a scrollbar appears.

https://bugzilla.gnome.org/show_bug.cgi?id=686881
2013-01-24 15:10:02 -05:00
Giovanni Campagna
8be3c5ed21 St: fix parsing of transition-duration values
According to css3-transition, transition-duration is expressed
as a time, that is, in seconds or milliseconds. Fix that by
recognizing numbers with units and implicitly converting to
milliseconds after parsing.

https://bugzilla.gnome.org/show_bug.cgi?id=681376
2013-01-03 03:47:58 +01:00
Jasper St. Pierre
4b095d532c st-texture-cache: Remove st_texture_cache_load_from_raw
This is now unused.

https://bugzilla.gnome.org/show_bug.cgi?id=691019
2013-01-02 12:32:29 -05:00
Rico Tzschichholz
52536e94e5 st-scroll-view: Fix build with -Werror=maybe-uninitialized 2012-12-20 23:01:13 +01:00
Rico Tzschichholz
5d6b3abd26 st-adjustment: Add missing math.h include 2012-12-20 23:01:13 +01:00
Jasper St. Pierre
f162dd7e87 scroll-bar: Add smooth scrolling support
Do the same for StScrollBar.

https://bugzilla.gnome.org/show_bug.cgi?id=687573
2012-12-20 08:40:04 -05:00
Jasper St. Pierre
06dc12e217 scroll-view: Add proper smooth scrolling
The code here before was added as dummy code to satisfy an error
in the missing switch, and wasn't ever tested due to the lack of XI2
in mutter. Use the same math as GtkRange does to calculate scroll bar
positions from raw XI2 deltas to allow for proper smooth scrolling.

https://bugzilla.gnome.org/show_bug.cgi?id=687573
2012-12-20 08:40:04 -05:00
Giovanni Campagna
587c93eadf StDrawingArea: fix texture drawing
cogl_rectangle() wants the four rectangle corners, not the size.

https://bugzilla.gnome.org/show_bug.cgi?id=641745
2012-12-19 15:45:18 +00:00
Giovanni Campagna
9860b1c677 St: fix regression from f7af96dbb2
A bad rebase caused the wrong patch to be pushed.

https://bugzilla.gnome.org/show_bug.cgi?id=687881
2012-12-16 20:45:43 +01:00
Giovanni Campagna
f7af96dbb2 St: avoid blocking IO to resolve relative urls
realpath() does a series of lstat() on each path component to resolve
symbolic links, but we just want to get an absolute path, and we don't
really care if it is physical or not. Going through a GFile does the
canonicalization we need, and is a lot faster.

https://bugzilla.gnome.org/show_bug.cgi?id=687881
2012-12-15 03:40:13 +01:00
Giovanni Campagna
208121646c St: recompute all theme nodes when the icon theme changes
StWidget considers "same theme node" as an indication that the style
did not change, and skips emitting style-changed in that case. This
means that icon theme changes are not picked up by StIcon.

https://bugzilla.gnome.org/show_bug.cgi?id=689353
2012-12-06 17:42:07 -05:00
Lionel Landwerlin
36fc3a5c96 st: fix rendering of corners in the box-shadow
https://bugzilla.gnome.org/show_bug.cgi?id=689789
2012-12-06 18:42:37 +00:00
Jasper St. Pierre
ead0286ca6 st-private: Don't round-trip through a font-string
ClutterText can support a PangoFontDescription directly.

https://bugzilla.gnome.org/show_bug.cgi?id=689568
2012-12-03 15:56:59 -05:00
Jasper St. Pierre
a88433dba6 st-private: Fix style 2012-12-02 20:11:36 -05:00
Jasper St. Pierre
7e5f1fe411 st-private: Don't create attr lists if we don't need them
Decorations are fairly uncommon in gnome-shell, so it's
worthwhile to avoid effort creating empty attr lists. This
can also help prevent a relayout.

https://bugzilla.gnome.org/show_bug.cgi?id=689400
2012-12-02 20:11:10 -05:00
Jasper St. Pierre
2492dc50db scroll-bar: Remove jitter on the scroll bar when moving the mouse
This was due to incorrect pixel clamping, which bounced the height
of the actor between values. Just remove pixel clamping, as Clutter
will correctly do it for us.

https://bugzilla.gnome.org/show_bug.cgi?id=689243
2012-11-29 16:43:47 -05:00
Jasper St. Pierre
b4f5f1e461 scroll-view-fade: Fade gradients when near edges
Rather than sharply transitioning to gradients, fade them out when
near the edge of the scroll view.

https://bugzilla.gnome.org/show_bug.cgi?id=689249
2012-11-29 16:17:09 -05:00
Jasper St. Pierre
69347fff09 scroll-view-fade: Only calculate the ratios if they're needed
This prevents some calculations being done for poor drivers with
bad optimizers.

https://bugzilla.gnome.org/show_bug.cgi?id=689249
2012-11-29 16:17:09 -05:00
Jasper St. Pierre
5c439f4e9c scroll-view-fade: Do the offset math in the shader
This doesn't (or shouldn't) change the visual appearance of the fade
effect, but does do all the testing math inside the shader, rather
than on the CPU. This will make fading the offset much easier in
the future.

https://bugzilla.gnome.org/show_bug.cgi?id=689249
2012-11-29 16:17:09 -05:00
Jasper St. Pierre
c84236ed73 scroll-view-fade: Use GLSL 1.20
GLSL 1.20 is a better language, and we'll rely on it in future updates.
This doesn't have any additional constraints, since GLSL 1.20 was
standardized before GLSL-supporting drivers came out.

https://bugzilla.gnome.org/show_bug.cgi?id=689249
2012-11-29 16:17:09 -05:00
Jasper St. Pierre
ae1a3a0cb2 scroll-view-fade: Clean up GLSL
Basic cleanup of what we're doing already. This moves a bunch
of the "inside the fade area" checks to the top, before doing
any calculations.

https://bugzilla.gnome.org/show_bug.cgi?id=689249
2012-11-29 16:17:09 -05:00