Commit Graph

30165 Commits

Author SHA1 Message Date
Matthias Clasen
62aa487500 Improve the scale handling
Always use the smallest scale that is larger than requested,
or, failing that, the largest available scale.
2018-03-15 20:28:12 -04:00
Matthias Clasen
454814c6b4 Merge branch 'css-image-scaled' into 'master'
Css image scaled

See merge request GNOME/gtk!62
2018-03-15 23:58:40 +00:00
Matthias Clasen
35f92b5695 Merge branch 'wip/filechooser-non-default-display-gtk4' into 'master'
Fix filechooser dialog using non default display (gtk4)

Closes #83

See merge request GNOME/gtk!60
2018-03-15 17:44:49 +00:00
Matthias Clasen
a4c2819f91 Make GtkCssImageScaled handle scales properly
We slightly expand the syntax of -gtk-scaled to allow
specifying an explicit scale after each image, and then
we create a single-image GtkCssImageScaled with the
preferred scale in compute().
2018-03-15 06:04:08 -04:00
Timm Bäder
afffc696f4 spinbutton: Remove an unnecessary queue_draw call
This is done automatically in case the spinbutton value actually
changes.
2018-03-15 09:44:49 +01:00
Matthias Clasen
16bf07fe33 Trivial formatting fixes
Fix some whitespace problems.
2018-03-14 23:23:03 -04:00
Timm Bäder
955dca950c fixed: Remove snapshot implementation
It does the same thing as the default implementation.
2018-03-14 17:28:41 +01:00
Timm Bäder
5f2283c0ab snapshot: Ignore 0 sized clip nodes
This may happen due to the intersection before.
2018-03-14 17:28:41 +01:00
Carlos Soriano
f06f0a0dee gtkmenu: Remove unused constant
It was used in gtk3 but not in master anymore.
2018-03-14 16:05:08 +01:00
Jonas Ådahl
a48eaa1954 entrycompletion: Realize popup after setting screen
Realization is done as a side effect of calling
_gtk_entry_completion_resize_popup(), but if this is done before the
GdkScreen of the GtkWindow is set up correctly, it may result in the
widget being unrealized when the screen is updated. This may happen
when the file dialog parent window is not using the default GdkDisplay.

To avoid this issue, realize the popup after the screen has been
properly set up.

Fixes #83 in gtk4
2018-03-14 15:37:26 +08:00
Timm Bäder
417e8d6ca4 snapshot: Add missing (nullable) annotation 2018-03-13 23:43:29 +01:00
Timm Bäder
d4c9a35193 widget: Simplify setting a default direction
No reason for the second paramter to be a pointer.
2018-03-13 23:43:29 +01:00
Timm Bäder
81a7f8e00c label: Remove dead NULL check
We only create the gesture when priv->select_info is !NULL.
2018-03-13 23:43:29 +01:00
Emmanuele Bassi
73ffb7f5e9 Initialise variables
The dx and dy variables may be left uninitialized by the coordinate
translation — or so the C compiler thinks. Let's avoid a warning when
building.
2018-03-13 16:00:55 +00:00
Matthias Clasen
3b45019ba2 Merge branch 'query-wayland-registry' into 'master'
gtkimmodule: make match_backend() query

See merge request GNOME/gtk!56
2018-03-13 02:09:26 +00:00
Daniel Boles
9aedafa39e FileChooserWidget: Fix leaks in .get_subtitle()
Now that subtitle's default value "Searching" for OPERATION_MODE_SEARCH
is duplicated as it should be, we cannot reassign other strings to it
anymore, as that resulted in the original dupe of "Searching" leaking.

Fix this by only assigning the dup'd "Searching" after trying to get
more specific values, not before. We therefore need to set it to NULL
during its declaration, and that means we needn't in the final else.
2018-03-13 00:20:17 +00:00
Daniel Boles
fc9dc97430 FileChooserWidget: Avoid crash freeing static str
Having a FileChooserDialog in location-entry mode then pressing
<primary>f to move to search mode would crash with an invalid free().

In that case, FileChooserWidget.get_subtitle() returned a static string
straight from gettext. This crashed when the GBinding from :subtitle to
FileChooserDialog’s HeaderBar:subtitle shortly tried to free the string.

Fix by duplicating the string before returning it, like all other paths.

https://bugzilla.gnome.org/show_bug.cgi?id=791004
2018-03-12 23:07:50 +00:00
Peter Bloomfield
86cd5c04bd gtkimmodule: make match_backend() query
…the wayland registry.

Wnen _gtk_im_module_get_default_context_id calls
match_backend (context_id) and the default GdkDisplay
is wayland, match_backend() should return TRUE only if
gdk_wayland_display_query_registry (display, "gtk_text_input_manager")
returns TRUE.
2018-03-12 17:46:57 -04:00
Daniel Boles
5fe14e06da Merge branch 'wip/dboles/frame-yalign-byealign' into 'master'
Frame: Erase the now-useless property label-yalign

See merge request GNOME/gtk!40
2018-03-12 16:17:11 +00:00
Daniel Boles
2072953375 ListBox: Avoid ::row-activated/Row::activate ambig
…uity, by adding a doc comment to Row::activate explaining what it does
and why it is probably not what the user reading that is looking for.

https://bugzilla.gnome.org/show_bug.cgi?id=794008
2018-03-12 16:12:09 +00:00
Daniel Boles
e4578ca7bf Frame: Erase the now-useless property label-yalign
The border is now drawn on the frame node, not using an internal border
node, so we are no longer able to align the label to vertically overlap
the border. The property no longer performs its original purpose, & nor
is it a useful candidate for giving a new role, so no point keeping it.

https://bugzilla.gnome.org/show_bug.cgi?id=778886
2018-03-12 14:17:32 +00:00
Matthias Clasen
da8e83f9cb Exit cleanly if no display is found
We should not try to create an inspector window and generate
tons of ugly warnings in this case.
2018-03-11 08:14:14 -04:00
Marek Černocký
0f533ed61d Fixed typo in script name Kjohki -> Khojki 2018-03-11 08:12:31 +01:00
Matthias Clasen
d55da3fd44 Use GtkSnapshot getters
We can avoid direct struct access and gtksnapshotprivate.h
everywhere.
2018-03-11 00:31:44 -05:00
Matthias Clasen
7c18911c00 GtkSnapshot: Add getters
These getters can be useful when creating new snapshots
in a snapshot() vfunc.
2018-03-11 00:31:44 -05:00
Matthias Clasen
890cd45ce4 Document new snapshot api 2018-03-11 00:31:44 -05:00
Matthias Clasen
eed279ad91 GtkSnapshot: Drop init/finish
We are ont using stack-allocated snapshots anymore.
2018-03-11 00:31:44 -05:00
Matthias Clasen
694f1d8ecd Stop using stack-allocated snapshots
Use the new/free api instead of init/finish
for GtkSnapshot.
2018-03-11 00:31:44 -05:00
Matthias Clasen
e23f641e49 GtkSnapshot: Implement the builder pattern
Make GtkSnapshot a refcounted boxed type, and add
public API that follows the builder pattern described
here: https://blogs.gnome.org/otte/2018/02/03/builders/
2018-03-11 00:31:44 -05:00
Timm Bäder
00d37c80f8 spinbutton: Remove priv pointer 2018-03-09 09:24:20 +01:00
Matthias Clasen
e0771a54a2 Avoid warnings
When generating introspection data, we instantiate types without
calling gtk_init, so make sure that extension points are registered
before the type is trying to implement them.
2018-03-09 02:13:13 -05:00
Timm Bäder
28cda7f516 separator: Remove priv pointer 2018-03-07 20:42:32 +01:00
Timm Bäder
faabb808be menubutton: Remove priv pointer 2018-03-07 20:26:51 +01:00
Timm Bäder
38fa5ab57b widget: Add a translate_coordinates version for doubles
So we can use that one when translating event coordinates. Also adapt
the widgetfocus demo to ensure this works.

We should probably at some point delete either the int or the double
version.
2018-03-07 20:17:39 +01:00
Timm Bäder
034017425c linkbutton: Remove priv pointer 2018-03-07 20:17:39 +01:00
Timm Bäder
4dfe4a6476 expander: Remove label-fill property
It's just setting some internal boolean and nothing else. It's like this
in gtk3 as well so it can't be too important either.
2018-03-07 20:17:39 +01:00
Timm Bäder
6cc824af43 Merge branch 'expander-add-like-bin' into 'master'
expander: Check for an existing child when adding

See merge request GNOME/gtk!48
2018-03-07 19:09:30 +00:00
Benjamin Otte
db6fed1496 overlay: Add GtkOverlay::measure child property
It determines whether a child is included in the overlay's size
measurement.

The first user is (gonna be) GtkVideo.
2018-03-07 16:17:15 +01:00
Benjamin Otte
325f6121ba eventcontroller: Remove unused evmask member variable 2018-03-07 16:17:15 +01:00
Benjamin Otte
074e7001dc eventcontroller: Get rid of constructed vfunc
Instead, add the controller to the widget in set_property.
2018-03-07 16:17:15 +01:00
Benjamin Otte
160e6ad6f6 gdk: Split out GL texture
Put GdkGLTexture into its own file and rename the API to
gdk_gl_texture_foo() instead of gdk_texture_foo_for_gl().

Apart from naming, no actual code changes.
2018-03-07 16:17:15 +01:00
Carlos Garnacho
b49c6cdcb1 imwayland: Fix parent type
It was inadvertently changed in commit 15cc20e7b.

https://gitlab.gnome.org/GNOME/gtk/issues/58

Closes: #58
2018-03-07 10:58:22 +01:00
Matthias Clasen
5ec41fb47b Make debug messages work earlier
We need to be able to produce debug output during module
loading. This change ensures that we can.
2018-03-06 20:54:26 -05:00
Peter Bloomfield
a207ab6105 expander: Check for an existing child when adding
Now that GtkExpander subclasses GtkContainer instead of GtkBin, it needs
its own guard against adding more than one child.

Also, the documentation should no longer describe adding a child as if
it is descended from GtkBin.
2018-03-06 14:26:08 -05:00
Timm Bäder
de537a0755 entry: Fix invisible cursors 2018-03-06 20:04:30 +01:00
Timm Bäder
f5e290517a expander: fix sizes in resize_toplevel
We can't use gtk_widget_get_allocation for either non-anchored widgets
(which happens with the child widget when the expander is unexpanded)
nor toplevel windows since that will include the window decorations.

Fixes #70 in gtk4
2018-03-06 18:12:49 +01:00
Timm Bäder
7dc4669d01 viewport: Remove priv pointer 2018-03-06 14:37:28 +01:00
Timm Bäder
22457822eb expander: Attach the gesture to the title widget
Instead of tracking whether the click happened inside the title widget
ourselves, just attach the gesture to the title widget.
2018-03-05 17:24:22 +01:00
Timm Bäder
84b4f85f1a overlay: Make forall() remove-safe
Since this is a GtkContainer, forall will be used to destroy all the
widgets.
2018-03-04 20:04:43 +01:00
Timm Bäder
0bb1e1b1fd overlay: Fix GSlide/g_free mixup
We free the allocated data later using g_free, so don't use GSlice when
allocating it.
2018-03-04 20:04:17 +01:00