Commit Graph

46078 Commits

Author SHA1 Message Date
Ray Strode
c80dd54924 wayland: stage uncommitted changes to dedicated buffer
Right now we use one buffer for both staged changes (freshly painted
changes waiting for the frame clock to send to the compositor) and
committed changes (changes actively being read by the compositor
process). This creates a problem in the event we need to stage updates
at the same time the compositor is processing committed updates: we
can't change what the compositor is actively processing.

The current solution for handling this contention is to allocate a
temporary buffer on the spot at the time the updates are staged, and to
copy that buffer back to the shared buffer later.  The problem, though,
is that the copy to the shared buffer currently happens as soon as
the updates are finished being staged, not when the shared buffer is
done being processed by the compositor.

In order to address that problem, this commit changes the code to always
stage changes to a dedicated staging buffer.  The staging buffer is
used exclusively by the client until the client is done with it, and then
once that staging buffer is committed, the client never writes to that
buffer again.  If the client needs to stage new updates, it allocates a
brand new staging buffer, draws to it, and back fills the undrawn parts
of the buffer from a copy of the contents of the committed buffer.

As an optimization, the compositor has the option of releasing the
committed buffer back to the client.  If it does so before the client
needs to stage new updates, then the client will reuse the buffer
for staging future updates.  This optimization prevents having to allocate
a new staging buffer and the associated cost of back filling
that new buffer with a readback of the committed buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=761312
2016-02-06 08:02:57 -05:00
Ray Strode
40e91195ad wayland: don't handle buffer release centrally
Right now we handle buffer releases coming from the
compositor in a central place. We add a listener when
first creating the shared buffers.

This is problematic because a buffer can only have
one listener on it at once so users of the buffer
can't get notified when it's released.

This commit moves the buffer listener code from the
centrally managed display code to the cursor and window
code.

https://bugzilla.gnome.org/show_bug.cgi?id=761312
2016-02-06 08:02:57 -05:00
Ray Strode
2c300081c4 wayland: always return FALSE from begin_paint
The client and compositor share access to the window
pixel buffers. After the client hands off (commits)
the buffer to the compositor it's not supposed to write
to it again until it's released by the compositor.

The code tries to deal with this contention by allocating
a temporary buffer and using that in the mean time. This
temporary buffer is allocated by a higher layer of the code
when begin_paint returns TRUE. Unfortunately, that layer of
the code has no idea when the buffer is released, so it ends
up blitting the temporary buffer back to the shared buffer
prematurely.

This commit changes begin_paint to always return FALSE.

A future commit will address the contention problem in
a different way.

https://bugzilla.gnome.org/show_bug.cgi?id=761312
2016-02-06 08:02:57 -05:00
Ray Strode
1cfa2f4134 wayland: use g_clear_pointer when destroying cairo surfaces
There are a few places where we destroy a cairo surface and
then nullify it. This commit changes those to use
g_clear_pointer instead.

It also drops a cairo_surface_finish call that is unnecessary

https://bugzilla.gnome.org/show_bug.cgi?id=761312
2016-02-06 08:00:35 -05:00
Ray Strode
e6f92df57e wayland: rename cairo surface user data key to be more specific
This commit renames the key name to be more specific for clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=761312
2016-02-06 07:59:25 -05:00
Ray Strode
3ac78ea0be wayland: move server proxy objects to substructure
This commit moves the server proxy objects to a substructure
for clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=761312
2016-02-06 07:59:09 -05:00
Ray Strode
f90db30b9e wayland: rename window->surface to window->wl_surface
The name surface is really overloaded when dealing
with wayland windows.

To alleviate ambiguity, this commit changes the name
of the "surface" and "subsurface" members to have
a wl_ prefix.

https://bugzilla.gnome.org/show_bug.cgi?id=761312
2016-02-06 07:58:56 -05:00
Matthias Clasen
4d40bd4474 Fix stylecontext tests
This was broken by f7ec9c98ef,
since type names are no longer used at all in CSS matching.
2016-02-06 09:59:48 +01:00
Matthias Clasen
2d1f1f3b81 Update CSS docs regarding type names
We no longer use type names at all.
2016-02-06 09:28:51 +01:00
Benjamin Otte
d48d3b359c cssselector: Remove type references
We don't use types anymore.
2016-02-05 23:47:48 +01:00
Benjamin Otte
e8fca5bbbe cssmatcher: Remove type argument from name matcher
We no longer use types when matching names.
2016-02-05 23:43:05 +01:00
Benjamin Otte
fe6d4cbdf5 inspector: Drop type name from node list
It's not used anymore in the CSS, so people don't need to see it.
2016-02-05 19:31:47 +01:00
Benjamin Otte
0c12601208 cssimageradial: Only allow at "<position>" after other props
Don't allow syntax like
  at top left circle
but follow the spec about requiring the at <position> right before the
comma.

This is porbably because
  circle at 10px 10px
could be interpreted as
  circle 10px at 10px
with the now disallowed syntax, too.

Test included.
2016-02-05 19:31:47 +01:00
Benjamin Otte
982da040b2 cssimageradial: Only emit one error for wrong position
Test included.
2016-02-05 19:31:47 +01:00
Matthias Clasen
f2e08d3a9c css tests: Fix style tests
Commit d0fd7990c3 changed
the location of builtin themes, breaking the loading of
the empty theme in test-css-style.
2016-02-05 16:35:43 +01:00
Matthias Clasen
132abb8749 css tests: Fix expected output
This is fallout from f7ec9c98ef.
2016-02-05 16:35:43 +01:00
Benjamin Otte
5444442974 css: Convert numbers with GTK's dpi
Don't hardcode 96 for dpi, but instead use the value of the -gtk-dpi
property (that mirrors the GdkScreen's dpi if it wasn't set explicitly).

This makes these values scale when the large font setting in
control-center is enabled.
2016-02-05 14:52:09 +01:00
Benjamin Otte
e35e6abbb2 css: Properly convert em, ex and rem to pixels
The previous code converted to pt.
2016-02-05 14:52:09 +01:00
Lapo Calamandrei
56b1b08bb8 Adwaita: darker background for popovers 2016-02-05 14:11:30 +01:00
Matthias Clasen
61307deaf7 levelbar: Make discrete levelbars behave as before
During the gadget conversion, the drawing of discrete levelbars
was unintentionally changed to draw a wide trough but narrow
blocks, which does not look great. So go back to the previous
way of drawing things.

https://bugzilla.gnome.org/show_bug.cgi?id=761428
2016-02-05 11:53:50 +01:00
Matthias Clasen
339023dee5 Fix indentation
gcc 6 complains about this.
2016-02-05 11:42:28 +01:00
Matthias Clasen
f60e144038 Document rem as CSS unit 2016-02-05 06:53:11 +01:00
Timm Bäder
680ec087ab switch: Don't queue draws after setting state flags 2016-02-04 20:00:21 +01:00
Benjamin Otte
0e7691c12e css: Add rem unit
Good luck, Lapo.
2016-02-04 19:37:44 +01:00
Benjamin Otte
f7ec9c98ef widget: Set a css name
Now selecting a widget by class name no longer works.

This is probably most relevant for users outside of GTK that want to
style their own widgets. Those widgets should now either add their own
style classes (if they want to adjust existing CSS) or use
gtk_widget_class_set_css_name() themselves (if they want to get rid of
all "upstream" styling).
2016-02-04 17:27:03 +01:00
Timm Bäder
35cd0be468 Range: Group all three gestures
And reset the grab_location in the ::released handler of the multipress
gesture.

Previously, when leaving fine-tune mode, the ::released handler of the
multipress gesture would call stop_scrolling, which calls
range_grab_remove and resets the grab_location. The ::drag-end handler
is executed after that, and only unsets priv->in_drag if the
grab_location is MOUSE_OUTSIDE, which it never was, since the ::released
handler already reset it. This lead to priv->in_drag being set even
though no dragging was in progress anymore, which e.g. made shift
pressed after leaving the fine-tune mode entering it again.

https://bugzilla.gnome.org/show_bug.cgi?id=761402
2016-02-04 17:08:30 +01:00
William Hua
7b88e304c7 x11: don't apply scaling factor twice
The fallback behaviour of get_work_area () divides the
screen width and height by the window scaling factor, but
those values are already scaled down.

https://bugzilla.gnome.org/show_bug.cgi?id=761474
2016-02-04 11:02:09 -05:00
Руслан Ижбулатов
4a49d8d14f Don't do remote checks on NULL files
Calling _gtk_file_consider_as_remote() with a NULL argument
results in warnings being thrown.

Note that query->priv->location being NULL is a state that does
not seem to be invalid by itself.

This could happen if you do search-as-you-type in a filechooser,
which has a filter that does not match anything *and* the current
"place" selected is "Recent".

https://bugzilla.gnome.org/show_bug.cgi?id=761552
2016-02-04 15:57:35 +00:00
Matthias Clasen
3756d92367 Move private widget path functions away
We don't put private functions in public headers anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=761339
2016-02-04 15:19:51 +01:00
Benjamin Otte
8d515409c6 win32: Get rid of XP theme
XP is not supported anymore. And we can massively simplify the win32
theme if we don't have to support 2 versions.
2016-02-04 14:25:46 +01:00
Benjamin Otte
7d4bf49cff win32: Delete classic theme
Well, actually, stop adding an extra version of raleigh
2016-02-04 14:23:08 +01:00
Benjamin Otte
27901c7794 build: Don't break windows build
Hardcode the existing files instead of doing a for loop and attempting
string-fudging magic.
2016-02-04 14:19:51 +01:00
Lapo Calamandrei
6cdca1e124 Adwaita: removed some old cruft from _drawing.scss
resulting in a nice number of non working selectors ditched.
2016-02-04 14:14:59 +01:00
Benjamin Otte
b783670820 inspector: Don't hardcode builtin themes
Insteead, enumerate the resources that are available. Fixes windows
themes not being listed in the inspector.
2016-02-04 13:35:21 +01:00
Benjamin Otte
d0fd7990c3 cssprovider: Change location of builtin themes
Instead of
  /org/gtk/libgtk/theme/$THEME-$VARIANT.css
look at
  /org/gtk/libgtk/theme/$THEME/gtk-$VARIANT.css
and that way mirror the directory layout of real themes.
2016-02-04 13:35:21 +01:00
Timm Bäder
6bc096d748 actionbar: Remove unnecessary map/unmap implementations
These just do what the default implementations do anyway.
2016-02-04 13:32:34 +01:00
Timm Bäder
641e703882 statusbar: Remove unused include 2016-02-04 13:32:34 +01:00
Timm Bäder
572e9a0402 Remove _gtk_box_get_children
It's doing exactly the same thing as gtk_container_get_children.
2016-02-04 13:32:34 +01:00
Timm Bäder
2929621d05 colorswatch: Remove unused constant 2016-02-04 13:32:34 +01:00
Benjamin Otte
c95087c70a entry: queue an allocate when pulsing
We need to reposition the progress gadget and that's done during
allocation.
2016-02-04 12:25:13 +01:00
Alberts Muktupāvels
8eb2619888 gdkwindow-x11: always set _GTK_THEME_VARIANT property
Set _GTK_THEME_VARIANT to empty string when default theme variant
is used. This will allow to understand whether _GTK_THEME_VARIANT
is not supported or default variant is requested.

https://bugzilla.gnome.org/show_bug.cgi?id=761476
2016-02-04 11:52:07 +02:00
Alberts Muktupāvels
7ac337a9af gtksettings: fix critical warning
Commit 5186aeb90f introduced critical
warning - g_value_copy: assertion 'g_value_type_compatible (...)' failed.

https://bugzilla.gnome.org/show_bug.cgi?id=761381
2016-02-04 11:45:50 +02:00
Benjamin Otte
a2ac9524bc broadway: Define variables where they are used
Avoids gcc warnings about unused variables.
2016-02-03 23:07:05 +01:00
Benjamin Otte
9708ecdd5b composetable: Fix gcc warnings 2016-02-03 23:06:53 +01:00
Benjamin Otte
be6f65a08e immodule: Use correct sign for function prototype 2016-02-03 22:53:22 +01:00
Benjamin Otte
429bec54e5 entry: Turn progress node into a gadget 2016-02-03 22:53:22 +01:00
Benjamin Otte
3316d69abb entry: Simplify drawing code 2016-02-03 22:53:22 +01:00
Lapo Calamandrei
207a842bfd Adwaita: fix headerbar spinbutton size
fixes https://bugzilla.gnome.org/show_bug.cgi?id=761484
2016-02-03 18:32:51 +01:00
William Hua
9b08853537 gdkborder: remove unneeded definition
This reverts 54fa65f544,
5190d010d9, and
a6e4de2884.

https://bugzilla.gnome.org/show_bug.cgi?id=756579
2016-02-03 11:20:52 -05:00
Matthias Clasen
0bcd8603eb print dialog: Fix layout preview drawing
Use the CSS name paper for this as well, and make sure Adwaita
sets a color that makes the text visible in the dark theme as well.
2016-02-03 16:07:51 +01:00