Commit Graph

81944 Commits

Author SHA1 Message Date
Chun-wei Fan
0bc5be78a9 GDK/Win32: Drop global variable on both shifts pressed 2024-09-18 15:29:11 +08:00
Chun-wei Fan
96717f8e20 GDK/Win32: Drop global variable tracking IME state
Tuck it into our GdkDisplay structure under an appropriate sub-struct.
2024-09-18 15:29:11 +08:00
Chun-wei Fan
ebbb79aade GDK/Win32: Fold pen input global vars into GdkDeviceManagerWin32
This way, we just grab and set the values from there.
2024-09-18 15:29:11 +08:00
Chun-wei Fan
9a37721250 GDK/Win32: Drop global variables from GdkKeys implementation
We get to create our GdkKey with a display as a property for free, so
just stuff the default keymap and keymap serial (to track IME state
changes and so) into our GdkWin32Display under an existing sub-struct
that is for holding these items.
2024-09-18 15:29:11 +08:00
Chun-wei Fan
e26288f0c1 Gdk/Win32: Drop _gdk_display global variable
On Windows, we really only support a single GdkDisplay, so we can just
make the GdkDisplay that we obtain a property of our GdkDeviceManagerWin32
and GdkWin32Screen objects, and so we can just do away with the global
_gdk_display global variable.

This way, we can also drop the venerable gdkglobals-win32.c source file.
Yay!
2024-09-18 15:29:11 +08:00
Chun-wei Fan
6f9c095cbc GDK/Win32: Drop modal surface-related global variables
Tuck them into GdkWin32Display as we track these operations.
2024-09-18 15:29:11 +08:00
Chun-wei Fan
044843e358 GdkDeviceManagerWin32: Drop global variables
Tuck the wintab global variables into the GdkDeviceManagerWin32
structure, and initialize and utilize items accordingly.
2024-09-18 15:29:11 +08:00
Chun-wei Fan
5250ba3b14 gdkdisplay-win32.c: Drop debug_indent global variable
Instead, use [Set|Get]WindowLongPtr(), to store and retrieve that
value from the notification window HWND that we are using, as it
is where we are using that value.
2024-09-18 15:29:11 +08:00
Chun-wei Fan
f6ff77c2e9 GDK/Win32: Drop surface tracking global variables
...including the list of modal surfaces and hashes of opened HWNDs for
various surfaces, and tuck them into GdkWin32Display.
2024-09-18 15:29:11 +08:00
Chun-wei Fan
152158d87e GDK/Win32: Drop global variables in Direct Manipuation code
Tuck them into GdkWin32Display.
2024-09-18 15:29:11 +08:00
Chun-wei Fan
b9432d9b1f GDK/Win32: Drop global variables related to GdkDevice
Tuck the _win32_device_manager global variable into GdkWin32Display, and
drop the global variables that have to do with GdkDeviceManagerWin32.

Also improve how we query the WinPointer APIs from user32.dll, so that
we are sure that it is done once and only once.
2024-09-18 15:29:10 +08:00
Chun-wei Fan
0cf455a3a5 GDK/Win32: Drop Clipdrop/DND global variables
Tuck the GdkWin32Clipdrop that we create in our GdkWin32Display, and
tuck the other associated global variables into GdkWin32ClipDrop and
GdkWin32Drag, as appropriate.

Also, since we are already registering "GDK_WORKER_THREAD_WAKEUP" as our
custom message to look for in our DND/clipboard ops, only register it
once, not twice, as it's not really necessary to do so since
RegisterWindowMessage() returns the same value for the same identifier
that is being used.,
2024-09-18 15:29:10 +08:00
Chun-wei Fan
c7d1ac67f7 GDK/Win32: Drop global variable to track main thread
Instead, record the current thread in the GdkDisplay, under a structure
for DND items, which will hold other relevant Windows Clipbord/DND global
variables.

Add a new function in gdkdrag-win32.c to check whether the current
thread is (or is not) equivilant to the thread that is initiated when
the GdkDisplay is initialized (which also returns true if there is no
GdkDisplay that is associated with the GdkDrag in question).
2024-09-18 15:29:10 +08:00
Chun-wei Fan
9e6ad6e04d GDK/Win32: Drop _gdk_ignore_input_core global variable
...and fold it into GdkWin32Display under input_locale_items.
2024-09-18 15:29:10 +08:00
Chun-wei Fan
4d626be70d gdkmain-win32.c: Tuck global varianbles into local variables
...and use g_once_init_[enter|leave]() to mark that GDK did or did not
indeed successfully initialize COM and OLE2.
2024-09-18 15:29:10 +08:00
Chun-wei Fan
51ae9ad4e2 GDK/Win32: Drop input locale global variables
Fold these items into GdkWin32Display, and also fold gdkproperty-win32.c
and gdkwin32langnoticiation.[c|h] into gdkdisplay-win32.c|h].

This way, we get rid of few more global variables, and these items
should have been initialized (and registered with the system) when we
open a GdkWin32Display anyways.
2024-09-18 15:29:10 +08:00
Chun-wei Fan
019e5c9d99 gdksurface-win32.c: Drop a global variable
Use the gdk_win32_surface_parent_class that is given to us by
G_DEFINE_TYPE() instead of using a global variable to store up the
parent class of GdkWin32Surface.
2024-09-18 15:29:10 +08:00
Chun-wei Fan
1fd35d199a demos/gtk-demo|widget-factory: Temporarily disable gui_app attribute 2024-09-18 15:29:10 +08:00
Chun-wei Fan
fd67dbcf60 GDK/Win32: Rename _gdk_win32_get_window_rect()
... to gdk_win32_get_surface_hwnd_rect(), so that things are a bit
clearer.
2024-09-18 15:28:49 +08:00
Chun-wei Fan
eeddb9d241 GDK/Win32: Rename GtkShowWindow() to GtkShowSurfaceHWND()
Makes this function a bit clearer on what is being done.
2024-09-18 15:28:49 +08:00
Chun-wei Fan
a275552088 GDK/Win32: Rename "window" for event handling code
We want to make the distinction between GdkSurface's and native Windows
HWNDs clearer.
2024-09-18 15:28:49 +08:00
Chun-wei Fan
f92761419f gdkprivate-win32.h: Rename "window" as needed
We want to make the distinction between GdkSurface's and native Windows
HWNDs clearer.
2024-09-18 15:28:49 +08:00
Chun-wei Fan
9378ae818a gdkvulkancontext-win32.c: Rename "window" as needed
We want to make the distinction between GdkSurface's and native Windows
HWNDs clear, and we don't want to confuse between GdkSurface's and
Vulkan surfaces.
2024-09-18 15:28:49 +08:00
Chun-wei Fan
f2c88fba19 GDK/Win32: Rename "window" for DND/clipboard code
We want to make the distinction between GdkSurface's and native Windows
HWND clearer.
2024-09-18 15:28:49 +08:00
Chun-wei Fan
ed595a347a gdkdisplay-win32.c: Rename "window" as appropriate
We want to make the distinction between GDK surfaces and the native
(underlying) Windows HWNDs clearer.
2024-09-18 15:28:49 +08:00
Chun-wei Fan
4e2ae96925 GDK/Win32: Rename "window" in GdkDevice/GdkDeviceManager code
Make the distinction between GdkSurfaces and the underlying native
Windows HWND clearer in the code and in the comments.
2024-09-18 15:28:49 +08:00
Chun-wei Fan
951900c3f7 GDK/Win32: Rename "window" items in Cairo context code
Make the distinction between GDK surfaces and native Windows HWNDs
clearer.
2024-09-18 15:28:49 +08:00
Chun-wei Fan
5dc38f1968 GDK/Win32: Rename "window" in gdksurface-win32.* code
In order to help us in our refactoring, make the distinction between Gdk
surfaces and native Win32 HWND clearer in terms of the variables that we
used, and in the comments in the code.

Also, group forward function prototype declarations in one place, and
drop some unneeded items in gdkprivate-win32.h to fold them into
gdksurface-win32.c, as they are only used there.
2024-09-18 15:28:49 +08:00
Emin Tufan Çetin
0600357373 Update Turkish translation 2024-09-18 07:05:11 +00:00
Yuri Chornoivan
7873ebac2a Update Ukrainian translation 2024-09-18 06:39:12 +00:00
Luming Zh
8edd376ab8 Update Chinese (China) translation 2024-09-18 01:21:37 +00:00
Piotr Drąg
6f300557bf Update Polish translation 2024-09-17 18:44:48 +02:00
Martin
bcda071d7d Update Slovenian translation 2024-09-17 15:22:00 +00:00
Jordi Mas i Hernandez
9df3a50c87 Update Catalan translation 2024-09-17 10:45:22 +00:00
Danial Behzadi
70d41583b3 Update Persian translation 2024-09-17 10:32:44 +00:00
Matthias Clasen
a50df37d52 Merge branch 'iss-5072' into 'main'
gtk/print/gtkprintoperation{,-unix,-portal}.c: add CAIRO_HAS checks

Closes #5072

See merge request GNOME/gtk!7717
2024-09-17 10:05:18 +00:00
Matthias Clasen
b7d07ae190 Merge branch 'dmabuf-init-refactor' into 'main'
Refactor dmabuf initialization

See merge request GNOME/gtk!7714
2024-09-17 09:56:25 +00:00
Thomas Devoogdt
3610ac0fd1
gsk/gskrendernodeparser.c: add CAIRO_HAS check
resolves #5072

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
2024-09-17 10:55:41 +02:00
Thomas Devoogdt
9f855eecb1
modules/printbackends/gtkprintbackendfile.c: add CAIRO_HAS checks
This is similar to the checks in tools/gtk-rendernode-tool-render.c.

resolves #5072

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
2024-09-17 10:55:40 +02:00
Thomas Devoogdt
ffc8f34dfd
gtk/print/gtkprintoperation{,-unix,-portal}.c: add CAIRO_HAS checks
This is similar to the checks in tools/gtk-rendernode-tool-render.c.

resolves #5072

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
2024-09-17 10:55:39 +02:00
Matthias Clasen
7acc1c0125 Make dmabuf initialization lazier
Only initialize the Vulkan or EGL parts where possible.

When dmabufs or dmabuf formats are actually used, we still
initialize fully by creating both a Vulkan and EGL downloader.

This shortens the time to first commit from 149ms to 108ms.
2024-09-17 09:46:01 +02:00
Matthias Clasen
6059eaf355 gdk: Reorganize dmabuf initialization
Change the xxx_get_downloader() functions to init_dmabuf_xxx(),
and make them initialize both xxx_dmabuf_formats and xxx_downloader.
2024-09-17 09:46:01 +02:00
Alexander Shopov
26971c48d4 Update Bulgarian translation 2024-09-17 07:42:50 +00:00
Matthias Clasen
b42caef0ed Merge branch 'builder-tool-box-position' into 'main'
builder-tool: Handle pack-type, position, and center child in GtkBox

See merge request GNOME/gtk!7715
2024-09-17 05:42:46 +00:00
Elliott Sales de Andrade
b3706daf90 builder-tool: Handle pack-type, position, and center child in GtkBox
This takes the `position` property and ensures children are sorted by
it, splits children by `pack-type` (also reversing the order of `end`
children), and handles children with `type="center"`.

If either a center child or end children exist, then the `GtkBox` is
converted to a `GtkCenterBox`, with `start-widget`/`end-widget` being a
nested `GtkBox` with the relevant children.

The splitting does cause some non-`object` children to sort differently
(hence the change to `office-runner.expected`.)
2024-09-16 05:12:54 -04:00
Matthias Clasen
24dc9dc653 Drop the dmabuf_downloaders array
Just use two individual fields, so we can track if we've already
created each one. This also matches the individual fields we have
for the dmabuf formats.

And change preference order of downloaders

Previously, our order was mmap > vulkan > egl.

But depending on the hw (discrete vs integrated gpu), mmap
can be catastrophically slower (on the order of 20ms vs 1.5s).

So, change the order to egl > vulkan > mmap.

Note that this currently has less effect than we'd like to,
since we don't let the downloaders claim linear formats.
2024-09-16 09:55:31 +02:00
Elliott Sales de Andrade
172dfb14c4 builder-tool: Convert node children after the node itself
Some nodes like `GtkBox` need to process removed-in-GTK4 attributes to
correctly convert their contents. If the node children are processed
first, then those attributes are removed prematurely.
2024-09-16 02:39:47 -04:00
Jordi Mas i Hernandez
3b43078b08 Update Catalan translation 2024-09-15 12:15:18 +00:00
Benjamin Otte
f2e75529cb Merge branch 'wip/otte/for-main' into 'main'
vulkan: Actually return the preferred memory format

See merge request GNOME/gtk!7713
2024-09-15 08:19:53 +00:00
Benjamin Otte
eed58b4051 gpu: Split out rect grid snapping function
We might want to use it outside of the nodeprocessor.

The function is now called gsk_rect_snap_to_grid().
2024-09-15 02:31:02 +02:00