Commit Graph

82444 Commits

Author SHA1 Message Date
Luca Bacci
25c12306fc Fix resizing with native Windows decorations
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5142
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5088
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5090
2024-11-04 12:08:34 +08:00
Chun-wei Fan
dbbeb7efd8 GdkWin32: Clean up gdk_win32_surface_handle_queued_move_resize()
Make that function accept a GdkSurface, not a GdkDrawContext, to make things
clearer to people.
2024-11-04 12:08:34 +08:00
Chun-wei Fan
9a82ebf845 gtk: Define _WIN32_WINNT and friends as cflags
Instead of scattering them around, define _WIN32_WINNT, WINVER and
NTDDIVER in gtk/meson.build, like what we do in GDK-Win32.

Also, since we are requiring Windows 7 or later in GDK-Win32, do
likewise in GTK, since GDK nowadays is in the same DLL/library as GTK,
so we should make things more uniform.
2024-11-04 12:08:34 +08:00
Chun-wei Fan
c829db9192 gdksurface-win32.c: Disable AeroSnap for surface if not resizable
AeroSnap essentially resizes the surface by all means, so if a surface
is not resizable, just bail out of the operation, even though it is
triggered by a move operation.

This matches what is done in Windows.
2024-11-04 12:08:33 +08:00
Chun-wei Fan
14642bff23 gdk[drag|drop]-win32.c: Don't unnecessarily compute scale
The GdkWin32Display object already did that when we created it, so just
use whatever that is stored in there.
2024-11-04 12:08:33 +08:00
Chun-wei Fan
62c4931f4f demos/gtk-demo|widget-factory: Temporarily disable gui_app attribute 2024-11-04 12:08:33 +08:00
Matthias Clasen
ea08d92bc2 Merge branch 'fontchooser-min-size' into 'main'
fontchooser: Make it more shrinkable

See merge request GNOME/gtk!7897
2024-11-04 02:54:08 +00:00
Matthias Clasen
2ad2bae1ca fontchooser: Make it more shrinkable
There were several places where unnecessarily big minimum sizes
were hardcoded. Instead, set a reasonable default size for the
dialog and the let window shrink further.

Helps for mobile situations.

Related: #7133
2024-11-03 20:57:13 -05:00
Emmanuele Bassi
08eab87c42 Merge branch 'meson_schema_install_tag' into 'main'
meson: set install_tag for schema files

See merge request GNOME/gtk!7893
2024-11-02 21:24:18 +00:00
Florian "sp1rit"​
a048ca444c
meson: set install_tag for schema files
To limit the amount of files installed by meson install, users can
specify specific classes of files they actually want to install.

Most to be installed files are automatically tagged by meson correctly
based on what function produced them, but it can't for some (esp. those
installed using install_data/subdir).

As gschema files *should typically* be available at runtime, give them
the "runtime" tag.

See https://mesonbuild.com/Installing.html#installation-tags
2024-11-02 20:32:34 +01:00
Matthias Clasen
64dda64819 Merge branch 'fix-bt709-oetf' into 'main'
gsk: Fix wrong bt709_oetf

See merge request GNOME/gtk!7886
2024-11-01 00:27:59 +00:00
Benjamin Otte
7edb4ecddf Merge branch 'wip/otte/textbuffer-test-win32' into 'main'
win32: Fix textbuffer test

See merge request GNOME/gtk!7873
2024-10-31 16:19:05 +00:00
Matthias Clasen
9f714a9d0a Merge branch 'for-main' into 'main'
Bump the gdk-pixbuf subproject

See merge request GNOME/gtk!7888
2024-10-31 15:00:28 +00:00
Benjamin Otte
13aa4f5fe8 win32: Don't return existing display from gdk_display_open()
Existing code assumes displays are new connections and calls
gdk_display_close() on the display when done with whatever it was
doing.

If we return an existing display, that display gets closed...

It's also what the other backends do, including MacOS.

Fixes gsk/misc test.
2024-10-31 15:27:43 +01:00
Benjamin Otte
06d61c5d39 win32: Stop sending clipboard_hwnd to main thread
With the switch to using the glib main context in the clipboard thread,
the clipboard hwnd is no longer used for sending messages.

This means it's not necessary to know it in the main thread.

And that means there's no small window where the clipboard thread spins
up and the window doesn't exist and any copy operation fails.
The main context can be created before spinning up the thread so
that is avoided.

Fixes the gtk/textbuffer test in the testsuite.
2024-10-31 15:27:43 +01:00
Benjamin Otte
4b4e7276f6 win32: Do async clipboard thread via main loop
Instead of sending windows messages, use the main loop.
This is closer to the expectations of GTK developers and has better
thread safety handling as no HWND is needed as a messaging queue token.
2024-10-31 15:27:43 +01:00
Benjamin Otte
a4323259e5 win32: Split out a function 2024-10-31 15:27:43 +01:00
Benjamin Otte
ae5f581e47 win32: Remove useless code
The function is checking and early-exiting in this situation anyway.
2024-10-31 15:27:43 +01:00
Benjamin Otte
17f391b4e7 win32: "unpop" items from clipboard queue
We can indeed "unpop" items from the clipboard queue, the function is
called g_async_queue_push_front().

So do that instead of tracking a GList.
2024-10-31 15:27:43 +01:00
Benjamin Otte
a7670bfcc5 gdk: Add GDK_DISABLE=aerosnap
Disables the Aerosnap hook for Windows which is particularly useful
when debugging because the aerosnap hook slows down keyboard input.
2024-10-31 15:27:43 +01:00
Benjamin Otte
4b32ac3341 win32: Use the builder argument
We can straight build content formats these days, no need for a detour.
2024-10-31 15:27:43 +01:00
Benjamin Otte
6af853c7a0 win32: Some trivial cleanups
* Make a function static

* Don't lookup function that exists since Windows XP
2024-10-31 15:27:43 +01:00
Benjamin Otte
741b369b2a win32: Remove unused variable
The variable was last used in GTK3.
2024-10-31 15:27:42 +01:00
Benjamin Otte
0b62165bf2 clipboard: Run a GMainLoop in the clipboard thread
Use the new message source to do the task of processing messages.
2024-10-31 15:27:42 +01:00
Benjamin Otte
517ec1112c win32: Add GdkWin32MessageSource
The source does nothing but run PeekMessage() + DispatchMessage().
But we need it in every thread where we want to use a main loop.

No users yet.
2024-10-31 15:27:42 +01:00
Benjamin Otte
8767283722 win32: Don't crash if the settings are empty 2024-10-31 15:27:42 +01:00
Matthias Clasen
033b4c5aa2 build: Tweak gdk-pixbuf subproject
Use builtin loaders by default, so we don't make everybody figure
out how to make gdk-pixbuf find uninstalled loaders.
2024-10-31 09:52:03 -04:00
Matthias Clasen
1e55013228 Bump the gdk-pixbuf subproject
Use the latest release, 2.42.12.
2024-10-31 07:28:51 -04:00
Matthias Clasen
ac37d66bd5 Merge branch 'wip/alice/default-icon' into 'main'
application: Set default window icon to appid by default

Closes #7120

See merge request GNOME/gtk!7885
2024-10-31 00:46:01 +00:00
Matthijs Velsink
b9f83265b6 gsk: Fix wrong bt709_oetf
And use the format from `gdkcolordefs.h` for good measure.
2024-10-30 23:41:47 +01:00
Aurimas Černius
dee4182dc9 Update Lithuanian translation
(cherry picked from commit d09597af8c)
2024-10-30 20:22:20 +00:00
Alice Mikhaylenko
3274a286cc application: Set default window icon to appid by default
Lots of newer apps that use their appid as their icon name don't set
window icons, since they aren't used in GNOME. Instead of setting it
manually in every app, just default to it.

Only set the icon if it exists in the icon theme.

Remove manually set default icons in the demo.

No tests as GtkApplication doesn't have any in the first place.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/7120
2024-10-30 23:39:23 +04:00
Benjamin Otte
20b50c80d3 Merge branch 'for-main' into 'main'
docs: Fix a few copy-paste errors

See merge request GNOME/gtk!7884
2024-10-30 14:39:35 +00:00
Benjamin Otte
8b9ab19f15 docs: Fix various issues in texture builder docs 2024-10-30 09:37:06 -04:00
Matthias Clasen
926e969abb docs: Fix a few copy-paste errors 2024-10-30 09:18:17 -04:00
Matthias Clasen
c8cc8c4842 Merge branch 'amolenaar/color-picker-min-version' into 'main'
macos: Check for minimal macOS SDK version (>= 10.15)

See merge request GNOME/gtk!7881
2024-10-30 11:26:35 +00:00
Arjan Molenaar
0b9d1fc27c meson: Cleanup darwin system check
'ios' is not a meson host manchine system type.
2024-10-30 11:26:00 +01:00
Arjan Molenaar
5b78ee2227 macos: Remove obsolete version check blocks.
All code works on macOS 10.15+.
2024-10-30 11:04:15 +01:00
Arjan Molenaar
64dd9b4bdd macos: use SDK 10.15.6 for macos/intel testing 2024-10-30 10:45:56 +01:00
Arjan Molenaar
6fc6de6123 List available SDKs 2024-10-30 10:39:19 +01:00
Arjan Molenaar
f9cc88aece macos: Assert minmal macOS SDK version in meson file 2024-10-30 10:16:28 +01:00
Matthias Clasen
eea3e8f395 Merge branch 'wip/chergert/quanitize-textview' into 'main'
GtkTextView: allow scrolling in quantized device pixels

See merge request GNOME/gtk!7853
2024-10-30 00:22:20 +00:00
Christian Hergert
462920ea21 gtk/textview: quanitize X/Y by device pixels
This attempts to improve the somewhat "erratic" feeling of scrolling a
GtkTextView with fractional scaling. However, it also improves the
situation where you have a natural integer scaling factor such as 2x.

To do so, it quantizes the X/Y origin of the visible rect to something that
naturally alignes with device pixels. By doing so this aims to get
consistent pixel alignment when hinting so that you no longer see jumps
as the Y position of the buffer changes. X is also done for symmetry.

The buffer itself is left in integer coordinates to avoid any sort
of ABI breakage with existing applications. Only the origin x/y of the
drawing area is affected and thus should only affect the ABI of
gtk_text_view_get_visible_rect() by < 1 device pixel.

Applications which require precision in the visible rect origin may use
the new API introduced here as gtk_text_view_get_visible_offset(). This
provides the X,Y point as doubles. graphene_point_t was not used here
beacuse that appeared to cause aliasing due to float usage.

GNOME/GtkSourceView!375 provides an example of consuming this new API to
keep line numbers aligned in the same fashion as the textview contents.
2024-10-29 14:46:21 -07:00
Emmanuele Bassi
b9fa5abff0 Merge branch 'fix_6663' into 'main'
a11y: When setting the selected state for list items, don't try to be smart and let the a11y layer handle deduplication.

Closes #6663

See merge request GNOME/gtk!7258
2024-10-29 10:51:46 +00:00
Benjamin Otte
9890e0d6db Merge branch 'wip/corey/print-crash' into 'main'
printunixdialog: Set selection after list view item created

Closes #7109

See merge request GNOME/gtk!7880
2024-10-29 10:12:22 +00:00
Emmanuele Bassi
dbf34f1dd8 Merge branch 'active_state_for_all' into 'main'
gtkatspicontext: Allow all widgets to have the active platform state

See merge request GNOME/gtk!7765
2024-10-29 09:41:56 +00:00
Corey Berla
9e1016a581 printunixdialog: Set selection after list view item created
Commit b807b84e16 ("print dialog: Fix initial selection") made a
change where we connect to items-changed before the list item manager.
That leads to us attempting to set a selection for a tile that does
not yet exist.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/7109
2024-10-28 22:25:37 -07:00
Matthias Clasen
3c68746f41 Merge branch 'for-main' into 'main'
Tweak init requirement for displays

See merge request GNOME/gtk!7879
2024-10-29 04:15:05 +00:00
Matthias Clasen
64d56746e8 Tweak init requirement for displays
gdk_display_get_default is nullable, so it is less painful
and more practical to simply return NULL if GDK hasn't been
initialized yet.
2024-10-28 23:45:55 -04:00
Matthias Clasen
6722e3307e Merge branch 'textbuffer-clipboard-charset' into 'main'
textbuffer: Handle charsets in serialization

Closes #7123

See merge request GNOME/gtk!7878
2024-10-29 01:22:02 +00:00