Commit Graph

75860 Commits

Author SHA1 Message Date
Benjamin Otte
a79ae95e7e broadway: Move surface init code into ::constructed() 2023-04-26 21:03:34 +02:00
Benjamin Otte
77fe9116af win32: Set frame clock in constructed()
... instead of passing it as construct argument.
2023-04-26 21:03:34 +02:00
Benjamin Otte
808cde74be wayland: Construct the frame clock in the surface
... instead of passing it to g_object_new().
2023-04-26 21:03:34 +02:00
Benjamin Otte
13120ccf9d surface: Make gdk_surface_set_frame_clock() available
... to backends.

That way, frame clocks can be constructed by the backends' surface
implementations and dont need to be passed in as construct arguments.

Also add an assertion that they are indeed constructed.
2023-04-26 21:03:34 +02:00
Benjamin Otte
a306401023 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.
2023-04-26 21:03:34 +02:00
Benjamin Otte
7e18a1cea7 macos: Don't pass sizes to macos_surface_new()
They're 0, 0, 100, 100 always, so just use those values everywhere.
2023-04-26 21:03:34 +02:00
Benjamin Otte
9a6e6be785 macos: Create drag surface directly
Do not go via macos_surface_new().
2023-04-26 21:03:34 +02:00
Benjamin Otte
093a4e83d5 macos: Move construction stuff into ::constructed 2023-04-26 21:03:34 +02:00
Benjamin Otte
428798b53f macos: toplevels have no parent 2023-04-26 21:03:34 +02:00
Benjamin Otte
4fa81cf70f win32: Move surface init code into ::constructed() 2023-04-26 21:03:34 +02:00
Benjamin Otte
9ac31fe0a0 win32: Abort on error
Returning NULL from a function that must not return NULL is not a good
idea.
2023-04-26 21:03:34 +02:00
Benjamin Otte
69fabb3ce9 win32: Remove outdated debug messages
They are not needed anymore as they print stuff that's no decided in
that function anymore.
2023-04-26 21:03:34 +02:00
Benjamin Otte
f59c230a96 win32: Move toplevel signal into the toplevel class 2023-04-26 21:03:34 +02:00
Benjamin Otte
80d99b893e broadway: Pass parent as a construct argument 2023-04-26 21:03:34 +02:00
Benjamin Otte
cbe89b955a x11: Get rid of sizes when constructing surfaces
Just call XCreateWindow with 0, 0, 1, 1 size.
2023-04-26 21:03:34 +02:00
Benjamin Otte
2d827978a6 x11: Remove unused variable 2023-04-26 21:03:34 +02:00
Benjamin Otte
b2e304189e 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.
2023-04-26 21:03:34 +02:00
Benjamin Otte
35c2d85468 wayland: Move toplevel-specific code into the toplevel
The display->toplevels tracking belongs to GdkWAylandToplevel.
2023-04-26 21:03:34 +02:00
Benjamin Otte
7ef5f6ef1a display: Remove x/y/w/h from create_surface() 2023-04-26 21:03:34 +02:00
Matthias Clasen
9364da673f Merge branch 'application-signal-cleanup' into 'main'
application: Clean up signal handlers

See merge request GNOME/gtk!5872
2023-04-26 13:11:43 +00:00
Matthias Clasen
c87b193d2a application: Clean up signal handlers
This is the right thing to do and might help for #5775.
2023-04-26 14:15:31 +02:00
Matthias Clasen
045ab0f107 Merge branch 'win32-warnings' into 'main'
Fix some win32 warnings

See merge request GNOME/gtk!5868
2023-04-26 06:58:09 +00:00
Matthias Clasen
27d9023ac8 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
2023-04-26 06:50:10 +00:00
Matthias Clasen
8a82e1b8b4 Merge branch 'matthiasc/for-main' into 'main'
gsk: Don't misuse bitwise operators

See merge request GNOME/gtk!5869
2023-04-26 06:49:32 +00:00
Matthias Clasen
8e695f7c56 Merge branch 'modelbutton-no-click-outside' into 'main'
gtkmodelbutton: Ignore releases outside of the button

Closes #5760

See merge request GNOME/gtk!5852
2023-04-26 05:56:31 +00:00
Fran Dieguez
1f886668ce Update Galician translation
(cherry picked from commit 7470bc01f2)
2023-04-25 23:22:28 +00:00
Sebastian Keller
a678e9fdd9 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
2023-04-25 19:28:42 +02:00
Matthias Clasen
74c0171edf gsk: Don't misuse bitwise operators
We should use && for booleans, not &=.
2023-04-25 16:43:02 +02:00
Matthias Clasen
248d13d8dc Merge branch 'matthiasc/for-main' into 'main'
gsk: Don't misuse bitwise operators

See merge request GNOME/gtk!5867
2023-04-25 12:48:13 +00:00
Marc-André Lureau
2d11d3f8d3 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>
2023-04-25 16:37:58 +04:00
Marc-André Lureau
ff9cd989c6 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>
2023-04-25 16:37:58 +04:00
Marc-André Lureau
5b69df96fe 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>
2023-04-25 16:37:58 +04:00
Marc-André Lureau
d8ead56b9c 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>
2023-04-25 16:14:57 +04:00
Marc-André Lureau
0e2d7111eb 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: bc159207bd ("gdk: Drop old debug macros")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-04-25 16:11:11 +04:00
Matthias Clasen
2263db6259 gsk: Don't misuse bitwise operators
We should use || for booleans, not |=.
2023-04-25 13:45:37 +02:00
Matthias Clasen
ec318e911c 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
2023-04-25 11:22:34 +00:00
Matthias Clasen
ed69435a1b Merge branch 'icontheme-has-icon-consistency' into 'main'
icontheme: make has_(g)icon consistent with lookup

Closes #5709

See merge request GNOME/gtk!5865
2023-04-25 07:49:12 +00:00
Matthias Clasen
e111f688c2 Merge branch 'null-display' into 'main'
gdkdisplaymanager: Add missing nullable to display name

See merge request GNOME/gtk!5866
2023-04-25 07:46:21 +00:00
Takao Fujiwara
26e3824d1d gdkdisplaymanager: Add missing nullable to display name 2023-04-25 12:08:08 +09:00
velsinki
e20a5e1bc1 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
2023-04-24 23:38:20 +02:00
Chris Mayo
66cfeb3ad1 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.
2023-04-24 19:35:47 +01:00
Matthias Clasen
63d7756658 Merge branch 'ebassi/button-can-shrink' into 'main'
Add GtkButton:can-shrink

See merge request GNOME/gtk!5552
2023-04-24 12:28:12 +00:00
Emmanuele Bassi
e28676869e Add GtkMenuButton:can-shrink
Map the GtkMenuButton property to the underlying GtkButton widget.
2023-04-24 11:09:01 +01:00
Sabri Ünal
fabfc1eefa Update Turkish translation 2023-04-23 21:12:44 +00:00
Benjamin Otte
72016341c6 Merge branch 'wip/otte/for-main' into 'main'
surface: Clean up drawing code

See merge request GNOME/gtk!5861
2023-04-22 15:10:02 +00:00
Benjamin Otte
104b5ef157 surface: reformat function
Make the function follow usual coding conventions.

And while doing that, remove duplicate functionality.
2023-04-22 16:35:16 +02:00
Benjamin Otte
893862a51a surface: Refactor code
Move the early exit conditions to the top and turn them into early exits
instead of nesting if statements.
2023-04-22 16:33:35 +02:00
Benjamin Otte
823eb4c6d9 surface: Fold function into its only caller
No other changes
2023-04-22 16:29:58 +02:00
Benjamin Otte
be0ed15b40 surface: Stop maintaining an unused linked list
wat?
2023-04-22 16:27:27 +02:00
Benjamin Otte
040af44b00 surface: Remove in_update tracking
It's 2023, we use frame clocks now and don't have nested surface drawing
anymore.
2023-04-22 16:24:16 +02:00