gtk4.git
2 years agomacos: Move native window creation to ::constructed()
Benjamin Otte [Thu, 20 Apr 2023 15:38:57 +0000 (17:38 +0200)]
macos: Move native window creation to ::constructed()

That way, it doesn't need a specific init function.

Also chain up last, so that the generic initialization code in
GdkSurface::constructed can access a fully initialized macos surface.

2 years agomacos: Don't pass sizes to macos_surface_new()
Benjamin Otte [Tue, 18 Apr 2023 14:41:05 +0000 (16:41 +0200)]
macos: Don't pass sizes to macos_surface_new()

They're 0, 0, 100, 100 always, so just use those values everywhere.

2 years agomacos: Create drag surface directly
Benjamin Otte [Tue, 18 Apr 2023 14:38:57 +0000 (16:38 +0200)]
macos: Create drag surface directly

Do not go via macos_surface_new().

2 years agomacos: Move construction stuff into ::constructed
Benjamin Otte [Tue, 18 Apr 2023 14:37:43 +0000 (16:37 +0200)]
macos: Move construction stuff into ::constructed

2 years agomacos: toplevels have no parent
Benjamin Otte [Tue, 18 Apr 2023 14:15:59 +0000 (16:15 +0200)]
macos: toplevels have no parent

2 years agowin32: Move surface init code into ::constructed()
Benjamin Otte [Mon, 17 Apr 2023 02:27:11 +0000 (04:27 +0200)]
win32: Move surface init code into ::constructed()

2 years agowin32: Abort on error
Benjamin Otte [Mon, 17 Apr 2023 02:16:50 +0000 (04:16 +0200)]
win32: Abort on error

Returning NULL from a function that must not return NULL is not a good
idea.

2 years agowin32: Remove outdated debug messages
Benjamin Otte [Mon, 17 Apr 2023 02:11:16 +0000 (04:11 +0200)]
win32: Remove outdated debug messages

They are not needed anymore as they print stuff that's no decided in
that function anymore.

2 years agowin32: Move toplevel signal into the toplevel class
Benjamin Otte [Mon, 17 Apr 2023 02:07:43 +0000 (04:07 +0200)]
win32: Move toplevel signal into the toplevel class

2 years agobroadway: Pass parent as a construct argument
Benjamin Otte [Mon, 17 Apr 2023 00:32:13 +0000 (02:32 +0200)]
broadway: Pass parent as a construct argument

2 years agox11: Get rid of sizes when constructing surfaces
Benjamin Otte [Mon, 17 Apr 2023 00:17:03 +0000 (02:17 +0200)]
x11: Get rid of sizes when constructing surfaces

Just call XCreateWindow with 0, 0, 1, 1 size.

2 years agox11: Remove unused variable
Benjamin Otte [Sun, 16 Apr 2023 23:34:24 +0000 (01:34 +0200)]
x11: Remove unused variable

2 years agowayland: Move surface initialization into constructed()
Benjamin Otte [Sun, 16 Apr 2023 23:26:45 +0000 (01:26 +0200)]
wayland: Move surface initialization into constructed()

That way, it doesn't ned a specific init function.

Also chain up last, so that the generic initialization code can access a
fully initialized wayland surface.

2 years agowayland: Move toplevel-specific code into the toplevel
Benjamin Otte [Sun, 16 Apr 2023 23:26:16 +0000 (01:26 +0200)]
wayland: Move toplevel-specific code into the toplevel

The display->toplevels tracking belongs to GdkWAylandToplevel.

2 years agodisplay: Remove x/y/w/h from create_surface()
Benjamin Otte [Sat, 15 Apr 2023 18:06:36 +0000 (20:06 +0200)]
display: Remove x/y/w/h from create_surface()

2 years agoMerge branch 'application-signal-cleanup' into 'main'
Matthias Clasen [Wed, 26 Apr 2023 13:11:43 +0000 (13:11 +0000)]
Merge branch 'application-signal-cleanup' into 'main'

application: Clean up signal handlers

See merge request GNOME/gtk!5872

2 years agoapplication: Clean up signal handlers
Matthias Clasen [Wed, 26 Apr 2023 12:09:44 +0000 (14:09 +0200)]
application: Clean up signal handlers

This is the right thing to do and might help for #5775.

2 years agoMerge branch 'win32-warnings' into 'main'
Matthias Clasen [Wed, 26 Apr 2023 06:58:09 +0000 (06:58 +0000)]
Merge branch 'win32-warnings' into 'main'

Fix some win32 warnings

See merge request GNOME/gtk!5868

2 years agoMerge branch 'pathbar-webdav-root' into 'main'
Matthias Clasen [Wed, 26 Apr 2023 06:50:10 +0000 (06:50 +0000)]
Merge branch 'pathbar-webdav-root' into 'main'

pathbar: Handle webdav where is the root is a path

Closes #2866

See merge request GNOME/gtk!5830

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 26 Apr 2023 06:49:32 +0000 (06:49 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gsk: Don't misuse bitwise operators

See merge request GNOME/gtk!5869

2 years agoMerge branch 'modelbutton-no-click-outside' into 'main'
Matthias Clasen [Wed, 26 Apr 2023 05:56:31 +0000 (05:56 +0000)]
Merge branch 'modelbutton-no-click-outside' into 'main'

gtkmodelbutton: Ignore releases outside of the button

Closes #5760

See merge request GNOME/gtk!5852

2 years agoUpdate Galician translation
Fran Dieguez [Tue, 25 Apr 2023 23:22:20 +0000 (23:22 +0000)]
Update Galician translation

(cherry picked from commit 7470bc01f25123ed57e36eaf4e2a5c98203a03da)

2 years agogtkmodelbutton: Ignore releases outside of the button
Sebastian Keller [Thu, 20 Apr 2023 22:31:53 +0000 (00:31 +0200)]
gtkmodelbutton: Ignore releases outside of the button

This is also how regular buttons behave. Otherwise releasing on a
different menu item would register a click on the item that was
originally pressed. In these cases it is better to not register a click
at all.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5760
2 years agogsk: Don't misuse bitwise operators
Matthias Clasen [Tue, 25 Apr 2023 14:43:02 +0000 (16:43 +0200)]
gsk: Don't misuse bitwise operators

We should use && for booleans, not &=.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Tue, 25 Apr 2023 12:48:13 +0000 (12:48 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gsk: Don't misuse bitwise operators

See merge request GNOME/gtk!5867

2 years agogtk/win32: fix usage of deprecated function
Marc-André Lureau [Tue, 25 Apr 2023 12:27:40 +0000 (16:27 +0400)]
gtk/win32: fix usage of deprecated function

[106/939] Compiling C object gtk/libgtk.a.p/gtkimcontextime.c.obj
../gtk/gtkimcontextime.c: In function 'gtk_im_context_ime_set_preedit_font':
../gtk/gtkimcontextime.c:780:3: warning: 'gtk_widget_get_style_context' is deprecated [-Wdeprecated-declarations]
  780 |   font_desc = gtk_css_style_get_pango_font (gtk_style_context_lookup_style (gtk_widget_get_style_context (context_ime->client_widget)));

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogdk/win32: fix defined but not used warnings
Marc-André Lureau [Tue, 25 Apr 2023 12:22:34 +0000 (16:22 +0400)]
gdk/win32: fix defined but not used warnings

[30/1038] Compiling C object gdk/win32/libgdk-win32.a.p/gdkmain-win32.c.obj
../gdk/win32/gdkmain-win32.c:146:1: warning: 'gdk_win32_finalize_ole' defined but not used [-Wunused-function]
  146 | gdk_win32_finalize_ole (void)
      | ^~~~~~~~~~~~~~~~~~~~~~
../gdk/win32/gdkmain-win32.c:113:1: warning: 'gdk_win32_finalize_com' defined but not used [-Wunused-function]
  113 | gdk_win32_finalize_com (void)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogdk/win32: fix `hr` set but not used
Marc-André Lureau [Tue, 25 Apr 2023 12:18:26 +0000 (16:18 +0400)]
gdk/win32: fix `hr` set but not used

A number of warnings are produced:

[23/1038] Compiling C object gdk/win32/libgdk-win32.a.p/gdkinput-dmanipulation.c.obj
../gdk/win32/gdkinput-dmanipulation.c: In function 'reset_viewport':
../gdk/win32/gdkinput-dmanipulation.c:354:11: warning: variable 'hr' set but not used [-Wunused-but-set-variable]
  354 |   HRESULT hr;
      |           ^~

Try to do something sensible instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogdk/win32: fix g_string_free warning
Marc-André Lureau [Tue, 25 Apr 2023 12:14:55 +0000 (16:14 +0400)]
gdk/win32: fix g_string_free warning

../gdk/win32/gdkclipdrop-win32.c: In function 'transmute_cf_shell_id_list_to_text_uri_list':
C:/msys64/ucrt64/include/glib-2.0/glib/gstring.h:72:5: warning: ignoring return value of 'g_string_free_and_steal' declared with attribute 'warn_unused_result' [-Wunused-result]

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogdk/win32: fix GDK_NOTE redefined warning
Marc-André Lureau [Tue, 25 Apr 2023 12:11:03 +0000 (16:11 +0400)]
gdk/win32: fix GDK_NOTE redefined warning

In file included from ../gdk/win32/gdkdrag-win32.c:201:
../gdk/win32/gdkprivate-win32.h:45: warning: "GDK_NOTE" redefined
   45 | #define GDK_NOTE(type,action)                             \
      |
../gdk/win32/gdkdrag-win32.c:40: note: this is the location of the previous definition
   40 | #define GDK_NOTE(a,b)

Fixes: bc159207bd0 ("gdk: Drop old debug macros")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogsk: Don't misuse bitwise operators
Matthias Clasen [Tue, 25 Apr 2023 11:30:09 +0000 (13:30 +0200)]
gsk: Don't misuse bitwise operators

We should use || for booleans, not |=.

2 years agoMerge branch 'label_get_active_uri' into 'main'
Matthias Clasen [Tue, 25 Apr 2023 11:22:34 +0000 (11:22 +0000)]
Merge branch 'label_get_active_uri' into 'main'

Fix hovered link URI not returned by gtk_label_get_current_uri

See merge request GNOME/gtk!5864

2 years agoMerge branch 'icontheme-has-icon-consistency' into 'main'
Matthias Clasen [Tue, 25 Apr 2023 07:49:12 +0000 (07:49 +0000)]
Merge branch 'icontheme-has-icon-consistency' into 'main'

icontheme: make has_(g)icon consistent with lookup

Closes #5709

See merge request GNOME/gtk!5865

2 years agoMerge branch 'null-display' into 'main'
Matthias Clasen [Tue, 25 Apr 2023 07:46:21 +0000 (07:46 +0000)]
Merge branch 'null-display' into 'main'

gdkdisplaymanager: Add missing nullable to display name

See merge request GNOME/gtk!5866

2 years agogdkdisplaymanager: Add missing nullable to display name
Takao Fujiwara [Tue, 25 Apr 2023 03:08:08 +0000 (12:08 +0900)]
gdkdisplaymanager: Add missing nullable to display name

2 years agoicontheme: make has_(g)icon consistent with lookup
velsinki [Mon, 24 Apr 2023 21:38:20 +0000 (23:38 +0200)]
icontheme: make has_(g)icon consistent with lookup

Make `gtk_icon_theme_has_icon` and `gtk_icon_theme_has_gicon` also
consider unthemed icons. This makes their behavior consistent with the
actual (documented) lookup behavior.

Fixes: #5709 and makes the workaround in nautilus@b643a00b obsolete
2 years agoFix hovered link URI not returned by gtk_label_get_current_uri
Chris Mayo [Mon, 24 Apr 2023 18:35:47 +0000 (19:35 +0100)]
Fix hovered link URI not returned by gtk_label_get_current_uri

This is needed for a query-tooltip handler, as mentioned in the
documentation, when there has been a hover timeout.

Maintain the previous behaviour when the link is clicked and follow the
existing documentation regarding selectable labels.

A notify::cursor handler can now also be used to retrieve the URI of the
link under the cursor.

2 years agoMerge branch 'ebassi/button-can-shrink' into 'main'
Matthias Clasen [Mon, 24 Apr 2023 12:28:12 +0000 (12:28 +0000)]
Merge branch 'ebassi/button-can-shrink' into 'main'

Add GtkButton:can-shrink

See merge request GNOME/gtk!5552

2 years agoAdd GtkMenuButton:can-shrink
Emmanuele Bassi [Fri, 14 Apr 2023 12:08:13 +0000 (13:08 +0100)]
Add GtkMenuButton:can-shrink

Map the GtkMenuButton property to the underlying GtkButton widget.

2 years agoUpdate Turkish translation
Sabri Ünal [Sun, 23 Apr 2023 21:12:44 +0000 (21:12 +0000)]
Update Turkish translation

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Sat, 22 Apr 2023 15:10:02 +0000 (15:10 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

surface: Clean up drawing code

See merge request GNOME/gtk!5861

2 years agosurface: reformat function
Benjamin Otte [Sat, 22 Apr 2023 14:35:16 +0000 (16:35 +0200)]
surface: reformat function

Make the function follow usual coding conventions.

And while doing that, remove duplicate functionality.

2 years agosurface: Refactor code
Benjamin Otte [Sat, 22 Apr 2023 14:33:35 +0000 (16:33 +0200)]
surface: Refactor code

Move the early exit conditions to the top and turn them into early exits
instead of nesting if statements.

2 years agosurface: Fold function into its only caller
Benjamin Otte [Sat, 22 Apr 2023 14:29:58 +0000 (16:29 +0200)]
surface: Fold function into its only caller

No other changes

2 years agosurface: Stop maintaining an unused linked list
Benjamin Otte [Sat, 22 Apr 2023 14:27:27 +0000 (16:27 +0200)]
surface: Stop maintaining an unused linked list

wat?

2 years agosurface: Remove in_update tracking
Benjamin Otte [Sat, 22 Apr 2023 14:24:16 +0000 (16:24 +0200)]
surface: Remove in_update tracking

It's 2023, we use frame clocks now and don't have nested surface drawing
anymore.

2 years agosurface: Stop tracking the active update area
Benjamin Otte [Sat, 22 Apr 2023 14:10:24 +0000 (16:10 +0200)]
surface: Stop tracking the active update area

It's unused.

2 years agoUpdate Russian translation
Aleksandr Melman [Sat, 22 Apr 2023 12:03:07 +0000 (12:03 +0000)]
Update Russian translation

2 years agoUpdate Polish translation
Piotr Drąg [Sat, 22 Apr 2023 09:16:08 +0000 (11:16 +0200)]
Update Polish translation

2 years agoMerge branch 'gtkfilesystemmodel-emit-items-changed-on-modifying-attributes' into...
Matthias Clasen [Sat, 22 Apr 2023 05:54:58 +0000 (05:54 +0000)]
Merge branch 'gtkfilesystemmodel-emit-items-changed-on-modifying-attributes' into 'main'

filesystemmodel: Emit items-changed when modifying attributes

Closes #5758

See merge request GNOME/gtk!5853

2 years agofilesystemmodel: Emit items-changed when modifying attributes
Olivier Crête [Sat, 22 Apr 2023 05:54:57 +0000 (05:54 +0000)]
filesystemmodel: Emit items-changed when modifying attributes

2 years agoMerge branch 'wip/corey/file-chooser-signal' into 'main'
Matthias Clasen [Sat, 22 Apr 2023 05:26:43 +0000 (05:26 +0000)]
Merge branch 'wip/corey/file-chooser-signal' into 'main'

Port filechooserwidget to GtkSignalListItemFactory

See merge request GNOME/gtk!5858

2 years agofilechoosercell: Drop show-time property
Corey Berla [Fri, 21 Apr 2023 14:49:03 +0000 (07:49 -0700)]
filechoosercell: Drop show-time property

Now that we are using GtkSignalListItemFactory, the convoluted show-time
property is no longer necessary.

2 years agofilechooserwidget: Port to GtkSignalListItemFactory
Corey Berla [Fri, 21 Apr 2023 14:45:08 +0000 (07:45 -0700)]
filechooserwidget: Port to GtkSignalListItemFactory

BuilderListItemFactory isn't quite suited for our purposes, primarily
because you can't pass user data to BuilderListItemFactory.  Because
we can't get the data we are using a workaround to get the
GtkFileChooserWidget ancestory, which used to work, but with the
recent list view changes no longer doesn't.  Use GtkSignalListItemFactory
with the GtkFileChooserWidget as the user data.

2 years agoRevert "filechooser: Set date and time after cell is a child of filechooserwidget"
Corey Berla [Fri, 21 Apr 2023 03:20:10 +0000 (20:20 -0700)]
Revert "filechooser: Set date and time after cell is a child of filechooserwidget"

This reverts commit 2a70093a309481cf633086a5e8f0c8bc6d2c89f0.

This fix was incomplete, the actual fix is to use signal factory.

2 years agoRevert "filechoosercell: Store type_format in filechoosercell"
Corey Berla [Fri, 21 Apr 2023 03:18:58 +0000 (20:18 -0700)]
Revert "filechoosercell: Store type_format in filechoosercell"

This reverts commit dd407dab000dc4de7d078c6270c93d303a1c18c6.

This fix was incomplete, the actual fix is to use signal factory.

2 years agoUpdate Portuguese translation
Hugo Carvalho [Fri, 21 Apr 2023 14:30:47 +0000 (14:30 +0000)]
Update Portuguese translation

(cherry picked from commit 5bc3284dd873ae13ef5aa883cb324b4979c9762c)

2 years agoUpdate Hebrew translation
Yosef Or Boczko [Fri, 21 Apr 2023 09:10:12 +0000 (09:10 +0000)]
Update Hebrew translation

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Thu, 20 Apr 2023 21:50:44 +0000 (21:50 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

testsuite: Be less verbose in accessor-apis test

Closes #5763

See merge request GNOME/gtk!5851

2 years agolistbase: Don't warn on scroll in empty list
Benjamin Otte [Thu, 20 Apr 2023 17:07:08 +0000 (19:07 +0200)]
listbase: Don't warn on scroll in empty list

Empty lists can still be scrolled if the scroll happens in the same
frame as the emptying of the list.

Related: #5763

2 years agoadjustment: sanity-check values when setting them
Benjamin Otte [Thu, 20 Apr 2023 17:00:08 +0000 (19:00 +0200)]
adjustment: sanity-check values when setting them

It's not enough to sanitize values when starting an animation, as the
adjustment can reconfigure itself while the animation runs.
So as a simple way to handle this, we sanitize every value right before
setting it, too.

In the future we might also want to look at sanitizing start/end values
of the animation.

Fixes #5763

2 years agoadjustment: Split out a function
Benjamin Otte [Thu, 20 Apr 2023 16:52:49 +0000 (18:52 +0200)]
adjustment: Split out a function

2 years agoMerge branch 'dark_theme_fix_hover_toolbar_buttons' into 'main'
Matthias Clasen [Thu, 20 Apr 2023 20:08:31 +0000 (20:08 +0000)]
Merge branch 'dark_theme_fix_hover_toolbar_buttons' into 'main'

theme: fix 'hover' and 'check' colors for buttons under .toolbar

See merge request GNOME/gtk!5844

2 years agoMerge branch 'dark_theme_increase_selection_color' into 'main'
Matthias Clasen [Thu, 20 Apr 2023 20:08:01 +0000 (20:08 +0000)]
Merge branch 'dark_theme_increase_selection_color' into 'main'

Increase contrast for text entry selection color on dark theme

See merge request GNOME/gtk!5843

2 years agotestsuite: Allow accessors in interfaces
Benjamin Otte [Thu, 20 Apr 2023 15:32:36 +0000 (17:32 +0200)]
testsuite: Allow accessors in interfaces

There are a lot of cases where properties are implemented in classes but
the getters for these exist in an interface that class implements.

A common Example is g_list_model_get_n_items() being the getter for
GtkWhateverListModel::n-items.
But also property implementations that don't use override_property()
(usually because they have a different default) are handled by this.

2 years agotestsuite: Be less verbose in accessor-apis test
Benjamin Otte [Thu, 20 Apr 2023 15:31:57 +0000 (17:31 +0200)]
testsuite: Be less verbose in accessor-apis test

Only print the tried names when --verbose is passed to the test.

2 years agoUpdate Turkish translation
Emin Tufan Çetin [Wed, 19 Apr 2023 13:22:31 +0000 (13:22 +0000)]
Update Turkish translation

2 years agoMerge branch 'mask-node-transforms' into 'main'
Matthias Clasen [Wed, 19 Apr 2023 07:44:45 +0000 (07:44 +0000)]
Merge branch 'mask-node-transforms' into 'main'

Fix a comment

See merge request GNOME/gtk!5848

2 years agogsk: Use explicit switches
Matthias Clasen [Wed, 19 Apr 2023 07:19:12 +0000 (09:19 +0200)]
gsk: Use explicit switches

This makes it harder to forget to add new
node types here.

2 years agogsk: Mask nodes support 2d transforms
Matthias Clasen [Wed, 19 Apr 2023 06:13:55 +0000 (08:13 +0200)]
gsk: Mask nodes support 2d transforms

When adding mask nodes, I overlooked that
we have two separate functions for determining
what transforms a node supports without offlines.

Since we claim that mask nodes support general
transform, they must certainly support 2d transforms
as well.

2 years agoFix a comment
Matthias Clasen [Wed, 19 Apr 2023 05:48:58 +0000 (07:48 +0200)]
Fix a comment

I tried to improve things in d67101d46e7d8647,
but I made it worse. The original note was meant
to be removed. Pointed out be Sebastian Bacher.

2 years agoMerge branch 'angle-gles' into 'main'
Benjamin Otte [Mon, 17 Apr 2023 11:56:03 +0000 (11:56 +0000)]
Merge branch 'angle-gles' into 'main'

gdk: prefer GLES when on win32/ANGLE

See merge request GNOME/gtk!5829

2 years agogdk/win32: drop some unused variables
Marc-André Lureau [Sun, 16 Apr 2023 17:23:49 +0000 (21:23 +0400)]
gdk/win32: drop some unused variables

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogdk: drop libangle GLES minimum version
Marc-André Lureau [Sat, 15 Apr 2023 10:33:20 +0000 (14:33 +0400)]
gdk: drop libangle GLES minimum version

GLES 2.0 version is fine now with current gtk according to B. Otte.
Let's use the same minimum requirement for all implementations.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogdk: use GLES when on win32/ANGLE
Marc-André Lureau [Thu, 13 Apr 2023 15:22:21 +0000 (19:22 +0400)]
gdk: use GLES when on win32/ANGLE

When using GDK_DEBUG=gl-egl, we end up using GL, but that is not well supported:

Creating EGL context version 3.0 (debug:no, forward:no, legacy:yes, es:no)
Created EGL context[0000000000000004]
OpenGL version: 0.0 (legacy)
* GLSL version: (NULL)
* Max texture size: -1059701680
* Extensions checked:
 - GL_KHR_debug: no
 - GL_EXT_unpack_subimage: yes
 - OES_vertex_half_float: no

** (gtk4-demo.exe:14324): WARNING **: 19:16:41.468: Compile failure in
vertex shader:
ERROR: 0:7: 'gl_Position' : undeclared identifier
---8<---

Use GLES when EGL implementation is ANGLE.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogdk: drop unused vertex_array_object
Marc-André Lureau [Sat, 15 Apr 2023 10:35:04 +0000 (14:35 +0400)]
gdk: drop unused vertex_array_object

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Mon, 17 Apr 2023 04:49:59 +0000 (04:49 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

glrenderer: Don't try to use float framebuffers on GLES2

See merge request GNOME/gtk!5845

2 years agogl: Only allow RGB(A)8 on GLES2
Benjamin Otte [Mon, 17 Apr 2023 03:42:19 +0000 (05:42 +0200)]
gl: Only allow RGB(A)8 on GLES2

GLES2 has no idea what 16bit textures even are, let alone floating point.

2 years agoglrenderer: Don't try to use float framebuffers on GLES2
Benjamin Otte [Mon, 17 Apr 2023 03:41:34 +0000 (05:41 +0200)]
glrenderer: Don't try to use float framebuffers on GLES2

GLES doesn't know what that is.

2 years agotheme: more contrast for text entry selection color on dark theme
Nelson Benítez León [Sun, 16 Apr 2023 18:15:58 +0000 (14:15 -0400)]
theme: more contrast for text entry selection color on dark theme

Part of #5725

2 years agotheme: fix 'hover' and 'check' colors for buttons under .toolbar
Nelson Benítez León [Sun, 16 Apr 2023 20:16:10 +0000 (16:16 -0400)]
theme: fix 'hover' and 'check' colors for buttons under .toolbar

Buttons under .toolbar were using for their 'hover', 'active'
and 'check' colors the default ones from %button_basic_flat
which are very dimmed, so we explicitly darken them.

Part of #5725

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sun, 16 Apr 2023 20:00:46 +0000 (20:00 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Try harder to fix focus tests

See merge request GNOME/gtk!5842

2 years agotestsuite: Skip focus tests when necessary
Matthias Clasen [Sun, 16 Apr 2023 18:58:26 +0000 (20:58 +0200)]
testsuite: Skip focus tests when necessary

If our window does not get focus, we can't reliably
test things that depend on widgets being focused.

2 years agoMerge branch 'ccook/doc-changes' into 'main'
Matthias Clasen [Sun, 16 Apr 2023 18:16:36 +0000 (18:16 +0000)]
Merge branch 'ccook/doc-changes' into 'main'

Two corrections that show up in docs

See merge request GNOME/gtk!5838

2 years agoTry harder to fix focus tests
Matthias Clasen [Sun, 16 Apr 2023 18:07:13 +0000 (20:07 +0200)]
Try harder to fix focus tests

The focus test now asserts that its window is active.
So we should not run them in parallel with other tests,
since those might steal the focus.

2 years agoMerge branch 'wip/otte/alt.wl_surface.die.die.die' into 'main'
Benjamin Otte [Sun, 16 Apr 2023 18:02:33 +0000 (18:02 +0000)]
Merge branch 'wip/otte/alt.wl_surface.die.die.die' into 'main'

wayland: Don't leak all surfaces

See merge request GNOME/gtk!5840

2 years agotestsuite: Fix broken test to not unref surfaces twice
Benjamin Otte [Sun, 16 Apr 2023 14:57:48 +0000 (16:57 +0200)]
testsuite: Fix broken test to not unref surfaces twice

The test doesn't hold 2 references, it holds only one.

The reason one unref can cause a leak is that some backends - like X11 -
only destroy the surface once the DestroyNotify event from the X server
has come in.

2 years agowayland: Don't leak all surfaces
Benjamin Otte [Sun, 16 Apr 2023 02:39:21 +0000 (04:39 +0200)]
wayland: Don't leak all surfaces

X11 does add an extra reference to surfaces that gets released when the
DestroyNotify event arrives.
Wayland doesn't ave such an event, so that reference never gets
released.

This fixes a copy/paste error introduced in commit 590f3dfa1fcb.

2 years agowayland: Don't insta-crash when a surface gets disposed
Benjamin Otte [Sun, 16 Apr 2023 02:36:12 +0000 (04:36 +0200)]
wayland: Don't insta-crash when a surface gets disposed

We want to remove the event queue from the list of event queues, not the
surface.
Otherwise the freed queue stays in the list and the next time an event
comes in, we access invalid memory.

Fixes thinko introduced in commit 7fafa5133b5.

Luckily, we leak all surfaces, so this problem never occured.

2 years agoMerge branch 'ccook/gtklabel-doc-changes' into 'main'
Matthias Clasen [Sun, 16 Apr 2023 17:07:49 +0000 (17:07 +0000)]
Merge branch 'ccook/gtklabel-doc-changes' into 'main'

GtkLabel doc corrections

See merge request GNOME/gtk!5839

2 years agoMerge branch 'focus-testsuite-fixes' into 'main'
Matthias Clasen [Sun, 16 Apr 2023 07:36:11 +0000 (07:36 +0000)]
Merge branch 'focus-testsuite-fixes' into 'main'

text: Fix fallout from focus changes

See merge request GNOME/gtk!5841

2 years agotestsuite: Actually wait for focus
Matthias Clasen [Sun, 16 Apr 2023 07:11:24 +0000 (09:11 +0200)]
testsuite: Actually wait for focus

We were failing to properly iterate the main
context here. Oops.

2 years agotests: Check is-focus instead of has-focus
Matthias Clasen [Sun, 16 Apr 2023 06:50:35 +0000 (08:50 +0200)]
tests: Check is-focus instead of has-focus

We are not presenting windows here.

2 years agotext: Fix fallout from focus changes
Matthias Clasen [Sun, 16 Apr 2023 06:49:20 +0000 (08:49 +0200)]
text: Fix fallout from focus changes

We don't get proper notification for when the toplevel
is-active property changes, so monitor has-focus, and
update cursor blinking.

2 years ago| method ...
Cam Cook [Sun, 16 Apr 2023 01:48:27 +0000 (21:48 -0400)]
| method                                                                                | current                                                         | suggestion                                                           |
|---------------------------------------------------------------------------------------|-----------------------------------------------------------------|----------------------------------------------------------------------|
| [get_attributes](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L3242) | "use`pango_layout_get_attribute (gtk_label_get_layout (self))`" | "use`pango_layout_get_attributes (gtk_label_get_layout (self))`" [1] |
| [set_yalign](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L5897)     | "(attributes org.gtk.Method.get_property=yalign)"               | "(attributes org.gtk.Method.set_property=yalign)"                    |
| [get_yalign](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L5923)     | "(attributes org.gtk.Method.set_property=yalign)"               | "(attributes org.gtk.Method.get_property=yalign)"                    |
| [set_ellipsize](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L3892)  | "to ellipsizei"                                                 | "to ellipsize"                                                       |
| [get_attributes](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L3239) | "from the labels markup"                                        | "from the label's markup"                                            |

[1] https://docs.gtk.org/Pango/method.Layout.get_attributes.html

2 years ago| method ...
Cam Cook [Sat, 15 Apr 2023 16:41:13 +0000 (12:41 -0400)]
| method                                                                                          | current                                                    | suggestion                                                |
|-------------------------------------------------------------------------------------------------|------------------------------------------------------------|-----------------------------------------------------------|
| [Entry/set_invisible_char](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L2101) | "(attributes org.gtk.Method.sets_property=invisible-char)" | "(attributes org.gtk.Method.set_property=invisible-char)" |
| [FlowBox::activate](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkflowbox.c#L541)       | "This can be happen either by"                             | "This can happen either by"                               |

2 years agoRevert "Two corrections and added method linking that show up in docs"
Cam Cook [Sat, 15 Apr 2023 16:40:22 +0000 (12:40 -0400)]
Revert "Two corrections and added method linking that show up in docs"

This reverts commit c7f30ecdfdb70fd8d4fcc02a4a576dfee0991e28.

2 years agoMerge branch 'wip/otte/gles-fixes' into 'main'
Matthias Clasen [Sat, 15 Apr 2023 16:27:16 +0000 (16:27 +0000)]
Merge branch 'wip/otte/gles-fixes' into 'main'

GLES 2 fixes

See merge request GNOME/gtk!5837

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 15 Apr 2023 16:09:32 +0000 (16:09 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

window: Don't mark widget prematurely as has-focus

See merge request GNOME/gtk!5836

2 years agoTwo corrections and added method linking that show up in docs
Cam Cook [Sat, 15 Apr 2023 16:08:46 +0000 (12:08 -0400)]
Two corrections and added method linking that show up in docs

| method                                                                                          | current                                                    | suggestion                                                |
|-------------------------------------------------------------------------------------------------|------------------------------------------------------------|-----------------------------------------------------------|
| [Entry/set_invisible_char](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L2101) | "(attributes org.gtk.Method.sets_property=invisible-char)" | "(attributes org.gtk.Method.set_property=invisible-char)" |
| [FlowBox::activate](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkflowbox.c#L541)       | "This can be happen either by"                             | "This can happen either by"                               |

| method                                                                                                    | current                                                | suggestion                                                   |
|-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------|--------------------------------------------------------------|
| [Box/get_baseline_position](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkbox.c#L461)             | "value set by gtk_box_set_baseline_position()."        | "value set by [method@Gtk.Box.set_baseline_position]."       |
| [Box/get_spacing](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkbox.c#L412)                       | "value set by gtk_box_set_spacing()."                  | "value set by [method@Gtk.Box.set_spacing]."                 |
| [CenterBox/get_baseline_position](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkcenterbox.c#L528) | "value set by gtk_center_box_set_baseline_position()." | "value set by [method@Gtk.CenterBox.set_baseline_position]." |
| [Entry/get_activates_default](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L2296)        | "value set by gtk_entry_set_activates_default()."      | "value set by [method@Gtk.Entry.set_activates_default]."     |
| [Entry/get_alignment](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L2380)                | "value set by gtk_entry_set_alignment()."              | "value set by [method@Gtk.Entry.set_alignment]."             |
| [Entry/get_extra_menu](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L3727)               | "set with gtk_entry_set_extra_menu()."                 | "set with [method@Gtk.Entry.set_extra_menu]."                |
| [Entry/get_has_frame](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L2340)                | "value set by gtk_entry_set_has_frame()."              | "value set by [method@Gtk.Entry.set_has_frame]."             |
| [Entry/get_progress_pulse_step](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L3372)      | "set with gtk_entry_set_progress_pulse_step()."        | "set with [method@Gtk.Entry.set_progress_pulse_step]."       |
| [Fixed/get_child_transform](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkfixed.c#L314)           | "set using gtk_fixed_set_child_transform()."           | "set using [method@Gtk.Fixed.set_child_transform]."          |