Commit Graph

47782 Commits

Author SHA1 Message Date
Carlos Garnacho
f44b9ef1f0 GtkColorEditor: Keep ref on pre-popup focus widget
And ensure it's still visible before returning the keyboard focus to it.
Because of the extra ref, add a dispose handler that will ensure the
ref is lost (by popping down), although this should be already ensured
through other paths (eg. when the popup widget loses visibility).

This fixes a possible crash in dispose paths, where we might be restoring
focus on an already destroyed widget, and at a time where, if the toplevel
is being itself disposed, no new focus should be set.

https://bugzilla.gnome.org/show_bug.cgi?id=767849
2016-06-21 17:56:34 +02:00
Carlos Garnacho
3b98a2d935 demos: Simplify popovers demo
Don't do much unconventional stuff here. This is a demo, not a test.

https://bugzilla.gnome.org/show_bug.cgi?id=767851
2016-06-21 17:56:21 +02:00
Carlos Garnacho
ed227f9e7b GtkPopover: Honor widget margins when calculating tail position
If there are widget margins set, the whole popover will be displaced.
However the calculation of the tail position doesn't have this into
account, ending up with the tail being detached from the popover if
the margin grew too big.

We should not render the arrows invariably next to the GdkWindow edge,
but optionally displaced inside it depending on the widget margins.
Fixes the gtk3-demo "Popovers" demo case, whose GtkEntry popovers set
widget margins for some reason.

https://bugzilla.gnome.org/show_bug.cgi?id=767851
2016-06-21 17:54:42 +02:00
Christian Hergert
3724592efb listbox: short-circuit if no sort function is set
do_sort will crash if sort_func is not defined. Instead of adding a check
there in the hot path, just check for sort_func before invalidating the
sort of the underlying GSequence.
2016-06-20 18:51:42 -07:00
Matthias Clasen
49bd5a97ce 3.21.3 2016-06-20 15:27:20 -04:00
Matthias Clasen
1ebfe1db56 Skip GdkDrawingContext in some tests
GdkDrawingContext is not freely constructible, so we need
to skip it in the notify and finalize tests.
2016-06-20 15:27:20 -04:00
Olivier Fourdan
0eeaa935b9 wayland: do not set PRIMARY selection if focus is lost
If keyboard focus is (already) lost, do not advertise PRIMARY selection.

https://bugzilla.gnome.org/show_bug.cgi?id=767848
2016-06-20 14:13:29 -04:00
Matthias Clasen
dff61b02ba Updates 2016-06-20 00:20:01 -04:00
Matthias Clasen
e01f35ef5f gtk3-demo: Make the filter model example more interesting
Allow editing values in the first treeview, to see the derived
models update in real time.
2016-06-19 23:54:07 -04:00
Matthias Clasen
8a2812217b shortcuts: Try harder to disambiguate search items
I noticed that some of the gestures did not show up in the
search results in the builder example in gtk3-demo, because
they share the same title and don't have an accelerator to
disambiguate. Include the shortcut type to handle this case.
2016-06-19 23:24:44 -04:00
Matthias Clasen
815cc23c4c gtk-demo: Use max-content-height in the popover example
This is what the property was invented for.
2016-06-19 23:07:17 -04:00
Matthias Clasen
c2534af15e gtk3-demo: Fix the modelbutton example
The color menu buttons didn't have the necessary target property
to be successfully activated.
2016-06-19 22:56:20 -04:00
Matthias Clasen
2fd984987d gtk-demo: Fix up some warnings
The search entry example was a bit sloppy in cleaning up its
sources, causing warnings.
2016-06-19 22:47:57 -04:00
Matthias Clasen
76af907676 Add a release note for scrolled windows
Mention the changed sizing behavior and how to address it.
2016-06-19 22:23:06 -04:00
Matthias Clasen
37e913d76b widget factory: Adapt to new scrolled window behavior
Set a max-content-width on some of the scrolled windows to
keep things looking mostly the same, now that GtkScrolledWindow
passes along the natural size of its child.
2016-06-19 22:16:11 -04:00
Carlos Garnacho
e33e23a6d9 treeview: Ensure the treeview has the implicit grab before grabbing focus
The cellrenderer signals might be taking the grab somewhere else, at which
point it's dubious we should attempt to take the keyboard focus into the
treeview.

This concretely breaks popovers triggered from cellrenderer signals on
button press, because the treeview will attempt to grab focus
inconditionally then.

https://bugzilla.gnome.org/show_bug.cgi?id=767468
2016-06-19 20:54:18 -04:00
Matthew Leeds
51799d41e4 GtkActionHelper: Change a message to a warning
It's almost certainly a programmer error if an action isn't
activatable because its target and parameter type don't match.
This commit changes the existing g_message to a g_warning.

https://bugzilla.gnome.org/show_bug.cgi?id=767705
2016-06-19 20:06:13 -04:00
Philip Chimento
76bacfde6e style cascade: Allow cascades with more ancestors
Previously a style cascade's parent could not have a parent itself. That
represented the two levels at which you could add a style provider: at
the screen level, with gtk_style_context_add_provider_for_screen(), and
at the style context level, with gtk_style_context_add_provider().

This commit changes no functionality, but this change will be necessary
for adding style providers in the future that apply to a subtree of the
widget tree. It relaxes the requirement that a style cascade's parent
must not have a parent, since in the future a style context may be
affected by any number of parent widgets' style contexts.

https://bugzilla.gnome.org/show_bug.cgi?id=751409
2016-06-19 19:47:05 -04:00
Matthias Clasen
1c6b878e09 shortcuts window: Fix handling of significant xml chars
We are using markup in the labels, so we need to escape things
like < and >.

https://bugzilla.gnome.org/show_bug.cgi?id=767795
2016-06-19 17:49:03 -04:00
Rafael Fontenelle
ed2bb7e012 Updated Brazilian Portuguese translation 2016-06-18 00:29:01 +00:00
Rafael Fontenelle
552e436128 Updated Brazilian Portuguese translation 2016-06-17 23:53:20 +00:00
Misty De Meo
631f6b5364 configure: fix detecting CUPS 2.x
https://bugzilla.gnome.org/show_bug.cgi?id=767766
2016-06-17 14:46:21 +02:00
Ray Strode
2f3cb31e55 wayland: fall back to shm_open if memfd unavailable
Debian stable currently ships with a 3.16 kernel, so
it doesn't have memfd available.

This commit adds shm_open fall back code for that case
(for now).

https://bugzilla.gnome.org/show_bug.cgi?id=766341
2016-06-16 12:02:51 -04:00
Ray Strode
bb2ca3b94d wayland: fix error handling for memfd_create
We currently use syscall() directly to invoke memfd_create,
since the function isn't available in libc headers yet.

The code, though, mishandles how errors are passed from syscall().
It assumes syscall returns the error code directly (but negative),
when in fact, syscall() uses errno.

Also, the code fails to retry on EINTR.

This commit moves the handling of memfd create to a helper function,
and changes the code to use errno and handle EINTR.

https://bugzilla.gnome.org/show_bug.cgi?id=766341
2016-06-16 12:00:24 -04:00
Krzesimir Nowak
080fdfa7f9 docs: Fix a typo in GDK sections file 2016-06-16 12:20:05 +02:00
Matthias Clasen
847f9f40cf Mention single-stop gradients in the release notes
This is something people stumble over in their custom CSS.
2016-06-15 19:11:41 -04:00
Daniel Mustieles
7246538a9c Updated Spanish translation 2016-06-13 13:17:11 +00:00
Emmanuele Bassi
0ca59bf85a gdk: Unset the DrawingContext <-> cairo_t link on dispose
When disposing a GdkDrawingContext we should unset the association
between the instance and the Cairo context; this avoids stale pointers
in case a reference that has acquired on the Cairo context survives the
lifetime of the GdkDrawingContext.
2016-06-12 18:55:34 +01:00
Emmanuele Bassi
222bcf1a71 gdk: Try harder at tracking drawing contexts
If gdk_cairo_create() is called within a frame draw operation, we can
still associate the Cairo context with a GdkDrawingContext.
2016-06-12 17:27:44 +01:00
GNOME Translation Robot
32a37351cf Updated Scottish Gaelic translation 2016-06-11 07:54:43 +00:00
GNOME Translation Robot
2118b838d1 Updated Scottish Gaelic translation 2016-06-10 15:35:34 +00:00
GNOME Translation Robot
beb3fd6621 Updated Scottish Gaelic translation 2016-06-10 15:15:27 +00:00
Emmanuele Bassi
c3f4fe334d Deprecate gtk_widget_send_expose()
We have various replacements for what this function does, and we are not
calling it internally any more.
2016-06-10 16:13:27 +01:00
Tristan Van Berkom
a9a59ac55e scrolledwindow: Fix calls to gdk_window_move_resize()
This is a bit of fallout from 34feba1, now that we resolve
the has_indicators value earlier than realize, it becomes
possible to call gdk_window_move_resize() before realization.

Just added the appropriate checks.
2016-06-10 21:16:53 +09:00
Stefan Sauer
32675db490 docs: point to suggested api for deprecated functions
We deprecated a bunch of _focus_on_click() functions. Point to the new API
in GtkWidget.
2016-06-09 22:44:44 +02:00
Emmanuele Bassi
c9916fbc58 docs: Add deprecation notice for GtkButton.set_focus_on_click()
To match the deprecation annotation on the function declaration.
2016-06-09 21:35:36 +01:00
Emmanuele Bassi
ddfe3374e3 Avoid a deprecation warning
Some debugging code in GdkWindow still calls gdk_cairo_create().
2016-06-09 21:00:13 +01:00
Emmanuele Bassi
ad78daaf80 gdk: Deprecate gdk_cairo_create()
We have GdkDrawingContext, now, which is in charge of creating Cairo
contexts for drawing on a GdkWindow.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
2d38c40f78 gdk: Explicitly create a cairo context inside GdkDrawingContext
Instead of using gdk_cairo_create(), which we'll soon deprecate.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
c5d0522a23 Deprecate the gdk_window_begin/end_paint family of functions
They are replaced by the more appropriate gdk_window_begin_draw_frame()
and gdk_window_end_draw_frame() functions.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
dda6a0d385 Associate the drawing context to the Cairo context
Instead of associating the GdkWindow that created the GdkDrawingContext
we can directly bind the Cairo context to the GDK drawing context.

Cairo contexts created via gdk_cairo_create() go back to not having a
GdkWindow associated to them, like they did before we introduced the
gdk_window_begin_draw_frame() API.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
01b4bf1920 docs: Add GdkDrawingContext to the GDK API reference
https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
a7ef37da2a Add GdkDrawingContext
Instead of giving out Cairo contexts, GdkWindow should provide a
"drawing context", which can then create Cairo contexts on demand; this
allows us to future proof the API for when we're going to use a
different rendering pipeline, like OpenGL.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
2c7b21718f Simplify the widget rendering entry point
Now that GDK has the appropriate API, we can simplify the widget drawing
code into a single function.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
fc569f1ac6 Add frame drawing API to GdkWindow
Existing code drawing on a GDK window has to handle the direct drawing
and the buffered drawing by itself, by checking the window type and
whether or not the window is backed by a native windowing surface. After
that, the calling code has to create a Cairo context from the window and
keep an association between the context and the window itself.

This is completely unnecessary: GDK can determine whether or not it
should use a backing store to draw on a GdkWindow as well as create a
Cairo context, and keep track of it.

This allows to simplify the calling code, and enforce some of the
drawing behavior we want to guarantee to users.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Tristan Van Berkom
d6187c9a02 scrolledwindow test: Check natural width for max content size
The maximum content size does not increase the minimum request
but only ensures that both minimum and natural requests do not
exceed the maximum setting.
2016-06-09 14:57:10 +09:00
Tristan Van Berkom
34feba1e7c scrolledwindow: Resolve whether we use overlay scrollbars early.
Widgets should support size requests before being realized in general,
otherwise this can cause flicker/resize at initial display time as
the toplevel window can make a request before realize/allocate.

This also makes the added testsuite/gtk/scrolledwindow.c test work again,
this was broken because we only ever calculate whether we are going
to use overlay scrollbars once the scrolled window is realized (and
the test case does not realize any window).
2016-06-09 14:57:10 +09:00
Tristan Van Berkom
d7e242eec0 scrolledwindow: Bug 766569 - General size request fixes.
This patch does a couple of things:

  o Removes the obscure 'extra_width' and 'extra_height' variables
    making the request code exceedingly difficult to read

  o Fixes the max-content-size properties introduced in bug 742281
    so that they do not grow the minimum request.

  o Cleanup of request code in general:
    - min/max content sizes are clamped around the child request as needed
    - scrollbar requests are only added in one place, after child request
      sizes are calculated and without the extra_width/height thing.
2016-06-09 14:57:10 +09:00
Emmanuele Bassi
32885605c7 Fix build
Commit 023f406c96 has a typo that results
in this error:

../../../testsuite/gtk/notify.c: In function 'test_type':
../../../testsuite/gtk/notify.c:679:54: error: expected expression
before ')' token
    (g_str_equal (pspec->name, "max-content-width") ||)
                                                      ^
2016-06-08 14:20:02 +01:00
Timm Bäder
d9a6517d5f wayland: Make sure window titles fit into a wl_buffer
A wl_buffer has a max size of 4096 bytes, of which 8 are needed for the
header and another 4 for the string argument length (in this case), so
make sure the we only save the first 4083 bytes that are still valid
UTF8.

https://bugzilla.gnome.org/show_bug.cgi?id=767241
2016-06-08 15:06:51 +02:00