Commit Graph

38853 Commits

Author SHA1 Message Date
Jasper St. Pierre
bb7bf07af6 gdkwindow-broadway: Make queue_antiexpose implementation private 2014-06-21 18:45:38 -04:00
Jasper St. Pierre
0bad7d8f5c gdkwindow-wayland: Attach new buffers and submit damage in end_paint
process_updates_recurse is simply the wrong place for it to be.
2014-06-21 18:45:38 -04:00
Jasper St. Pierre
afbadd6639 gdkwindow-wayland: Rename listener -> frame_listener
Don't pollute the static namespace here.
2014-06-21 18:45:38 -04:00
Michael Catanzaro
d9d0ba83ac docs: add missing apostrophe 2014-06-21 12:16:29 -05:00
Jasper St. Pierre
9036ed0d67 gdkwindow: Correct a signature
We removed the parameter from callers and from the implementation, but
not from the signature up top. I didn't notice because the branch I was
working on removed the signature entirely.
2014-06-21 11:25:40 -04:00
Jasper St. Pierre
47d6677e92 gdkwindow: Remove an extra region copy
This code is only called with the current paint region as its argument.
Instead of having to copy it and do a no-op intersect against itself,
just use the current paint directly.
2014-06-21 11:00:24 -04:00
Jasper St. Pierre
7fefd211b8 gdkwindow: Clean up code
Introduce a temporary to make the code a bit more clear under these cases.
2014-06-21 10:17:23 -04:00
Jasper St. Pierre
e700305279 gdkwindow: Clean up formatting
Tabs to spaces, add some whitespace.
2014-06-21 10:17:06 -04:00
Jasper St. Pierre
ec5e913a9b gdkwindow: Add some extra documentation to gdk_cairo_create
Mention the need to wrap the function inside
gdk_window_begin_paint_region and gdk_window_end_paint.
2014-06-21 10:01:33 -04:00
Benjamin Otte
93b3179042 widgetpath: Deprecate regions
This is a foolowup to d80bf0790d
2014-06-21 15:46:44 +02:00
Jasper St. Pierre
6bc251692a gtkwidget: Add a warning about set_double_buffered
As requested on the mailing list.
2014-06-21 00:31:17 -04:00
Jasper St. Pierre
28f381e936 testwindows: Remove another reference to set_double_buffered 2014-06-21 00:30:59 -04:00
Jasper St. Pierre
4a72563c7b gtktrayicon-x11: Stop using set_double_buffered
There's nothing better we can do for this case, now that we always
redirect drawing to a temporary pixmap. Maybe since this is already
X11-specific code, we should just do everything with Xlib directly.
2014-06-21 00:30:45 -04:00
Matthias Clasen
0ec00ffbb0 Adwaita: Fix highlight on check buttons
The .button style class does not apply to check and radio
buttons, and .check only applies to menuitems.
2014-06-20 23:17:53 -04:00
Jasper St. Pierre
60d39e973a gdkwindow: Squash a leak in the subsurface case
cairo_surface_create_for_rectangle takes a ref on the parent surface,
so we need to drop ours.

Rename get_window_surface to ref_window_surface to make the code more
clear and to stop this error from happening again.
2014-06-20 20:48:21 -04:00
Jasper St. Pierre
d619a78aeb gdkwindow: Don't create a subsurface if we don't need to
In the case we have a native window, we don't need to crop it to a
non-native subrectangle, as abs_x / abs_y / width / height are all 0.
2014-06-20 20:46:49 -04:00
Jasper St. Pierre
be30e440c3 gdkwindow: Remove the ability to call begin_paint_region more than once
Previously, each begin_paint_region added to a stack of current paints,
and when end_paint was called, the paint was popped off of the stack and
the surface was composited into the parent paint surface.

However, the code was broken in the case of a backend like Wayland which
didn't keep track of nested calls and simply wiped and returned the
native impl backing surface every time.

Since this feature is flat out unused by GTK+ and we don't want to
really support tricksy things like these for other clients, just remove
the feature. If somebody does call begin_paint_region more than once,
warn and return without doing anything.
2014-06-20 20:41:55 -04:00
Jasper St. Pierre
d48adf9cee gdkwindow: Remove the internal cairo_surface used for out-of-band painting
Traditionally, the way painting was done in GTK+ was with the
"expose-event" handler, where you'd use GDK methods to do drawing on
your surface. In GTK+ 2.24, we added cairo support with gdk_cairo_create,
so you could paint your graphics with cairo.

Since then, we've added client-side windows, double buffering, the paint
clock, and various other enhancements, and the modern way to do drawing
is to connect to the "draw" signal on GtkWidget, which hands you a
cairo_t. To do double-buffering, the cairo_t we hand you is actually on
a secret surface, not the actual backing store of the window, and when
the draw handler completes we blit it into the main backing store
atomically.

The code to do this is with the APIs gdk_window_begin_paint_region,
which creates the temporary surface, and gdk_window_end_paint which
blits it back into the backing store. GTK+'s implementation of the
"draw" signal uses these APIs.

We've always sort-of supported people calling gdk_cairo_create
"outside" of a begin_paint / end_paint like old times, but then you're
not getting the benefit of double-buffering, and it's harder for GDK to
optimize.

Additionally, newer backends like Mir and Wayland can't actually support
this model, since they're based on double-buffering and swapping buffers
at various points in time. If we hand you a random cairo_t, we have no
idea when is a good time to swap.

Remove support for this.

This is technically a GDK API break: a warning is added in cases where
gdk_cairo_create is called outside of a paint cycle, and the returned
surface is a dummy that won't ever be composited back onto the main
surface. Testing with complex applications like Ardour didn't produce
any warnings.
2014-06-20 20:41:54 -04:00
Jasper St. Pierre
b875572f2a gtkwidget: Widgets are now always double-buffered
gtk_widget_set_double_buffered is now deprecated, and we don't support
non-double-buffered widgets. This means that under normal circumstances,
paints are never outside of a begin_paint / end_paint sequence, which
natively-double-buffered backends like Wayland can't possibly support.
2014-06-20 20:41:54 -04:00
Jasper St. Pierre
a85f7028d4 gdkwindow: Deprecate gdk_window_flush
The function does nothing.
2014-06-20 20:41:53 -04:00
Matthias Clasen
240daf55a1 GtkIconTheme: Drop an unused function 2014-06-20 20:40:52 -04:00
Matthias Clasen
2472cf22db GtkIconTheme: Small cleanup
Make the default symbolic colors a little more readable in the code.
2014-06-20 20:40:52 -04:00
Matthias Clasen
669bc909d8 GtkIconTheme: Trivial cleanup
Drop the _-prefix from a static function.
We've agreed to no stop using those prefixes.
2014-06-20 20:40:51 -04:00
Matthias Clasen
d1918bbb69 Avoid a compiler warning
The name_offset variable is indeed unused.
2014-06-20 15:54:51 -04:00
Matthias Clasen
a24ef62f4d Big spinner 2014-06-20 15:54:17 -04:00
Matthias Clasen
5ddacf094e GtkIconTheme: Don't create empty IconThemeDir structs
Starting gtk3-demo currently creates ~1200 of these, most
of them for nonexisting directories. Lets try to avoid that.
2014-06-20 12:15:25 -04:00
Matthias Clasen
b4d12fff4e GtkIconCache: Add api to find if directories are empty
This will help in not creating structs for tons of empty
directories.
2014-06-20 12:15:25 -04:00
Matthias Clasen
5925f9eeb4 GtkStatusbar: Add some space between the frame and the label
Looks better this way.
2014-06-20 12:15:25 -04:00
Lapo Calamandrei
401bf15c9a Adwaita: check/radio selector simplification 2014-06-20 17:25:19 +02:00
Matthias Clasen
f56345bbad widget factory: Use a property action for the toolbar toggle
This is slightly more elegant than doing it manually.
2014-06-20 11:13:33 -04:00
Matthias Clasen
e7af95a40c widget factory: Add a statusbar
A widget that is not represented in the widget factory is likely
to not get proper attention from theme authors.
2014-06-20 11:10:22 -04:00
Matthias Clasen
ef30b8c051 docs: Drop image references for stock items
Most of those images are no longer in our tree, so just
say which ones have icons and rtl variants, instead of
showing it.
2014-06-20 10:55:48 -04:00
Jasper St. Pierre
76922c169f wayland: Prevent stale paints and weird artifacts when using Weston
Weston releases buffers almost immediately after they're done, which
means that GTK+ doesn't use a temporary surface and instead paints
directly onto the SHM backing store that Weston will use.

Normally, after painting to the temporary surface, GTK+ *replaces*
the existing backing surface with CAIRO_OPERATOR_SOURCE. However,
if we immediately paint to the backing surface, it might have junk
from the last paint in it. So clear out the backing surface whenever
somebody calls begin_paint_region().

Maybe we should just always use the temporary surface like the X11
codepath, since that prevents us from having to do weird things like
this, but oh well.
2014-06-20 09:02:02 -04:00
Matthias Clasen
2672837a14 GtkIconTheme: Keep gtk_icon_theme_add_resource_path private for now
We need to discuss some details of the semantics before
we can make this public.
2014-06-20 08:50:31 -04:00
Matthias Clasen
4f1ff179bb Revert "Document gtk_icon_theme_add_resource_path"
This reverts commit 988b6b483d.
2014-06-20 08:46:42 -04:00
Matthias Clasen
a31e8369f8 Revert "Deprecate gtk_icon_theme_add_builtin_icon"
This reverts commit 923eeda2d3.
2014-06-20 08:46:24 -04:00
Matthias Clasen
923eeda2d3 Deprecate gtk_icon_theme_add_builtin_icon 2014-06-20 01:17:47 -04:00
Matthias Clasen
988b6b483d Document gtk_icon_theme_add_resource_path 2014-06-20 01:17:47 -04:00
Matthias Clasen
99c0b3db06 Adapt the icontheme tests
With the new way of dealing with the legacy stock icons,
the builtin test needed some small updates.
2014-06-20 01:17:46 -04:00
Matthias Clasen
49bcaf844c GtkIconTheme: Include legacy stock icons from resources
Add /org/gtk/libgtk/icons as a resource path, and ensure
that we always parse an index.theme file for hicolor which
makes the builtin icons available as part of the hicolor theme.
2014-06-20 01:17:46 -04:00
Matthias Clasen
968ea4186d GtkIconTheme: Allow loading icons from resources
We add a new API, gtk_icon_theme_add_resource_path, which
can be used to add resource path as a base location for
icon theme content, similar to gtk_icon_theme_append_search_path.
2014-06-20 01:17:46 -04:00
Matthias Clasen
13c354db8d GtkIconTheme: Drop the all_icons hash table
It is not used anywhere anymore.
2014-06-20 01:17:46 -04:00
Matthias Clasen
11ec8f7285 GtkIconTheme: Stop using the all_icons hash table
This hash table was used in gtk_icon_theme_has_icon; we can
implement that function just as well without it and save some
memory.
2014-06-20 01:17:45 -04:00
Matthias Clasen
a8939e7cff icontheme: Add some more tests
This test checks that gtk_icon_theme_list_icons and
gtk_icon_theme_has_icon work as expected.
2014-06-20 01:17:45 -04:00
Matthias Clasen
6549031030 Formatting fixes 2014-06-20 01:17:45 -04:00
Matthias Clasen
aa44c0ca53 GtkIconTheme: Drop the code for parsing .icon files
Modern icon themes don't ship .icon files anyway.
2014-06-20 01:17:45 -04:00
Matthias Clasen
84bc9bba42 GtkIconTheme: Deprecate functionality related to .icon files
This functionality is not used at all in modern icon themes.
2014-06-20 01:17:45 -04:00
Matthias Clasen
36be12578c Drop the builtin icon cache
We don't need it anymore, now that the non-standard stock icons
are using resources.
2014-06-20 01:17:44 -04:00
Matthias Clasen
ea8afd2937 Add non-standard stock icons as resources
This will allow us to remove the builtin icon cache in the future
while keeping the deprecated stock icons working.
2014-06-20 01:17:35 -04:00
Matthias Clasen
548a804653 Drop all standard icons from the builtin icontheme
We're going to require a complete icon theme, and we have
a test that checks for all the icons we use, so there is
no need to include all these fallback icons.
2014-06-20 00:52:20 -04:00