Compare commits

..

218 Commits

Author SHA1 Message Date
Emmanuele Bassi 3a17e80061 Revert "Force the loadable module suffix on the print backend modules."
This reverts commit ee448db031.

The `name_suffix` argument is already set, and by setting it twice we're
just getting a warning at configuration time from Meson.
2020-02-09 21:04:23 +00:00
Jiri Grönroos 4d7d811252 Update Finnish translation 2020-02-09 18:52:13 +00:00
Sabri Ünal 05f409fbdc Update Turkish translation 2020-02-09 13:58:41 +00:00
Sabri Ünal 8ba1a29ee4 Update Turkish translation 2020-02-09 13:57:38 +00:00
Bruce Cowan 5ac59dc3b9 Update British English translation 2020-02-08 13:56:28 +00:00
Matthias Clasen 9c8babacae Merge branch 'vista_clipboard' into 'gtk-3-24'
GDK W32: Use Vista+ clipboard API

See merge request GNOME/gtk!1143
2020-02-06 12:52:11 +00:00
Jakub Steiner 70ebd7e237 Merge branch 'Gtk_3_24_focus_rings' into 'gtk-3-24'
Outline/focus ring border-radii fixes

See merge request GNOME/gtk!1384
2020-02-05 12:18:55 +00:00
Carlo Lobrano b50ccaea12 Adwaita: always use link specific colors for link selector
link target uses `$selected_bg_color` and `$selected_fg_color` for the
definition of some selectors (e.g. selected).

While `$link_color` and `$link_visited_color` are based on
`$selected_bg_color`, this does not seem coherent.

Replacing `$selected_*g_color` in link target style with link colors
defined in `_colors.scss file`.
2020-02-05 13:14:26 +01:00
Feichtmeier cfd530db0d Outline/focus ring border-radii fixes
- change %linked_XXX class outline-radii to match the border-radii
- adapt the .dialog-action-area buttons to this
2020-02-04 12:34:20 +00:00
Jakub Steiner b0f24fd8d5 Adwaita: generate up to date CSS
- the typography SASS changes weren't generated in the CSS
2020-02-04 11:09:38 +01:00
Thomas Holder 5e8d97ef0b gdk quartz: add missing include (-Werror=implicit)
Regression of GNOME/gtk!641 (ef72fe750a)
2020-02-02 11:16:40 +01:00
John Ralls 8670b7980d Merge Thomas Holder's 'gtk-3-24-fix-gdkcursor-quartz' into gtk-3-24. 2020-02-01 15:29:41 -08:00
Thomas Holder 528f780871 gdk quartz: add missing include
Fixes startup crash with Inkscape.

Regression of GNOME/gtk!641 (ef72fe750a)
2020-02-01 23:56:56 +01:00
Matthias Clasen 2f9431965b Merge branch 'model-button-a11y-state' into 'gtk-3-24'
modelbutton: Update a11y states

See merge request GNOME/gtk!1374
2020-01-31 18:31:23 +00:00
Matthias Clasen 09b14437a8 modelbutton: Update a11y states
We took care to set the proper role on our accessible object,
but we forgot to update the state for check and radio button
roles.
2020-01-31 19:08:09 +01:00
John Ralls e2c34b9db7 Merge branch 'issue2225' into gtk-3-24 2020-01-30 10:31:57 -08:00
Matthias Clasen 9c832b388b Merge branch 'gdk-device-leak-fix-gtk3' into 'gtk-3-24'
GdkDevice leak fix

See merge request GNOME/gtk!1359
2020-01-30 09:10:50 +00:00
Stas Solovey 9ba0671b32 Update Russian translation 2020-01-29 20:48:21 +00:00
Emmanuele Bassi a574404a2e Merge branch 'wip/muktupavels/work-areas-v3-3-24' into 'gtk-3-24'
per-monitor work areas

See merge request GNOME/gtk!478
2020-01-29 11:25:19 +00:00
Alberts Muktupāvels 6609a9f061 x11: add support for _GTK_WORKAREAS_Dn
If window manager supports _GTK_WORKAREAS use per-monitor work areas.

https://mail.gnome.org/archives/wm-spec-list/2018-December/msg00000.html
https://gitlab.freedesktop.org/xdg/xdg-specs/merge_requests/22

https://gitlab.gnome.org/GNOME/gtk/merge_requests/478
2020-01-28 14:51:22 +02:00
Sebastian Keller 9ce66b9d05 gdk/x11: Properly unref removed device in XI2 device manager
When a device is added, there are two references to it by the device
manager, the initial one and the one used for the id_table. Removing a
device only removed the reference added by the id_table resulting in the
GdkDevice being leaked.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/1359
2020-01-27 22:06:49 +01:00
Dušan Kazik cb1c16021e Update Slovak translation 2020-01-27 08:00:50 +00:00
Sebastian Keller 4cef9f3471 gdkseatdefault: Unref removed slave devices
Adding a slave device adds a ref, but removing it does not unref it.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/1359
2020-01-27 01:48:37 +01:00
Dušan Kazik 9a65e05748 Update Slovak translation 2020-01-26 20:31:02 +00:00
Piotr Drąg d877325a1e Add empty Kurdish Sorani translation of properties
Follow-up to 3822ac74fc

Build will break without this, see the note in LINGUAS.
2020-01-25 12:35:12 +01:00
Matthias Clasen e4509d723e Merge branch 'display-woes' into 'gtk-3-24'
Couple of fixes for GtkDisplay open/close

See merge request GNOME/gtk!1343
2020-01-24 16:35:13 +00:00
Matthias Clasen ed9825e8ca Merge branch 'fix-avahi_service_resolver_cb-crash' into 'gtk-3-24'
printing: Fix crash in avahi_service_resolver_cb

See merge request GNOME/gtk!1346
2020-01-23 16:42:35 +00:00
Olivier Fourdan b1d55f2c85 gtksettings: Remove display from cache on closing
GTK caches the settings per display in a static `GArray`, keeping a
reference to the `GdkDisplay` as the key.

However, when closing the display, the corresponding entry is not
removed from the cache in `GtkSettings`.

So when reopening again a `GdkDisplay`, if the new address matches one
of the previously closed display, the cache will return the existing
`GtkSettings` from the cache, which still holds a reference to the old
`GdkScreen` which was freed along the `GdkDisplay`.

To avoid the issue, make sure to remove the `GdkDisplay` and
corresponding `GdkSettings` when closing the `GdkDisplay`.

Also, care must be taken not to recreate the `GdkSettings` and re-add
the `GdkDisplay` to the cache once the display is closed, and make sure
callers of `gtk_settings_get_for_display()` can deal with a returned
value being `NULL` if the display is closed.

Fixes: commit 360a3c1690 - "Use a cheaper way to store settings per
display"
2020-01-23 17:34:47 +01:00
Olivier Fourdan c9601f1567 gdk/wayland: Fix gdk_window_impl_wayland_finalize() warnings
On Wayland, opening and closing a `GdkDisplay` generates a coupe of
warnings at runtime:

```
  GLib-GObject-WARNING **:
    invalid cast from 'GdkWindowImplWayland' to 'GdkWindow'
  GLib-GObject-WARNING **:
    invalid cast from 'GdkWaylandWindow' to 'GdkWindowImplWayland'
```

This is from `gdk_window_impl_wayland_finalize()` which tries to cast
the given GObject to a `GdkWindow` while it's a `GdkWindowImplWayland`.

Use the correct type casting of objects to avoid the warnings.
2020-01-23 17:34:47 +01:00
WGH 3d5f083b75 printing: Fix crash in avahi_service_resolver_cb
printer_name_compressed_strv is NULL-terminated array
of gchar*, which means N+1 memory should be allocated.

Otherwise, if the printer name has no empty components
(which is usually the case), printer_name_compressed_strv[N],
which should contain the NULL sentinel, will actually lie
just outside of allocated memory, which is UB.

In my case, it led to crashes inside g_strjoinv
when Print... dialog is opened in evince.

    #0  0x00007fad2ce1bad7 in __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:96
    #1  0x00007fad2d04d88d in g_strjoinv (separator=separator@entry=0x7fad0c9bc508 "-", str_array=str_array@entry=0x556b017f0200) at ../glib-2.60.7/glib/gstrfuncs.c:2585
    #2  0x00007fad0c9b8a89 in avahi_service_resolver_cb (source_object=<optimized out>, res=<optimized out>, user_data=0x7fad08020ee0) at /var/tmp/portage/x11-libs/gtk+-3.24.13/work/gtk+-3.24.13/modules/printbackends/cups/gtkprintbackendcups.c:3223
    #3  0x00007fad2d1f8ed3 in g_task_return_now (task=0x556b017a8b00 [GTask]) at ../glib-2.60.7/gio/gtask.c:1209
    #4  0x00007fad2d1f987d in g_task_return (task=0x556b017a8b00 [GTask], type=<optimized out>) at ../glib-2.60.7/gio/gtask.c:1278
    #5  0x00007fad2d1f9dec in g_task_return (type=G_TASK_RETURN_SUCCESS, task=<optimized out>) at ../glib-2.60.7/gio/gtask.c:1678
    #6  0x00007fad2d1f9dec in g_task_return_pointer (task=<optimized out>, result=<optimized out>, result_destroy=<optimized out>) at ../glib-2.60.7/gio/gtask.c:1683
    #7  0x00007fad2d24b6af in g_dbus_connection_call_done (source=<optimized out>, result=0x556b017a8bc0, user_data=0x556b017a8b00) at ../glib-2.60.7/gio/gdbusconnection.c:5747
    #8  0x00007fad2d1f8ed3 in g_task_return_now (task=0x556b017a8bc0 [GTask]) at ../glib-2.60.7/gio/gtask.c:1209
    #9  0x00007fad2d1f8f09 in complete_in_idle_cb (task=0x556b017a8bc0) at ../glib-2.60.7/gio/gtask.c:1223
    #10 0x00007fad2d02d2c0 in g_main_dispatch (context=0x556b00eee090) at ../glib-2.60.7/glib/gmain.c:3189
    #11 0x00007fad2d02d2c0 in g_main_context_dispatch (context=context@entry=0x556b00eee090) at ../glib-2.60.7/glib/gmain.c:3854
    #12 0x00007fad2d02d658 in g_main_context_iterate (context=context@entry=0x556b00eee090, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib-2.60.7/glib/gmain.c:3927
    #13 0x00007fad2d02d6df in g_main_context_iteration (context=context@entry=0x556b00eee090, may_block=may_block@entry=1) at ../glib-2.60.7/glib/gmain.c:3988
    #14 0x00007fad2d22248d in g_application_run (application=0x556b0116f130 [EvApplication], argc=<optimized out>, argv=<optimized out>) at ../glib-2.60.7/gio/gapplication.c:2519
    #15 0x0000556b002e55a1 in  ()
    #16 0x00007fad2ccd6f1b in __libc_start_main (main=0x556b002e50d0, argc=2, argv=0x7ffe1057fa88, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe1057fa78) at ../csu/libc-start.c:308
    #17 0x0000556b002e567a in  ()

    (gdb) p printer_name_compressed_strv[0]
    $4 = (gchar *) 0x556d4a4be430 "Brother"
    (gdb) p printer_name_compressed_strv[1]
    $5 = (gchar *) 0x7f9dbc011090 "MFC"
    (gdb) p printer_name_compressed_strv[2]
    $6 = (gchar *) 0x556d4a51ba50 "7860DW"
    (gdb) p printer_name_compressed_strv[3]
    $7 = (gchar *) 0x401 <error: Cannot access memory at address 0x401>
2020-01-23 18:27:41 +03:00
John Ralls eabaf90076 Match returns annotation on quartz version of gtk_drag_dest_get_target_List. 2020-01-22 20:53:38 -08:00
John Ralls c3deff17a6 Check target list not null to prevent segfault. 2020-01-22 20:53:38 -08:00
John Ralls 44c033ccb8 Ensure that GtkDragDestSite is inited to 0. 2020-01-22 20:53:38 -08:00
John Ralls 81c42faa5a Handle NSException from removeItemAtIndex. 2020-01-22 20:53:38 -08:00
sicklylife 43d7747df6 Update Japanese translation 2020-01-22 17:36:38 +00:00
sicklylife 650a3996ba Update Japanese translation 2020-01-22 17:27:16 +00:00
Emmanuele Bassi e8cd4d4d33 Merge branch 'wip/muktupavels/issue-1084' into 'gtk-3-24'
Complete startup notification sequence for remote invocations

See merge request GNOME/gtk!1296
2020-01-22 15:07:27 +00:00
Matthias Clasen 159ad1161f Merge branch 'wip/jimmac/typography-classes-gtk3' into 'gtk-3-24'
Adwaita: general typography classes

See merge request GNOME/gtk!1341
2020-01-22 13:51:02 +00:00
Jakub Steiner 9b11707a52 Adwaita: general typography classes
- many moons and some iterations later, these are the suggested
      general typographic styles. Already being referenced in apps like
      Banner Viewer (for now shipping custom definitions)

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1808
2020-01-22 12:06:31 +01:00
Jwtiyar Nariman 3822ac74fc Add Kurdish Sorani translation 2020-01-19 07:52:05 +00:00
Matthias Clasen 11568b158f inspector: Avoid an array overrun
Commit 3f56af3738 added a new value to the
GdkInputSource enum, forgetting that the inspector
has an array of names to match this enum.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2385
2020-01-18 10:53:30 -05:00
Matthias Clasen cbf5768e91 Merge branch 'gtk3-fix-gesture-get-center' into 'gtk-3-24'
[GTK3] gtkgesture: Fix gtk_gesture_get_bounding_box_center() for touchpads

See merge request GNOME/gtk!1269
2020-01-17 22:24:32 +00:00
Yariv Barkan 1c050bdcf4 demo: Use pinch translation in the gestures demo
Add the pinch translation offset to the pinch gesture demo. That allows
moving the square around in addition to the already-supported rotate and
zoom.
2020-01-17 22:37:55 +02:00
Yariv Barkan e229c6fe81 gtkgesture: Fix get-center for touchpad gestures
Touchpad gestures have only a single event sequence. The current
'center' of the gesture is the starting point + accumulated deltas.
Update gtk_gesture_get_bounding_box_center() accordingly.
2020-01-17 22:37:55 +02:00
Matthias Clasen c6ce7fedd5 Merge branch 'wip/muktupavels/fix-critical-warning' into 'gtk-3-24'
menu: fix critical warning

See merge request GNOME/gtk!1182
2020-01-17 18:16:42 +00:00
Matthias Clasen 9f9fdd6caa Merge branch 'wip/muktupavels/root-surface-scale' into 'gtk-3-24'
gdkscreen-x11: update device scale also for root window

See merge request GNOME/gtk!1208
2020-01-17 18:13:50 +00:00
Timm Bäder 5986e100eb Merge branch '3-24-fix-imwayland-cursor' into 'gtk-3-24'
imwayland: Fix get_preedit_string cursor position

See merge request GNOME/gtk!1251
2020-01-17 06:46:56 +00:00
Jakub Steiner 5d38dd5618 Adwaita: update checkbox & radio
- minor update to checkboxes and radios,
  approved for gtk3 as well.

See https://gitlab.gnome.org/GNOME/gtk/issues/2291
2020-01-15 22:18:38 +01:00
Matthias Clasen 6d3138fe6b Merge branch 'fix-2378' into 'gtk-3-24'
fontchooser: Fix size label not being hidden

See merge request GNOME/gtk!1317
2020-01-14 22:42:33 +00:00
Alex Samorukov e02148491f Use bundle id instead of package name for the macOS preview as filename is now changed 2020-01-14 22:12:53 +00:00
James Westman b5ea2c78d6 fontchooser: Fix size label not being hidden
Even when the level property of a font chooser did not include
GTK_FONT_CHOOSER_LEVEL_SIZE, the "Size" label was still displayed.

Fixes #2378.
2020-01-14 16:01:16 -06:00
Ricardo Silva Veloso db7c2afe6b Update Brazilian Portuguese translation 2020-01-14 20:31:35 +00:00
Matthias Clasen 0bffcd8882 Merge branch 'adwaita-cross-fade-fix-gtk3' into 'gtk-3-24'
Adwaita: Fix syntax error in cross-fade() (GTK3)

See merge request GNOME/gtk!1307
2020-01-14 05:32:45 +00:00
Matthias Clasen 8ed65a96b9 Merge branch 'image-surfce-cache-leak' into 'gtk-3-24'
GtkCssImageSurface: Plug cache surface leak

See merge request GNOME/gtk!1309
2020-01-14 05:32:08 +00:00
Matthias Clasen cf31119bf4 gtk-demo: Use a default action in the infobars demo
This makes the question infobar activatable by clicking
anywhere in it.
2020-01-14 00:29:53 -05:00
Matthias Clasen 0c6ea4c7b2 Adwaita: Add hover for clickable infobars 2020-01-14 00:29:53 -05:00
Matthias Clasen b55ef8d89a infobar: Activate default action on clicks
When we have a default action set on the infobar, activate it
for clicks anywhere in the infobar.  Also add an .action style
class in this case, so we can add a hover highlight to the infobar
just for this case.
2020-01-14 00:29:53 -05:00
Sebastian Keller 7e2bebb4d5 GtkCssImageSurface: Plug cache surface leak
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2373
2020-01-13 23:24:47 +01:00
nana-4 404f4c6627 Adwaita: Fix syntax error in cross-fade()
cross-fade() requires two images.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2371
2020-01-14 06:21:17 +09:00
Alex Samorukov 4a1dc1abfa Merge branch 'gtk-3-24-issue-2102' into 'gtk-3-24'
gdk_quartz_keymap_translate_keyboard_state fills consumed_modifiers incorrectly (closes #2102)

See merge request GNOME/gtk!1225
2020-01-10 21:07:46 +00:00
Mario Sanchez Prada c17c18e440 application: Complete startup notification sequence for remote invocations
When a remote instance of a GTK application implementing the Startup
Notification protocol gets spawned it will pass the startup sequence
ID as "platform data" to the main instance. Thus, we need to make sure
that the startup sequence gets completed in that case, since the remote
instance won't do it by itself, since it won't map any top level window.

Checking for this "platform data" in the implementation of the after_emit()
virtual method in the primary instance should be a good place to do so, since
the existence of such data proves that a remote instance has been spawned.

https://gitlab.gnome.org/GNOME/gtk/issues/1084
2020-01-10 13:32:37 +02:00
Umarzuki Bin Mochlis Moktar d0c351468b Update Malay translation 2020-01-08 14:53:41 +00:00
Alex Samorukov 55346fbeb9 Merge branch 'gtk-3-24-fix-set_functions' into 'gtk-3-24'
quartz: impl_class->set_functions listed twice in the object

See merge request GNOME/gtk!1282
2020-01-08 14:17:36 +00:00
Alex Samorukov 76e95a702f impl_class->set_functions listed twice in the object 2020-01-08 14:17:36 +00:00
Alex Samorukov a4bb6cea63 Merge branch 'gtk-3-24-fixeventloop' into 'gtk-3-24'
Move `[NSApplication sharedApplication]` after event loop init to avoid window focus issues (closes #2342).

See merge request GNOME/gtk!1285
2020-01-08 14:13:36 +00:00
Alex Samorukov 6fdef1055b move [NSApplication sharedApplication] after _gdk_quartz_events_init() to avoid initialization issues 2020-01-08 14:13:36 +00:00
Alex Samorukov a83066bdc5 Merge branch 'samm/fix-fs/gtk-3-24' into 'gtk-3-24'
Fix was_fullscreen flag (again!)

See merge request GNOME/gtk!1287
2020-01-08 13:56:10 +00:00
Alex Samorukov 2406badb92 Fix was_fullscreen flag (again!) 2020-01-08 13:56:10 +00:00
Jordi Mas fcc72575a2 Update Catalan translation 2020-01-04 07:23:34 +01:00
Matthias Clasen 6f374e787b Merge branch 'gtk-3-24-fix-fullscreen-state' into 'gtk-3-24'
Fix typo which preventing fullscreen state from being updated correctly

See merge request GNOME/gtk!1277
2020-01-03 17:54:12 +00:00
Alex Samorukov 5cdca80c0c Fix typo which preventing fullscreen state from being updated correctly 2020-01-03 17:54:12 +00:00
Alberts Muktupāvels 489fb1783b gdkscreen-x11: update device scale also for root window
Window scale can change at runtime. If cairo_surface is already
created for root window gdk_pixbuf_get_from_window will return
wrong image.

_gdk_x11_screen_set_window_scale already updates window_scale for
root window, update also cairo_surface device scale.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/1208
2020-01-03 18:50:14 +02:00
Umarzuki Bin Mochlis Moktar a1a99bef83 Update Malay translation 2020-01-03 13:41:04 +00:00
Matthias Clasen 6116c0a0b4 Merge branch 'cherry-pick-6769db16' into 'gtk-3-24'
icontheme: Don't try to scale pixbufs to 0px

See merge request GNOME/gtk!1275
2020-01-01 19:24:21 +00:00
Benjamin Otte edcddf6561 icontheme: Don't try to scale pixbufs to 0px
Always insist on at least 1px, even if the thumbnail we're turning into
an icon was 256 * 3 and should be scaled to 32 * 3/8.

(cherry picked from commit 6769db160d)
2020-01-01 18:17:14 +01:00
Matthias Clasen d9a9ede7a2 Merge branch 'carlosgc/no-emoji-hint' into 'gtk-3-24'
emojichooser: never show emoji chooser when input hint no-emoji is present

See merge request GNOME/gtk!1272
2019-12-30 15:18:12 +00:00
Carlos Garcia Campos c6e5030c61 emojichooser: never show emoji chooser when input hint no-emoji is present
It's currently used only to not include the insert emoji option in the
context menu, but it's still possible to show the emoji chooser in both
GtkEntry and GtkTextView using the key bindings.
See also https://bugs.webkit.org/show_bug.cgi?id=205609.
2019-12-30 10:56:06 +01:00
Jordi Mas 1bc188b1f4 Fixes to Catalan translation 2019-12-27 13:54:02 +01:00
Fran Dieguez 402445920b Update Galician translation 2019-12-25 03:24:27 +00:00
Fran Dieguez 3eec04802c Update Galician translation 2019-12-25 01:56:10 +00:00
Fran Dieguez 276aa563ba Update Galician translation 2019-12-25 01:31:55 +00:00
Matthias Clasen 0d6cff45c3 accelgroup: Fix a buffer overrun
gtk_accelerator_parse_with_keycode can
overrun its buffer for certain inputs.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2325
2019-12-23 23:19:57 -05:00
Emmanuele Bassi eeb896d648 Merge branch 'doc-scale-button-css' into 'gtk-3-24'
Document the CSS class used for the ScaleButton popover

See merge request GNOME/gtk!1246
2019-12-22 19:31:40 +00:00
Emmanuele Bassi e7bd9adf3e Document the CSS class used for the ScaleButton popover
Otherwise it's not easy to divine the selector for the scale widget
inside the popover.
2019-12-22 19:12:20 +00:00
Matthias Clasen f37673927c Merge branch 'gtk3-fix-gtkgesturerotate-leak' into 'gtk-3-24'
[gtk3] gtkgesturerotate: Fix a memory leak

See merge request GNOME/gtk!1262
2019-12-19 22:54:46 +00:00
Yariv Barkan dc896f0910 gtkgesturerotate: Fix a memory leak
On touchpads gtk_gesture_get_sequences() was called without a
corresponding g_list_free(). The same was true for touchscreens
if due to some reason only a single sequence was found.
2019-12-19 20:53:45 +02:00
Efstathios Iosifidis e5b05d2478 Update Greek translation 2019-12-17 22:40:37 +00:00
Emmanuele Bassi 37dd37178f Merge branch 'ci-update-gtk3' into 'gtk-3-24'
Update CI image

See merge request GNOME/gtk!1255
2019-12-17 18:00:58 +00:00
Emmanuele Bassi a4e4b136c9 Update the list of tests that may fail
The update of the Docker image we use on our CI introduced changes in
the underlying platform, and that caused some reftests to fail.
2019-12-17 17:39:43 +00:00
Emmanuele Bassi 44b2f6792b ci: Update the Docker image 2019-12-16 20:07:39 +00:00
Emmanuele Bassi 40264c7ab3 ci: Add libXtst-devel
Needed for at-spi2-core.
2019-12-16 20:07:39 +00:00
Emmanuele Bassi 62d68ce88c ci: Update to Fedora 31
Fedora 29 is EOL.
2019-12-16 20:07:39 +00:00
xdavidwu 5ad1316b1e imwayland: Fix get_preedit_string cursor position
GtkIMContext get_preedit_string should return cursor position counted
in characters, but cursor_begin here is counted in bytes. This add the
missing conversion.
2019-12-15 19:19:54 +08:00
Marek Kasik 725892b653 printing: Fix getting info for standalone IPP printers
Create printer name from name of the advertised service
for standalone IPP printers as opposed to CUPS printers
advertised via Avahi which get name from their
resource path.
This is similar to what cups-filters does.

Pass GtkPrinter class to request for printer info
so that it does not need to be searched for
(such search could fail for standalone IPP printers).

https://gitlab.gnome.org/GNOME/gtk/issues/1509
2019-12-13 18:24:55 +01:00
Marek Kasik fb2fa8348d printing: Don't show Rejecting Jobs when we don't know
Set reasonable default values for printers discovered
by Avahi which do not have 'printer-type' attribute.
This is the case for network printers which were not
published by CUPS.

Related to the issue #1509.
2019-12-13 18:24:55 +01:00
Matthias Clasen 5df5716871 Merge branch 'wip/sadiq/fix-switch-on-touch' into 'gtk-3-24'
switch: Fix toggling switch on touch devices

See merge request GNOME/gtk!1233
2019-12-12 19:33:57 +00:00
Matthias Clasen 77f465bf19 Merge branch 'terminal-3-24' into 'gtk-3-24'
imwayland: Suppport terminal purpose

See merge request GNOME/gtk!1245
2019-12-12 19:12:34 +00:00
Dorota Czaplejewicz c7c8ab6624 imwayland: Suppport terminal purpose 2019-12-12 18:20:06 +00:00
Christoph Reiter 3fe6c5caf8 Merge branch 'honor-hotspot' into 'gtk-3-24'
x11: Honor hotspot during drag cancel animation

See merge request GNOME/gtk!1235
2019-12-11 12:59:36 +00:00
John Ralls 235d28f02d Fix visibiity of gdkselection-quartz.c exported gtk-only functions.
Also ensure that gdkquartz-gtk-only.h is included in distribution
tarballs.

Failing to include gdkquartz-gtk-only.h in gdkselection-quartz.c
caused the compiler to not set the extern storage class on the
functions, in turn causing them to be not exported by libgdk-3.0.dylib.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/32 again.
2019-12-10 21:46:59 -08:00
John Ralls ee448db031 Force the loadable module suffix on the print backend modules.
On MacOS the shared library and loadable module suffix is different.
While dlopen will load a shared module just fine, Gtk's loader and
query tools don't know to look for them so it's important to give
loadable modules the .so suffix.
2019-12-10 21:46:59 -08:00
Robert Mader a3cff0add1 x11: Honor hotspot during drag cancel animation
Otherwise the icon "jumps" to the cursor position with its top left when
the animation starts.
This is especially visible if the dragged item is big, like when dragging
mails in Thunderbird.
2019-12-09 01:22:11 +01:00
Mohammed Sadiq 2fc60a1e3f switch: Fix toggling switch on touch devices
priv->is_switch is used to get hint if the gesture happened
on the switch. On touch devices, ::enter-notify-event may
not be emitted, and so priv->is_switch may not be set.

Let it be set when ::pressed gesture is emitted so that
the switch is toggled when the gesture occurs regardless
of whether a pointing device is present or not.
2019-12-06 20:16:51 +05:30
Emmanuele Bassi c1146db2fe Merge branch 'issue-1077-backport' into 'gtk-3-24'
Annotate GtkTreeModelSort.new_with_model() appropriately

See merge request GNOME/gtk!1229
2019-12-03 16:22:41 +00:00
LutzLue e3247ed0d9 Annotate GtkTreeModelSort.new_with_model() appropriately
The new_with_model() method is a constructor, and it returns a GtkTreeModelSort
instance, even if the C API returns a GtkTreeModel for the convenience of C
developers.

Fixes: #1077
2019-12-03 16:02:45 +00:00
Matthias Clasen d5397dfb31 Merge branch 'wip/exalm/popover' into 'gtk-3-24'
Adwaita: use transparent borders for popovers

See merge request GNOME/gtk!1227
2019-12-02 20:41:03 +00:00
Alexander Mikhaylenko 379669b153 Adwaita: use transparent borders for popovers
Do the same thing as menus and windows do already.
2019-12-02 21:54:37 +05:00
Matthias Clasen 06d1cf5e52 Merge branch 'wip/muktupavels/opaque-region' into 'gtk-3-24'
window: fix opaque region

See merge request GNOME/gtk!1221
2019-12-01 15:11:52 +00:00
Matthias Clasen 8b789993c3 Merge branch 'fix-backdrop-flat-button-styling' into 'gtk-3-24'
Adwaita: Fix some backdrop flat buttons

See merge request GNOME/gtk!1224
2019-12-01 15:08:44 +00:00
Thomas Holder af6487d70c gdk: quartz: fix #2102 consumed_modifiers 2019-12-01 15:14:20 +01:00
nana-4 f26b9c9f9f Adwaita: Fix some backdrop flat buttons
The commit 6f6070b5 broke the styling.

This fixes it by adding a missing placeholder selector.
2019-12-01 13:06:32 +09:00
Alberts Muktupāvels 44c994e469 window: fix opaque region
Decoration node for drawing is used only for client side decorated
windows, but corners from opaque region is subtracted also for
normal windows.

Rename function to better reflect what it does and do not subtract
corners if decoration node was not used for drawing.
2019-11-30 19:53:40 +02:00
Timm Bäder 77e3ee88bd Merge branch 'dont-color-labels-directly-gtk3' into 'gtk-3-24'
Adwaita: Avoid directly coloring labels wherever possible (GTK3)

See merge request GNOME/gtk!1210
2019-11-29 11:55:06 +00:00
Timm Bäder 25174154b9 reftests: Fix css-multi-state test
Properly unset theme CSS and use the right selector for the toggle
buttons.
2019-11-29 20:35:06 +09:00
nana-4 ebde8349cb Adwaita: Avoid directly coloring labels wherever possible
Directly coloring labels can create a lot of unintended behaviors.
Unfortunately we can't avoid directly coloring `label:disabled` because
it can be used individually. This, however, tries to inherit color from
the parent element of labels wherever possible.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1643
2019-11-29 00:46:20 +09:00
Jakub Steiner b1bf354ade Merge branch 'sass-no-extend-compound-complete' into 'gtk-3-24'
themes: Remove remaining @extend with compound selectors

See merge request GNOME/gtk!1218
2019-11-28 15:05:49 +00:00
nana-4 f7d57cc1eb themes: Remove remaining @extend with compound selectors
This removes the remaining cases in 6f6070b5 by replacing them with a
simple placeholder selector.

`%button.flat.suggested-action` has been replaced by
`%selection_mode_button_flat`, because it's difficult to replace the
compound selector with a simple placeholder selector, and it doesn't
seem like a proper selector for `.selection-mode button.titlebutton` to
inherit.

The CSSs were generated with libsass 3.5.5 to minimize the git diff, but
I've confirmed that no warning happned with libsass 3.6.3 anymore.

See https://gitlab.gnome.org/GNOME/gtk/issues/2237
2019-11-28 22:21:23 +09:00
Matthias Clasen f737908d2f Fix a11y test output 2019-11-27 13:16:22 -05:00
Matthias Clasen e4b4305cf1 3.24.13 2019-11-27 10:12:24 -05:00
Matthias Clasen f0002ad372 Merge branch 'no-objc' into 'gtk-3-24'
Hide Objective-C from outside GdkQuartz.

See merge request GNOME/gtk!641
2019-11-27 13:39:40 +00:00
Matthias Clasen 61d7700c17 Merge branch 'gtkq-events' into 'gtk-3-24'
gdk: quartz: prevent titlebar events from falling to the window below

See merge request GNOME/gtk!1140
2019-11-27 13:31:39 +00:00
Matthias Clasen 540d849a52 Merge branch 'pg_up_down' into 'gtk-3-24'
gdk: quartz: Avoid page up/down getting filtered by gtk_im_context_filter_keypress()

See merge request GNOME/gtk!1148
2019-11-27 13:25:36 +00:00
Matthias Clasen 56875730d1 Merge branch 'win32-gl-fullscreen-workaround-gtk3' into 'gtk-3-24'
gdkwindow-win32.c: Set WS_BORDER for fullscreen GL windows if requested

See merge request GNOME/gtk!648
2019-11-27 13:16:21 +00:00
Matthias Clasen 9d3e3eea7a Merge branch 'sass-no-extend-compound' into 'gtk-3-24'
themes: remove various @extend with compound selectors

See merge request GNOME/gtk!1171
2019-11-27 13:03:45 +00:00
Matthias Clasen a8ce096bf8 Merge branch '1630-on3-24branch' into 'gtk-3-24'
Avoid Broadwayd - GtkEntry popup takes 35s after application startup

See merge request GNOME/gtk!1205
2019-11-27 13:00:33 +00:00
Matthias Clasen 19f59cac3d Merge branch 'clipboard-image-miss' into 'gtk-3-24'
GDK W32: no "GDK_SELECTION" event for clipboard

See merge request GNOME/gtk!1198
2019-11-27 12:57:25 +00:00
Matthias Clasen 31f5e8fe32 Merge branch 'fix-issue-1646' into 'gtk-3-24'
HighContrast: Add missing color to entry

See merge request GNOME/gtk!1214
2019-11-27 12:45:56 +00:00
nana-4 7564e43a6a HighContrast: Add missing color to entry
So entries don't inherit color from the parent element anymore.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1646
2019-11-27 20:58:15 +09:00
Matthias Clasen 5e8d4757d4 Merge branch 'jjardon/wayland' into 'gtk-3-24'
deprecated/gtkstatusicon.c: Fix compilation in wayland

See merge request GNOME/gtk!1207
2019-11-24 18:24:16 +00:00
Javier Jardón c6792a41ab deprecated/gtkstatusicon.c: Fix compilation in wayland
Without this compilation in a wayland-only system fails
2019-11-24 14:33:26 +09:00
Alexandr Miloslavskiy 1efb72210d Fix crash in parse_border()
The bug was introduced in commit:
	9b7640b8 by Benjamin Otte, 2012-03-26 17:24:02
	styleproperty: Make _gtk_style_property_parse_value() return a CssValue

In that commit, `values` changed from `GValue*` to `GtkCssValue**`,
but one `!G_IS_VALUE (&values[8])` was left untouched. As a result,
if `border` shorthand contains anything after color, it might crash,
depending on memory layout.

New test included.

Fixes: #751
2019-11-23 18:06:31 +01:00
Christoph Reiter 3804d7a0ca Merge branch 'cherry-pick-f431e28c' into 'gtk-3-24'
gtkimcontextsimple.c: Use X11_DATA_PREFIX only on X11

See merge request GNOME/gtk!1206
2019-11-23 08:14:36 +00:00
Quentin Glidic 45bcc89a01 gtkimcontextsimple.c: Use X11_DATA_PREFIX only on X11
Unlike what commit d01ea18dc3 says, X11 is
not a requirement for Wayland, so a Wayland-only build is possible. We
just use the same logic as other non-X11 platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=784615

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>


(cherry picked from commit f431e28ce3)
2019-11-23 06:33:39 +00:00
Christoph Reiter 4d34e1cfec CI/msys2: Don't install sassc to skip CSS generation and make job errors fatal again
Once #2237 is fixed we can install sassc again, until then use the in-tree CSS.
2019-11-22 18:22:30 +01:00
Christoph Reiter 6f6070b510 themes: remove various @extend with compound selectors
They are no longer supported by sass and broken with libsass 3.6.3
(https://github.com/sass/libsass/issues/3033)

This removes some of them by replacing them with a placeholder selector.
This at least brings the resulting CSS size down a bit so gtk can be build
again.

The remaining cases I don't know how to convert because I haven't found a way to
reproduce the old output.

The CSS was generated with libsass 3.5.5.

See #2237
2019-11-22 17:54:30 +01:00
Christoph Reiter 39ef5e40d0 HighContrast: rebuild included CSS
afd61c3570 changed the scss but didn't sync the css
2019-11-22 17:49:23 +01:00
Fredy Paquet edd490cf4d Avoid Broadwayd - GtkEntry popup takes 35s after application startup
preventing conversion attempt and timer being started on broadway
backend.

first iteration for #1630

Author:    Fredy Paquet <fredy@opag.ch>
Signed-off-by: Aurélien Pupier <apupier@redhat.com>
2019-11-22 14:37:53 +01:00
Christoph Reiter f76208808b Merge branch 'reftest.msvc.fix' into 'gtk-3-24'
reftests: Fix building on Visual Studio

See merge request GNOME/gtk!1203
2019-11-22 12:20:52 +00:00
Chun-wei Fan 11e5f2c473 gdkwindow-win32.c: Set WS_BORDER for fullscreen GL windows if requested
With some GL drivers, it may be the case that menus are not shown
correctly in fullscreen GL windows because DWM is deactivated in the
process.

Force WS_BORDER to be applied to the fullscreen GL window so that we have
a small 1px border when needed (by setting an envvar), so that DWM does
not get deactivated, hence enabling the menus to show.  Also, when we
force WS_BORDER to be applied in this situation, we also deliberately
place the window just outside the top lefthand corner of the screen by
1px and make the window 1px larger than the screen size, so that we
effectively hide the 1px border from view.

Fixes issue #1702.
2019-11-22 12:04:21 +08:00
Chun-wei Fan 36edb5fbf6 reftests: Fix building on Visual Studio
We need to mark the prototypes in the headers so that they get exported
properly from the reftest DLLs that we build, so that the reftest DLLs
and program will link properly.  Include gtk-reftest.h in
reftest-snapshot.c so that the compiler picks up the export directives
as needed.
2019-11-22 11:43:35 +08:00
Christoph Reiter 1a87249d1a Merge branch 'dont-hardcode-shared-library-3.24' into 'gtk-3-24'
Dont hardcode shared library (gtk3)

See merge request GNOME/gtk!1196
2019-11-19 19:58:02 +00:00
Руслан Ижбулатов 6452d34cd7 GDK W32: no "GDK_SELECTION" event for clipboard
_gdk_win32_display_convert_selection() does not return anything,
it generates a selection notify event instead. Depending on how
successful it was, the event will have property=GDK_NONE or
property="GDK_SELECTION".

property="GDK_SELECTION" is the default return value for successful
cases, and it tells GTK to grab the data that GDK previously deposited
using selection_property_store().

The problem is that the clipboard branch of this function calls
open_clipboard_timeout(), which can't return anything meaningful (it's
normally a timeout function), and thus doesn't know whether the function
succeeded or failed. Due to my oversight, this resulted in GDK
generating two selection notification events - one from inside of
open_clipboard_timeout() (with the right property, if successful),
and one from the catch-all last line (always defaulting to "GDK_SELECTION").

This caused issue #2223, where GTK only expected exactly one
notification per request, and got confused because it was getting two.

I've looked at the code in open_clipboard_timeout(), and it seems to me
that it always generates a notification (a successful one or an
unsuccessful one). Thus the branch of the function that calls it
directly does not need to follow up with a catch-all notification and
can just return.

This seems to be fixing issue #2223, at least for me, but i'm not
entirely sure that this will not have any adverse side-effects.
Clipboard handling in GTK3 is a complicated mess.
2019-11-18 13:43:42 +00:00
Niklas Hambüchen 656adece00 Try building static libs on CI
See #2248.

Cherry-Picked-From: 3936412332
2019-11-18 03:36:03 +01:00
Niklas Hambüchen d5457d1b14 build: Don't hardcode shared_library() in meson.
Instead, use the standard library().
This is a meson best practice.

Fixes #2248.

Fixes -Ddefault_library=static not having any effect.

Cherry-Picked-From: bb9c07d8fe
2019-11-18 03:31:20 +01:00
Matthias Clasen 75475effb1 Merge branch 'issue-61' into 'gtk-3-24'
Ensure we have a client window before using it

See merge request GNOME/gtk!1194
2019-11-18 01:15:10 +00:00
Matthias Clasen e11bdfabc0 Merge branch 'issue-2226' into 'gtk-3-24'
Ensure that cached surface sizes are 1x1

See merge request GNOME/gtk!1189
2019-11-18 00:53:37 +00:00
Emmanuele Bassi 0ade87ef92 Ensure we have a client window before using it
The XIM input method can some times go into weird states, especially
when extended devices or in mixed environments with multiple input
methods installed.

Ideally, people should simply stop using XIM, which is utterly broken,
and use IBus instead; nevertheless, crashing is not nice.

Fixes: #61
Fixes: #518
2019-11-16 20:57:43 +00:00
Emmanuele Bassi 0b4f5ba817 Merge branch 'issue-183' into 'gtk-3-24'
Do not use VIQR input method for vi locale by default

See merge request GNOME/gtk!1192
2019-11-16 20:33:46 +00:00
Ming Hua 307a045e52 Do not use VIQR input method for vi locale by default
In the Vietnamese Quoted-Readable input method, punctuation following a
base letter is converted into diacritical marks, for example a( → ă.
(See <https://en.wikipedia.org/wiki/Vietnamese_Quoted-Readable>.)
A 2008 bug report in Ubuntu argued that this is a problematic default,
particularly when typing passwords, where the effect of the punctuation
is non-obvious.

According to the bug reporter, VIQR is popular with Vietnamese users
living elsewhere in the world, where Vietnamese keyboards are unlikely
to be readily available, but is not a popular choice within Vietnam,
where the Telex or VNI input modes are preferred.

Closes: #183

Bug-Debian: https://bugs.debian.org/895043
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/191451

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2019-11-16 20:16:55 +00:00
Emmanuele Bassi 8d0138bd6b Ensure that cached surface sizes are 1x1
We cannot create similar surfaces that are smaller than 1x1 on X11, so
we should always ensure that we clamp the surface size to 1x1 when
calling gdk_window_create_similar_surface().

Fixes: #2226
2019-11-16 18:54:26 +00:00
Christoph Reiter 53a05daa31 Merge branch 'ci-distcheck' into 'gtk-3-24'
(3.24) gitlab-ci: Run distcheck, but without actually running the tests

See merge request GNOME/gtk!999
2019-11-16 08:24:47 +00:00
Emmanuele Bassi 089bf46d9a Merge branch 'fix-menu-check-radio-styling-gtk3' into 'gtk-3-24'
Adwaita: Fix check/radio styling in menu (GTK3)

See merge request GNOME/gtk!1186
2019-11-15 23:25:28 +00:00
Simon McVittie 98b4428543 CI: Enable X11 and Wayland backends for Autotools
Enabling one backend (Broadway, in commit 1882ff9b) implicitly disabled
all the others, which was probably not intentional. Bring the Autotools
build into line with Meson.

Signed-off-by: Simon McVittie <smcv@debian.org>
2019-11-15 19:04:02 +01:00
Christoph Reiter c3c8ea3e88 Merge branch 'gtk3-installed-tests' into 'gtk-3-24'
gtk3/meson: port installed tests and reftests

See merge request GNOME/gtk!1110
2019-11-15 16:32:30 +00:00
nana-4 ef32ba3d6a Adwaita: Fix check/radio styling in menu
The new check/radio style increased their specificity, but it was not
synchronized in the menu styling.

This commit increases the specificity to match the updated check/radio
styling.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2096
2019-11-15 23:59:36 +09:00
Emmanuele Bassi cc8a634c3e Merge branch 'Gtk-3-24_Check_radio_refresh' into 'gtk-3-24'
Refresh check/radio styling

See merge request GNOME/gtk!1184
2019-11-15 13:42:34 +00:00
frederik.feichtmeier 5f5303f8fc Refresh check/radio styling
- use a dedicated mixin
- flatten check/radios
2019-11-15 14:26:47 +01:00
Christoph Reiter 3c2b5cda74 meson: port installed tests and reftests
I couldn't get all reftests to work reliably, so the tests failing
on either CI or on my machine are skipped for now.

Installed tests are disabled by default and can be enabled with "-Dinstalled_tests=true"
2019-11-15 12:52:03 +01:00
Alberts Muktupāvels e34037b015 menu: fix critical warning
Unset gdk-attached-grab-window from correct window.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1899
2019-11-14 19:00:50 +02:00
Stas Solovey e5550439e2 Update Russian translation 2019-11-13 18:48:45 +00:00
Benjamin Otte b6528c9f91 Merge branch 'status-icons-hidpi' into 'gtk-3-24'
statusicon: Render as cairo surface

See merge request GNOME/gtk!1135
2019-11-13 17:39:32 +00:00
Emmanuele Bassi f20bca5ec0 Merge branch 'issue-2048' into 'gtk-3-24'
Document handling both discrete and smooth scrolling

See merge request GNOME/gtk!1180
2019-11-13 15:36:32 +00:00
Emmanuele Bassi b736018843 Document handling both discrete and smooth scrolling
It can be tricky to deal with both, so let's give an example of using
both gdk_event_get_scroll_direction() and gdk_event_get_scroll_deltas().

Closes: #2048
2019-11-13 15:24:35 +00:00
Emmanuele Bassi 741e9a6278 Merge branch 'issue-2111' into 'gtk-3-24'
Do not crash when icon themes do not have a context

See merge request GNOME/gtk!1179
2019-11-13 15:23:30 +00:00
Emmanuele Bassi 21cd322df9 Do not crash when icon themes do not have a context
The Context key is not mandatory, so we need to handle its absence.

Fixes: #2111
2019-11-13 15:04:42 +00:00
Victor Kareh 4fc32b2751 statusicons: Improve code readability and remove dead code 2019-11-13 07:54:58 -05:00
Victor Kareh 1c09104dc6 statusicon: Render as cairo surface
On HiDPI displays, rendering Status Icons as pixbufs results in blurry
icons. By loading them at scale and rendering as a surface, we preserve
both their size and sharpness.
2019-11-13 07:47:50 -05:00
Emmanuele Bassi 9e72ec1c8a Merge branch 'update-libepoxy-wrap' into 'gtk-3-24'
Update libepoxy wrap

See merge request GNOME/gtk!1169
2019-11-11 13:54:00 +00:00
Luca Bacci 98711f8050 Update libepoxy wrap 2019-11-11 14:38:20 +01:00
Timm Bäder b25f193da3 Merge branch 'docs-old-boxes' into 'gtk-3-24'
docs: Clarify when to replace old boxes with Grid

See merge request GNOME/gtk!1170
2019-11-11 07:39:05 +00:00
Emmanuele Bassi d1936c1ae3 docs: Clarify when to replace old boxes with Grid
Mention that GtkGrid should only replace grid-like layouts achieved with
nested boxes.

Additionally, remove any mention of "future proofing": boxes are not
going away.
2019-11-08 18:02:13 +00:00
Emmanuele Bassi 759ee31b0c ci: Allow msys2 jobs to fail
The msys2 runner has started failing for internal reasons:

 - gtk-3-24 times out
 - master fails with a ld.exe assertion:
   BFD (GNU Binutils) 2.33.1 assertion fail
   ../../binutils-2.33.1/bfd/cofflink.c:2348

Both seem related to some MSYS2 issue. Until the runner is updated, we
should not block on it.
2019-11-05 10:53:24 +00:00
Emmanuele Bassi 1b18482d9f Merge branch 'revert-theme-change' into 'gtk-3-24'
Revert "Refresh checks and radios"

See merge request GNOME/gtk!1163
2019-11-04 23:39:25 +00:00
Emmanuele Bassi b7dfb7836f Revert "Refresh checks and radios"
This reverts commit f261b41d47.

The commit broke the theme:

  Theme parsing error: gtk-contained.css:1176:74: Not a valid image
2019-11-04 22:47:00 +00:00
Jakub Steiner 4e346076f2 Merge branch 'adwaita-emoji-picker-adjustments' into 'gtk-3-24'
Adwaita: Emoji picker adjustments

See merge request GNOME/gtk!1159
2019-11-04 19:33:39 +00:00
frederik.feichtmeier f261b41d47 Refresh checks and radios
- use a dedicated mixin to style checks and radios in _drawing.scss
- keep all special cases for checks and radios in _common.scss
- remove treeview disabled checks/radio styling because it seems no longer needed after testing with the new mixin
- add a fix for checked and indeterminate checks/radios in menus and slightly darken their borders similar to $selected_borders_color
- add a blank in front of a bracket

Fix backdrop

- remove backdrop-hover
- adapt the bg and fg look of checks/radios to other "blue" elements for example suggested action buttons
- fix selected treeview checks in backdrop being gray
2019-11-04 18:09:11 +01:00
Alex Monday 1051c1fcad Adwaita: Emoji picker adjustments
- Add margins for search entry;
- Increase side margins for emoji-section buttons box;
- Apply border-radius on hovered emoji;
- Adjust indication of hovered emoji-section button.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/2026
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1704
2019-11-03 13:03:58 +05:00
Christian Kirbach a45a2c1de9 Update German translation 2019-10-27 15:33:54 +00:00
Jiří Techet 817e99640d gdk: quartz: Avoid page up/down getting filtered by gtk_im_context_filter_keypress()
For page up/down events (Fn+up_arrow and Fn+down_arrow on macOS)
gtk_im_context_filter_keypress() currently returns TRUE when im-quartz is
used. This means these events get removed when this function is used
(happens e.g. with the Scintilla text editing library).

Adding scrollPageDown: and scrollPageUp: into GdkQuartzView seems to
resolve the issue as these seem to get called instead of the already
present pageUp: and pageDown:.
2019-10-24 21:48:30 +02:00
Anders Jonsson afb6603d09 Update Swedish translation 2019-10-23 21:01:56 +00:00
Jordi Mas 05b0e9a2f5 Update Catalan translation 2019-10-23 21:08:23 +02:00
Matthias Clasen 39e28ab933 Merge branch 'wip/carlosg/unbreak-paste-after-copy' into 'gtk-3-24'
Unbreak paste after copy

See merge request GNOME/gtk!1146
2019-10-22 17:40:43 +00:00
Carlos Garnacho ff41436b59 gdk: Do not change the windowing selection when cancelling source
We are interested in changing the owner window, so the upper bits know
that it is not this client who owns the selection. We are still not
interested in unsetting the selection desktop-wide though, so only avoid
emitting the relevant events then.

The same reasonings than in commit 7a891eeb6d apply otherwise.
2019-10-22 18:43:04 +02:00
Carlos Garnacho ba0a0ce0a0 Revert "gdk: Do not call gdk_selection_owner_set() internally to the backend"
This reverts commit 7a891eeb6d.
2019-10-22 18:36:44 +02:00
Matthias Clasen e4049d42a5 Merge branch 'wip/carlosg/avoid-selection-clear' into 'gtk-3-24'
Avoid clearing selection on wl_data_source.cancelled

See merge request GNOME/gtk!1142
2019-10-22 05:29:10 +00:00
Emmanuele Bassi ce5e97f720 Merge branch 'wip/carlosg/scroll-controller-fixes' into 'gtk-3-24'
Wip/carlosg/scroll controller fixes

See merge request GNOME/gtk!1141
2019-10-21 22:35:17 +00:00
Emmanuele Bassi 4201a57a83 Merge branch 'wip/carlosg/key-controller-fixes' into 'gtk-3-24'
key controller fixes

See merge request GNOME/gtk!1144
2019-10-21 22:33:55 +00:00
Carlos Garnacho 65bb9c505a gtkwidget: Ensure to run key controllers in the bubble phase
We fall back on controllers in event handlers' default handler,
but we weren't doing so for GDK_KEY_PRESS/RELEASE.
2019-10-21 23:42:19 +02:00
Carlos Garnacho 85f86d1533 keycontroller: Fix ::key-released signal argument
It uses the same signature than ::key-pressed, but this signal
doesn't expose a boolean return value. Use a distinct marshaller
and fix this signal emission.
2019-10-21 23:40:52 +02:00
Matthias Clasen ffaf56d1c6 key controller: Don't eat modifier events
The key controller was consuming key events
for modifier keys, for no entirely convincing
reason, which leads to problems when somebody
actually listens for those, such as the simple
input method does for C-S-u processing.

(cherry-picked from 91d6893f02)

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1884
2019-10-21 23:19:58 +02:00
Руслан Ижбулатов e860ac5cf6 GDK W32: Use Vista+ clipboard API
Use RemoveClipboardFormatListener() and AddClipboardFormatListener().
These APIs remove the need for us to maintain the integrity of the
clipboard chain, which turned out to be problematic for some reason
that is yet to be identified.

Fixes #2215
Fixes #442
2019-10-21 19:10:48 +00:00
Carlos Garnacho 7a891eeb6d gdk: Do not call gdk_selection_owner_set() internally to the backend
This should just be called by the upper layers (and result in
wl_data_device.set_selection, etc). We should not trigger this within
the backend otherwise.

Related: https://gitlab.gnome.org/GNOME/mutter/issues/878
2019-10-21 20:41:14 +02:00
Carlos Garnacho 299902b008 gdk: Shuffle the situations where a selection is unset
This should only be explicitly unset (face to the windowing) on
gdk_selection_owner_set() with a NULL window. Other circumstances
(eg. selection being taken over by another client) should just
trigger the SelectionClear event in GDK internally.

Related: https://gitlab.gnome.org/GNOME/mutter/issues/878
2019-10-21 20:41:09 +02:00
Carlos Garnacho c9a1adf2cc gtkwidget: Forward unhandled scroll events through controllers
Do just like button/motion/touch do, let the scroll events go first
through the event handler, and fallback on the current event controllers
afterwards.

Fixes handling of bubbled scroll events in the scroll controller.
2019-10-21 17:10:30 +02:00
Carlos Garnacho ebd1840802 scrollcontroller: Set scroll event mask on scroll controller
This ensures adding the controller to a widget will end up with
the expected event masks in the widget default window.
2019-10-21 17:09:17 +02:00
Jeremy Tan f91b429839 gdk: quartz: prevent titlebar events from falling to the window below 2019-10-19 20:27:50 +08:00
Christoph Reiter da90d37b42 Merge branch 'fix-module-suffic' into 'gtk-3-24'
meson: ensure plugins have so extension on macOS

See merge request GNOME/gtk!1130
2019-10-17 21:18:56 +00:00
Benjamin Otte 0ecebd89bc Merge branch 'can_focus' into 'gtk-3-24'
GtkEntry: Make GtkEntry: gtk_entry_grab_focus_without_selecting ()  behave like gtk_widget_grab_focus ()

See merge request GNOME/gtk!1137
2019-10-17 13:05:38 +00:00
Julian Sparber ac39847187 GtkEntry: Make GtkEntry: gtk_entry_grab_focus_without_selecting () behave like gtk_widget_grab_focus ()
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2204
2019-10-17 14:32:24 +02:00
Goran Vidović 3aa9dfe16d Update Croatian translation 2019-10-17 11:42:35 +00:00
Charles Monzat 4beed12317 Update French translation 2019-10-13 07:51:33 +00:00
Tom Schoonjans fa07007389 meson: ensure plugins have so extension on macOS 2019-10-11 08:55:12 +01:00
Balázs Úr 043ec471bd Update Hungarian translation 2019-10-10 12:15:12 +00:00
Kukuh Syafaat 1e41c723b8 Update Indonesian translation 2019-10-10 08:37:37 +00:00
Matthias Clasen e997ef60da Merge branch 'wip/carlosg/tablet-invalid-reads' into 'gtk-3-24'
Fix invalid reads on tablet input

See merge request GNOME/gtk!1121
2019-10-09 12:18:02 +00:00
Jakub Steiner 3c161b136e Merge branch 'fix-menubar-menu-rounding' into 'gtk-3-24'
Adwaita: Fix rounding on menubar menus really

See merge request GNOME/gtk!1123
2019-10-08 17:17:37 +00:00
nana-4 d250e51018 Adwaita: Fix rounding on menubar menus really
Prioritize the style by increasing specificity.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1976
2019-10-09 01:21:00 +09:00
Carlos Garnacho bcd384711a gdk: Avoid poking possibly freed memory
The event may end up freed after delivery, ensure to keep the data we need
in order to emit the matching emulated crossed event matching a proximity
event.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2157
2019-10-08 17:59:43 +02:00
Carlos Garnacho d70f85d6b9 gdk: Fix wl_output accounting on tablet devices
The code managing this accounting mixed seat and tablet output lists,
can't bode well. Fixes invalid reads on list elements, as there are
dangling pointers.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2157
2019-10-08 17:59:37 +02:00
Yi-Jyun Pan d7c95ad542 Update Chinese (Taiwan) translation 2019-10-08 11:44:43 +00:00
Christoph Reiter 3a22e0c595 Merge branch 'lb90-gtk-3-24-patch-56691' into 'gtk-3-24'
[win32 CSS theme] Fix a small syntax error

See merge request GNOME/gtk!1118
2019-10-07 16:30:09 +00:00
Luca Bacci 5c6ca889de Small syntax fix for win32 CSS theme 2019-10-07 16:27:32 +02:00
Alan Mortensen e1f0a34781 Updated Danish translation of gtk 2019-10-06 23:36:20 +02:00
Daniel Boles 914558f971 Builder: Fix typos and unended sentence in docs 2019-10-06 20:49:47 +01:00
Philip Withnall 8ce68a5194 gtklistbox: Only unparent header rows if they haven’t been reused
It’s possible for code which uses a `GtkListBox` to reuse a single
header row, and move it around between rows. For example, this might
happen if the code has interactive widgets (like buttons) in the row,
and doesn’t want to continually recreate them and reattach signals to
them whenever the row headers change.

Unfortunately, this was broken, as the old header widget was
unconditionally unparented, even if it had just been set as the header
for a different row in the same `GtkListBox`. This left it assigned as
a child widget in the `GtkListBox` (so it was iterated over by
`forall`), but without its parent widget set.

Fix that by only unparenting the header if it hasn’t already been
assigned as the parent of a different row.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-10-04 14:30:33 -04:00
Simon McVittie fbb3c146ea CI: Optionally run distcheck, but without actually running the tests
This can be used to verify that we can build a release tarball using
Autotools, without being subject to known-failing tests (which are less
straightforward to fix). Since commit 44a2d5d6 the Meson build skips
the failing a11y tests, but we don't have an equally easy mechanism
to skip those on Autotools.

Signed-off-by: Simon McVittie <smcv@debian.org>
2019-08-06 14:30:43 +01:00
Simon McVittie e18e9a7064 CI: Enable X11 and Wayland backends for Autotools
Enabling one backend (Broadway, in commit 1882ff9b) implicitly disabled
all the others, which was probably not intentional. Bring the Autotools
build into line with Meson.

Signed-off-by: Simon McVittie <smcv@debian.org>
2019-08-06 14:29:13 +01:00
John Ralls ef72fe750a Hide Objective-C from outside GdkQuartz.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1737

Don't export any functions taking or returning MacOS types in
gdkquartz.h, gdkprivate-quartz.h, or any header that either includes.

The GdkQuartz internal functions are moved to a new header
gdkinternal-quartz.h, the functions used by quartz-specific
Gtk files are moved to another new header gdkquartz-gtk-only.h, and
the key and event enums to a new header gdkkeys-quartz.h.
2019-06-22 13:37:46 -07:00
175 changed files with 51814 additions and 27293 deletions
+16 -2
View File
@@ -1,4 +1,4 @@
image: registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v2
image: registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v3
stages:
- build
@@ -12,7 +12,15 @@ fedora-autotools:
script:
- bash -x ./.gitlab-ci/test-docker-autotools.sh
fedora-meson:
fedora-distcheck:
variables:
DO_DISTCHECK: "yes"
when: manual
stage: build
script:
- bash -x ./.gitlab-ci/test-docker-autotools.sh
fedora-meson: &fedora-meson-defaults
stage: build
script:
- bash -x ./.gitlab-ci/test-docker-meson.sh
@@ -21,6 +29,12 @@ fedora-meson:
name: "gtk3-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
paths:
- "_build/meson-logs"
- "_build/testsuite/reftests/output"
fedora-meson-staticlibs:
variables:
EXTRA_MESON_FLAGS: "-Ddefault_library=both"
<<: *fedora-meson-defaults
msys2-mingw32-meson:
variables:
+2 -1
View File
@@ -1,4 +1,4 @@
FROM fedora:29
FROM fedora:31
RUN dnf -y install \
adwaita-icon-theme \
@@ -41,6 +41,7 @@ RUN dnf -y install \
libxkbcommon-devel \
libXrandr-devel \
libXrender-devel \
libXtst-devel \
make \
mesa-libEGL-devel \
mesa-libwayland-egl-devel \
+7
View File
@@ -11,6 +11,13 @@ cd _build
../autogen.sh \
--enable-cloudproviders \
--enable-broadway-backend \
--enable-wayland-backend \
--enable-x11-backend \
--enable-xinerama \
--enable-gtk-doc
make -j8
if [ -n "${DO_DISTCHECK-}" ]; then
make -j8 check SKIP_GDKTARGET="echo Not actually running tests for now"
make -j8 distcheck SKIP_GDKTARGET="echo Not actually running tests for now"
fi
+2
View File
@@ -12,9 +12,11 @@ python3 -m pip install --user meson==0.49.2
meson \
-Dgtk_doc=true \
-Dman=true \
-Dinstalled_tests=true \
-Dbroadway_backend=true \
-Dxinerama=yes \
-Dprint_backends="file,lpr,test,cloudprint,cups" \
${EXTRA_MESON_FLAGS:-} \
_build
cd _build
+1 -2
View File
@@ -28,8 +28,7 @@ pacman --noconfirm -S --needed \
mingw-w64-$MSYS2_ARCH-shared-mime-info \
mingw-w64-$MSYS2_ARCH-meson \
mingw-w64-$MSYS2_ARCH-ninja \
mingw-w64-$MSYS2_ARCH-gtk-doc \
mingw-w64-$MSYS2_ARCH-sassc
mingw-w64-$MSYS2_ARCH-gtk-doc
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
+46
View File
@@ -1,3 +1,49 @@
Overview of Changes in GTK+ 3.24.13
===================================
* listbox: Fix header row reuse
* wayland: Fix handling of tablets
* theme:
- Adwaita: Fix menu rounding
- Adwaita: Various improvements for the Emoji chooser
- Adwaita: Refresh check and radio buttons
- HighContrast: Fix entry colors
* input:
- Properly handle bubbling of scroll events
- Handle modifier key events properly
- Run key controllers in the bubble phase
- Do not use VIQR for Vietnamese by default
* statusicons: Render sharply on hi-dpi
* wayland: Fix handling of selection ownership
* win32:
- Set WS_BORDER for fullscreen GL windows if requested
- Fix clipboard handling
* quartz:
- Handle titlebar events properly
- Handle page up/down key events properly
* broadway: Fix (lack of) clipboard handling
* Translation updates:
Catalan
Chinese (Taiwan)
Croatian
Danish
French
German
Hungarian
Indonesian
Russian
Swedish
Overview of Changes in GTK+ 3.24.12
===================================
+2 -2
View File
@@ -10,8 +10,8 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [24])
m4_define([gtk_micro_version], [12])
m4_define([gtk_interface_age], [8])
m4_define([gtk_micro_version], [13])
m4_define([gtk_interface_age], [9])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
+4 -3
View File
@@ -96,11 +96,12 @@ drawing_area_draw (GtkWidget *widget,
cairo_pattern_t *pat;
cairo_matrix_t matrix;
gdouble angle, scale;
gdouble x_center, y_center;
gtk_gesture_get_bounding_box_center (GTK_GESTURE (zoom), &x_center, &y_center);
cairo_get_matrix (cr, &matrix);
cairo_matrix_translate (&matrix,
allocation.width / 2,
allocation.height / 2);
cairo_matrix_translate (&matrix, x_center, y_center);
cairo_save (cr);
+1
View File
@@ -97,6 +97,7 @@ do_infobar (GtkWidget *do_widget)
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
gtk_info_bar_set_default_response (GTK_INFO_BAR (bar), GTK_RESPONSE_OK);
button = gtk_toggle_button_new_with_label ("Question");
g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL);
-1
View File
@@ -222,7 +222,6 @@ libgdk_3_la_LIBADD += x11/libgdk-x11.la
endif # USE_X11
if USE_QUARTZ
libgdk_3_la_CFLAGS += -xobjective-c
libgdk_3_la_LIBADD += quartz/libgdk-quartz.la
endif # USE_QUARTZ
-6
View File
@@ -38,12 +38,6 @@
#endif
#ifdef GDK_WINDOWING_QUARTZ
/* When the gdk_quartz_display_open function is removed We can
* immediately include gdkquartzdisplaymanager.h here instead of
* gdkprivate-quartz.h so that we wont have to enable -xobjective-c
* for the “generic” GDK source code.
* #include "quartz/gdkquartzdisplaymanager.h"
*/
#include "quartz/gdkprivate-quartz.h"
#endif
+41
View File
@@ -1363,7 +1363,45 @@ gdk_event_get_keycode (const GdkEvent *event,
*
* Extracts the scroll direction from an event.
*
* If @event is not of type %GDK_SCROLL, the contents of @direction
* are undefined.
*
* If you wish to handle both discrete and smooth scrolling, you
* should check the return value of this function, or of
* gdk_event_get_scroll_deltas(); for instance:
*
* |[<!-- language="C" -->
* GdkScrollDirection direction;
* double vscroll_factor = 0.0;
* double x_scroll, y_scroll;
*
* if (gdk_event_get_scroll_direction (event, &direction))
* {
* // Handle discrete scrolling with a known constant delta;
* const double delta = 12.0;
*
* switch (direction)
* {
* case GDK_SCROLL_UP:
* vscroll_factor = -delta;
* break;
* case GDK_SCROLL_DOWN:
* vscroll_factor = delta;
* break;
* default:
* // no scrolling
* break;
* }
* }
* else if (gdk_event_get_scroll_deltas (event, &x_scroll, &y_scroll))
* {
* // Handle smooth scrolling directly
* vscroll_factor = y_scroll;
* }
* ]|
*
* Returns: %TRUE if the event delivered a scroll direction
* and %FALSE otherwise
*
* Since: 3.2
*/
@@ -1401,7 +1439,10 @@ gdk_event_get_scroll_direction (const GdkEvent *event,
*
* Retrieves the scroll deltas from a #GdkEvent
*
* See also: gdk_event_get_scroll_direction()
*
* Returns: %TRUE if the event contains smooth scroll information
* and %FALSE otherwise
*
* Since: 3.4
**/
+2
View File
@@ -396,6 +396,7 @@ gdk_seat_default_remove_slave (GdkSeatDefault *seat,
priv->capabilities |= device_get_capability (GDK_DEVICE (l->data));
gdk_seat_device_removed (GDK_SEAT (seat), device);
g_object_unref (device);
}
else if (g_list_find (priv->slave_keyboards, device))
{
@@ -405,6 +406,7 @@ gdk_seat_default_remove_slave (GdkSeatDefault *seat,
priv->capabilities &= ~GDK_SEAT_CAPABILITY_KEYBOARD;
gdk_seat_device_removed (GDK_SEAT (seat), device);
g_object_unref (device);
}
}
+14 -14
View File
@@ -286,20 +286,20 @@ if cc.get_id() == 'msvc'
gdk_link_args += [ '-export:gdk_win32_display_manager_get_type' ]
endif
libgdk = shared_library('gdk-3',
soversion: gtk_soversion,
version: gtk_library_version,
sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig],
dependencies: gdk_deps,
include_directories: [confinc, gdkx11_inc, wlinc],
c_args: [
'-DGDK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
link_whole: gdk_backends,
link_args: gdk_link_args,
darwin_versions : gtk_osxversions,
install: true)
libgdk = library('gdk-3',
soversion: gtk_soversion,
version: gtk_library_version,
sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig],
dependencies: gdk_deps,
include_directories: [confinc, gdkx11_inc, wlinc],
c_args: [
'-DGDK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
link_whole: gdk_backends,
link_args: gdk_link_args,
darwin_versions : gtk_osxversions,
install: true)
gdk_dep_sources = [gdkconfig, gdkenum_h]
# Introspection
+2
View File
@@ -21,6 +21,8 @@
#include "gdkquartzwindow.h"
#include "gdkdnd-quartz.h"
#include "gdkprivate-quartz.h"
#include "gdkinternal-quartz.h"
#include "gdkquartzdnd.h"
@implementation GdkQuartzNSWindow
+15
View File
@@ -23,6 +23,7 @@
#include "gdkquartzwindow.h"
#include "gdkprivate-quartz.h"
#include "gdkquartz.h"
#include "gdkinternal-quartz.h"
@implementation GdkQuartzView
@@ -532,6 +533,20 @@
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)scrollPageDown: (id)sender
{
GDK_NOTE (EVENTS, g_message ("scrollPageDown"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)scrollPageUp: (id)sender
{
GDK_NOTE (EVENTS, g_message ("scrollPageUp"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)selectAll: (id)sender
{
GDK_NOTE (EVENTS, g_message ("selectAll"));
+3
View File
@@ -38,7 +38,9 @@ libgdk_quartz_la_SOURCES = \
gdkglcontext-quartz.c \
gdkglcontext-quartz.h \
gdkglobals-quartz.c \
gdkinternal-quartz.h \
gdkkeys-quartz.c \
gdkkeys-quartz.h \
gdkmonitor-quartz.c \
gdkmonitor-quartz.h \
gdkprivate-quartz.h \
@@ -58,6 +60,7 @@ libgdkinclude_HEADERS = \
gdkquartz.h
libgdkquartzinclude_HEADERS = \
gdkquartz-gtk-only.h \
gdkquartzcursor.h \
gdkquartzdevice-core.h \
gdkquartzdevicemanager-core.h \
+2
View File
@@ -23,6 +23,8 @@
#include "gdkcursorprivate.h"
#include "gdkquartzcursor.h"
#include "gdkprivate-quartz.h"
#include "gdkinternal-quartz.h"
#include "gdkquartz-gtk-only.h"
#include "xcursors.h"
+1
View File
@@ -26,6 +26,7 @@
#include "gdkquartzcursor.h"
#include "gdkprivate-quartz.h"
#include "gdkquartzdevice-core.h"
#include "gdkinternal-quartz.h"
struct _GdkQuartzDeviceCore
{
+2 -3
View File
@@ -88,9 +88,6 @@ _gdk_quartz_display_open (const gchar *display_name)
if (_gdk_display != NULL)
return NULL;
/* Initialize application */
[NSApplication sharedApplication];
_gdk_display = g_object_new (gdk_quartz_display_get_type (), NULL);
_gdk_display->device_manager = _gdk_device_manager_new (_gdk_display);
@@ -101,6 +98,8 @@ _gdk_quartz_display_open (const gchar *display_name)
_gdk_quartz_events_init ();
/* Initialize application */
[NSApplication sharedApplication];
#if 0
/* FIXME: Remove the #if 0 when we have these functions */
_gdk_quartz_dnd_init ();
+1
View File
@@ -25,6 +25,7 @@
#include "gdkwindow.h"
#include "gdkinternals.h"
#include "gdkmain.h"
#include "gdkinternal-quartz.h"
G_BEGIN_DECLS
+2 -1
View File
@@ -20,7 +20,8 @@
#include "gdkdnd.h"
#include "gdkquartzdnd.h"
#include "gdkprivate-quartz.h"
#include "gdkinternal-quartz.h"
#include "gdkquartz-gtk-only.h"
G_DEFINE_TYPE (GdkQuartzDragContext, gdk_quartz_drag_context, GDK_TYPE_DRAG_CONTEXT)
-1
View File
@@ -21,7 +21,6 @@
#define __GDK_QUARTZ_DND__
#include <gdkdndprivate.h>
#include "gdkquartzdnd.h"
#include <AppKit/AppKit.h>
+13
View File
@@ -7,6 +7,7 @@
#include <unistd.h>
#include "gdkprivate-quartz.h"
#include "gdkinternal-quartz.h"
#include <gdk/gdkdisplayprivate.h>
/*
@@ -152,6 +153,18 @@ static const char *const state_names[] = {
};
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
typedef enum
{
GDK_QUARTZ_EVENT_MASK_ANY = NSAnyEventMask,
} GdkQuartzEventMask;
#else
typedef enum
{
GDK_QUARTZ_EVENT_MASK_ANY = NSEventMaskAny,
} GdkQuartzEventMask;
#endif
static SelectThreadState select_thread_state = BEFORE_START;
static pthread_t select_thread;
+26
View File
@@ -34,8 +34,10 @@
#include "gdkquartz.h"
#include "gdkquartzdisplay.h"
#include "gdkprivate-quartz.h"
#include "gdkinternal-quartz.h"
#include "gdkquartzdevicemanager-core.h"
#include "gdkquartzkeys.h"
#include "gdkkeys-quartz.h"
#define GRIP_WIDTH 15
#define GRIP_HEIGHT 15
@@ -51,6 +53,7 @@
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN && \
GDK_WINDOW_TYPE (window) != GDK_WINDOW_OFFSCREEN)
/* This is the window corresponding to the key window */
static GdkWindow *current_keyboard_window;
@@ -457,6 +460,29 @@ get_toplevel_from_ns_event (NSEvent *nsevent,
* here, not very nice.
*/
_gdk_quartz_events_break_all_grabs (get_time_from_ns_event (nsevent));
/* Check if the event occurred on the titlebar. If it did,
* explicitly return NULL to prevent going through the
* fallback path, which could match the window that is
* directly under the titlebar.
*/
if (view_point.y < 0 &&
view_point.x >= view_frame.origin.x &&
view_point.x < view_frame.origin.x + view_frame.size.width)
{
NSView *superview = [view superview];
if (superview)
{
NSRect superview_frame = [superview frame];
int titlebar_height = superview_frame.size.height -
view_frame.size.height;
if (titlebar_height > 0 && view_point.y >= -titlebar_height)
{
return NULL;
}
}
}
}
else
{
+1
View File
@@ -28,6 +28,7 @@
#include "gdkquartzglcontext.h"
#include "gdkquartzwindow.h"
#include "gdkprivate-quartz.h"
#include "gdkquartz-gtk-only.h"
#include "gdkinternals.h"
+1
View File
@@ -20,6 +20,7 @@
#include "gdktypes.h"
#include "gdkprivate.h"
#include "gdkquartz.h"
#include "gdkinternal-quartz.h"
GdkDisplay *_gdk_display = NULL;
GdkScreen *_gdk_screen = NULL;
+265
View File
@@ -0,0 +1,265 @@
/* gdkinternal-quartz.h
*
* Copyright (C) 2005-2007 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_INTERNAL_QUARTZ_H__
#define __GDK_INTERNAL_QUARTZ_H__
#include <AppKit/AppKit.h>
/* This is mostly a pot of function prototypes to avoid having
* separate include file for each implementation file that exports
* functions to one other file in GdkQuartz.
*/
/* NSInteger only exists in Leopard and newer. This check has to be
* done after inclusion of the system headers. If NSInteger has not
* been defined, we know for sure that we are on 32-bit.
*/
#ifndef NSINTEGER_DEFINED
typedef int NSInteger;
typedef unsigned int NSUInteger;
#endif
#ifndef CGFLOAT_DEFINED
typedef float CGFloat;
#endif
#define GDK_QUARTZ_ALLOC_POOL NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]
#define GDK_QUARTZ_RELEASE_POOL [pool release]
#include <gdk/gdkprivate.h>
#include <gdk/quartz/gdkquartz.h>
#include <gdk/quartz/gdkdevicemanager-core-quartz.h>
#include <gdk/quartz/gdkdnd-quartz.h>
#include <gdk/quartz/gdkscreen-quartz.h>
#include <gdk/quartz/gdkwindow-quartz.h>
#include <gdk/gdk.h>
#include "config.h"
extern GdkDisplay *_gdk_display;
extern GdkScreen *_gdk_screen;
extern GdkWindow *_gdk_root;
extern GdkDragContext *_gdk_quartz_drag_source_context;
#define GDK_WINDOW_IS_QUARTZ(win) (GDK_IS_WINDOW_IMPL_QUARTZ (((GdkWindow *)win)->impl))
/* Initialization */
void _gdk_quartz_window_init_windowing (GdkDisplay *display,
GdkScreen *screen);
void _gdk_quartz_events_init (void);
void _gdk_quartz_event_loop_init (void);
/* Cursor */
NSCursor *_gdk_quartz_cursor_get_ns_cursor (GdkCursor *cursor);
/* Events */
typedef enum {
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
} GdkQuartzEventSubType;
void _gdk_quartz_events_update_focus_window (GdkWindow *new_window,
gboolean got_focus);
void _gdk_quartz_events_send_map_event (GdkWindow *window);
GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers (void);
GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void);
void _gdk_quartz_events_break_all_grabs (guint32 time);
/* Event loop */
gboolean _gdk_quartz_event_loop_check_pending (void);
NSEvent * _gdk_quartz_event_loop_get_pending (void);
void _gdk_quartz_event_loop_release_event (NSEvent *event);
/* Keys */
GdkEventType _gdk_quartz_keys_event_type (NSEvent *event);
gboolean _gdk_quartz_keys_is_modifier (guint keycode);
void _gdk_quartz_synthesize_null_key_event (GdkWindow *window);
/* Drag and Drop */
void _gdk_quartz_window_register_dnd (GdkWindow *window);
GdkDragContext * _gdk_quartz_window_drag_begin (GdkWindow *window,
GdkDevice *device,
GList *targets,
gint x_root,
gint y_root);
/* Display */
GdkDisplay * _gdk_quartz_display_open (const gchar *name);
/* Display methods - events */
void _gdk_quartz_display_queue_events (GdkDisplay *display);
gboolean _gdk_quartz_display_has_pending (GdkDisplay *display);
void _gdk_quartz_display_event_data_copy (GdkDisplay *display,
const GdkEvent *src,
GdkEvent *dst);
void _gdk_quartz_display_event_data_free (GdkDisplay *display,
GdkEvent *event);
/* Display methods - cursor */
GdkCursor *_gdk_quartz_display_get_cursor_for_type (GdkDisplay *display,
GdkCursorType type);
GdkCursor *_gdk_quartz_display_get_cursor_for_name (GdkDisplay *display,
const gchar *name);
GdkCursor *_gdk_quartz_display_get_cursor_for_surface (GdkDisplay *display,
cairo_surface_t *surface,
gdouble x,
gdouble y);
gboolean _gdk_quartz_display_supports_cursor_alpha (GdkDisplay *display);
gboolean _gdk_quartz_display_supports_cursor_color (GdkDisplay *display);
void _gdk_quartz_display_get_default_cursor_size (GdkDisplay *display,
guint *width,
guint *height);
void _gdk_quartz_display_get_maximal_cursor_size (GdkDisplay *display,
guint *width,
guint *height);
/* Display methods - keymap */
GdkKeymap * _gdk_quartz_display_get_keymap (GdkDisplay *display);
/* Display methods - selection */
gboolean _gdk_quartz_display_set_selection_owner (GdkDisplay *display,
GdkWindow *owner,
GdkAtom selection,
guint32 time,
gboolean send_event);
GdkWindow * _gdk_quartz_display_get_selection_owner (GdkDisplay *display,
GdkAtom selection);
gint _gdk_quartz_display_get_selection_property (GdkDisplay *display,
GdkWindow *requestor,
guchar **data,
GdkAtom *ret_type,
gint *ret_format);
void _gdk_quartz_display_convert_selection (GdkDisplay *display,
GdkWindow *requestor,
GdkAtom selection,
GdkAtom target,
guint32 time);
gint _gdk_quartz_display_text_property_to_utf8_list (GdkDisplay *display,
GdkAtom encoding,
gint format,
const guchar *text,
gint length,
gchar ***list);
gchar * _gdk_quartz_display_utf8_to_string_target (GdkDisplay *displayt,
const gchar *str);
/* Screen */
GdkScreen *_gdk_quartz_screen_new (void);
void _gdk_quartz_screen_update_window_sizes (GdkScreen *screen);
/* Screen methods - visual */
GdkVisual * _gdk_quartz_screen_get_rgba_visual (GdkScreen *screen);
GdkVisual * _gdk_quartz_screen_get_system_visual (GdkScreen *screen);
gint _gdk_quartz_screen_visual_get_best_depth (GdkScreen *screen);
GdkVisualType _gdk_quartz_screen_visual_get_best_type (GdkScreen *screen);
GdkVisual * _gdk_quartz_screen_get_system_visual (GdkScreen *screen);
GdkVisual* _gdk_quartz_screen_visual_get_best (GdkScreen *screen);
GdkVisual* _gdk_quartz_screen_visual_get_best_with_depth (GdkScreen *screen,
gint depth);
GdkVisual* _gdk_quartz_screen_visual_get_best_with_type (GdkScreen *screen,
GdkVisualType visual_type);
GdkVisual* _gdk_quartz_screen_visual_get_best_with_both (GdkScreen *screen,
gint depth,
GdkVisualType visual_type);
void _gdk_quartz_screen_query_depths (GdkScreen *screen,
gint **depths,
gint *count);
void _gdk_quartz_screen_query_visual_types (GdkScreen *screen,
GdkVisualType **visual_types,
gint *count);
void _gdk_quartz_screen_init_visuals (GdkScreen *screen);
GList * _gdk_quartz_screen_list_visuals (GdkScreen *screen);
/* Screen methods - events */
void _gdk_quartz_screen_broadcast_client_message (GdkScreen *screen,
GdkEvent *event);
gboolean _gdk_quartz_screen_get_setting (GdkScreen *screen,
const gchar *name,
GValue *value);
gboolean _gdk_quartz_window_is_ancestor (GdkWindow *ancestor,
GdkWindow *window);
void _gdk_quartz_window_gdk_xy_to_xy (gint gdk_x,
gint gdk_y,
gint *ns_x,
gint *ns_y);
void _gdk_quartz_window_xy_to_gdk_xy (gint ns_x,
gint ns_y,
gint *gdk_x,
gint *gdk_y);
void _gdk_quartz_window_nspoint_to_gdk_xy (NSPoint point,
gint *x,
gint *y);
GdkWindow *_gdk_quartz_window_find_child (GdkWindow *window,
gint x,
gint y,
gboolean get_toplevel);
void _gdk_quartz_window_attach_to_parent (GdkWindow *window);
void _gdk_quartz_window_detach_from_parent (GdkWindow *window);
void _gdk_quartz_window_did_become_main (GdkWindow *window);
void _gdk_quartz_window_did_resign_main (GdkWindow *window);
void _gdk_quartz_window_debug_highlight (GdkWindow *window,
gint number);
void _gdk_quartz_window_update_position (GdkWindow *window);
void _gdk_quartz_window_update_fullscreen_state (GdkWindow *window);
/* Window methods - testing */
void _gdk_quartz_window_sync_rendering (GdkWindow *window);
gboolean _gdk_quartz_window_simulate_key (GdkWindow *window,
gint x,
gint y,
guint keyval,
GdkModifierType modifiers,
GdkEventType key_pressrelease);
gboolean _gdk_quartz_window_simulate_button (GdkWindow *window,
gint x,
gint y,
guint button,
GdkModifierType modifiers,
GdkEventType button_pressrelease);
/* Window methods - property */
gboolean _gdk_quartz_window_get_property (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gulong offset,
gulong length,
gint pdelete,
GdkAtom *actual_property_type,
gint *actual_format_type,
gint *actual_length,
guchar **data);
void _gdk_quartz_window_change_property (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gint format,
GdkPropMode mode,
const guchar *data,
gint nelements);
void _gdk_quartz_window_delete_property (GdkWindow *window,
GdkAtom property);
#endif /* __GDK_INTERNAL_QUARTZ_H__ */
+16 -16
View File
@@ -55,6 +55,8 @@
#include "gdkquartzkeys.h"
#include "gdkkeysprivate.h"
#include "gdkkeysyms.h"
#include "gdkkeys-quartz.h"
#include "gdkinternal-quartz.h"
#define NUM_KEYCODES 128
#define KEYVALS_PER_KEYCODE 4
@@ -648,7 +650,6 @@ gdk_quartz_keymap_translate_keyboard_state (GdkKeymap *keymap,
{
guint tmp_keyval;
GdkModifierType bit;
guint tmp_modifiers = 0;
if (keyval)
*keyval = 0;
@@ -662,24 +663,23 @@ gdk_quartz_keymap_translate_keyboard_state (GdkKeymap *keymap,
if (hardware_keycode < 0 || hardware_keycode >= NUM_KEYCODES)
return FALSE;
/* Check if modifiers modify the keyval */
for (bit = GDK_SHIFT_MASK; bit < GDK_BUTTON1_MASK; bit <<= 1)
{
if (translate_keysym (hardware_keycode,
(bit == GDK_MOD1_MASK) ? 0 : group,
state & ~bit,
NULL, NULL) !=
translate_keysym (hardware_keycode,
(bit == GDK_MOD1_MASK) ? 1 : group,
state | bit,
NULL, NULL))
tmp_modifiers |= bit;
}
tmp_keyval = translate_keysym (hardware_keycode, group, state, level, effective_group);
/* Check if modifiers modify the keyval */
if (consumed_modifiers)
*consumed_modifiers = tmp_modifiers;
{
guint tmp_modifiers = (state & GDK_MODIFIER_MASK);
for (bit = 1; bit <= tmp_modifiers; bit <<= 1)
{
if ((bit & tmp_modifiers) &&
translate_keysym (hardware_keycode, group, state & ~bit,
NULL, NULL) == tmp_keyval)
tmp_modifiers &= ~bit;
}
*consumed_modifiers = tmp_modifiers;
}
if (keyval)
*keyval = tmp_keyval;
+85
View File
@@ -0,0 +1,85 @@
/* gdkkeys-quartz.h
*
* Copyright (C) 2005-2007 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_KEYS_QUARTZ_H__
#define __GDK_KEYS_QUARTZ_H__
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
typedef enum
{
GDK_QUARTZ_FLAGS_CHANGED = NSFlagsChanged,
GDK_QUARTZ_KEY_UP = NSKeyUp,
GDK_QUARTZ_KEY_DOWN = NSKeyDown,
GDK_QUARTZ_MOUSE_ENTERED = NSMouseEntered,
GDK_QUARTZ_MOUSE_EXITED = NSMouseExited,
GDK_QUARTZ_SCROLL_WHEEL = NSScrollWheel,
GDK_QUARTZ_MOUSE_MOVED = NSMouseMoved,
GDK_QUARTZ_OTHER_MOUSE_DRAGGED = NSOtherMouseDragged,
GDK_QUARTZ_RIGHT_MOUSE_DRAGGED = NSRightMouseDragged,
GDK_QUARTZ_LEFT_MOUSE_DRAGGED = NSLeftMouseDragged,
GDK_QUARTZ_OTHER_MOUSE_UP = NSOtherMouseUp,
GDK_QUARTZ_RIGHT_MOUSE_UP = NSRightMouseUp,
GDK_QUARTZ_LEFT_MOUSE_UP = NSLeftMouseUp,
GDK_QUARTZ_OTHER_MOUSE_DOWN = NSOtherMouseDown,
GDK_QUARTZ_RIGHT_MOUSE_DOWN = NSRightMouseDown,
GDK_QUARTZ_LEFT_MOUSE_DOWN = NSLeftMouseDown,
} GdkQuartzEventType;
typedef enum
{
GDK_QUARTZ_ALTERNATE_KEY_MASK = NSAlternateKeyMask,
GDK_QUARTZ_CONTROL_KEY_MASK = NSControlKeyMask,
GDK_QUARTZ_SHIFT_KEY_MASK = NSShiftKeyMask,
GDK_QUARTZ_ALPHA_SHIFT_KEY_MASK = NSAlphaShiftKeyMask,
GDK_QUARTZ_COMMAND_KEY_MASK = NSCommandKeyMask,
GDK_QUARTZ_ANY_EVENT_MASK = NSAnyEventMask,
} GdkQuartzEventModifierFlags;
#else
typedef enum
{
GDK_QUARTZ_FLAGS_CHANGED = NSEventTypeFlagsChanged,
GDK_QUARTZ_KEY_UP = NSEventTypeKeyUp,
GDK_QUARTZ_KEY_DOWN = NSEventTypeKeyDown,
GDK_QUARTZ_MOUSE_ENTERED = NSEventTypeMouseEntered,
GDK_QUARTZ_MOUSE_EXITED = NSEventTypeMouseExited,
GDK_QUARTZ_SCROLL_WHEEL = NSEventTypeScrollWheel,
GDK_QUARTZ_MOUSE_MOVED = NSEventTypeMouseMoved,
GDK_QUARTZ_OTHER_MOUSE_DRAGGED = NSEventTypeOtherMouseDragged,
GDK_QUARTZ_RIGHT_MOUSE_DRAGGED = NSEventTypeRightMouseDragged,
GDK_QUARTZ_LEFT_MOUSE_DRAGGED = NSEventTypeLeftMouseDragged,
GDK_QUARTZ_OTHER_MOUSE_UP = NSEventTypeOtherMouseUp,
GDK_QUARTZ_RIGHT_MOUSE_UP = NSEventTypeRightMouseUp,
GDK_QUARTZ_LEFT_MOUSE_UP = NSEventTypeLeftMouseUp,
GDK_QUARTZ_OTHER_MOUSE_DOWN = NSEventTypeOtherMouseDown,
GDK_QUARTZ_RIGHT_MOUSE_DOWN = NSEventTypeRightMouseDown,
GDK_QUARTZ_LEFT_MOUSE_DOWN = NSEventTypeLeftMouseDown,
} GdkQuartzEventType;
typedef enum
{
GDK_QUARTZ_ALTERNATE_KEY_MASK = NSEventModifierFlagOption,
GDK_QUARTZ_CONTROL_KEY_MASK = NSEventModifierFlagControl,
GDK_QUARTZ_SHIFT_KEY_MASK = NSEventModifierFlagShift,
GDK_QUARTZ_ALPHA_SHIFT_KEY_MASK = NSEventModifierFlagCapsLock,
GDK_QUARTZ_COMMAND_KEY_MASK = NSEventModifierFlagCommand,
} GdkQuartzEventModifierFlags;
#endif
#endif /* __GDK_KEYS_QUARTZ_H__ */
-1
View File
@@ -23,7 +23,6 @@
#include "gdkmonitor-quartz.h"
#include "gdkdisplay-quartz.h"
G_DEFINE_TYPE (GdkQuartzMonitor, gdk_quartz_monitor, GDK_TYPE_MONITOR)
static void
+1
View File
@@ -25,6 +25,7 @@
#include "gdkquartzmonitor.h"
#include "gdkprivate-quartz.h"
#include "gdkinternal-quartz.h"
struct _GdkQuartzMonitor
{
+1 -213
View File
@@ -1,4 +1,4 @@
/* gdkwindow-quartz.c
/* gdkprivate-quartz.h
*
* Copyright (C) 2005-2007 Imendio AB
*
@@ -19,15 +19,6 @@
#ifndef __GDK_PRIVATE_QUARTZ_H__
#define __GDK_PRIVATE_QUARTZ_H__
#define GDK_QUARTZ_ALLOC_POOL NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]
#define GDK_QUARTZ_RELEASE_POOL [pool release]
#include <gdk/gdkprivate.h>
#include <gdk/quartz/gdkquartz.h>
#include <gdk/quartz/gdkdevicemanager-core-quartz.h>
#include <gdk/quartz/gdkdnd-quartz.h>
#include <gdk/quartz/gdkscreen-quartz.h>
#include <gdk/quartz/gdkwindow-quartz.h>
#include <gdk/gdk.h>
@@ -35,215 +26,12 @@
#include "config.h"
extern GdkDisplay *_gdk_display;
extern GdkScreen *_gdk_screen;
extern GdkWindow *_gdk_root;
extern GdkDragContext *_gdk_quartz_drag_source_context;
#define GDK_WINDOW_IS_QUARTZ(win) (GDK_IS_WINDOW_IMPL_QUARTZ (((GdkWindow *)win)->impl))
/* Initialization */
void _gdk_quartz_window_init_windowing (GdkDisplay *display,
GdkScreen *screen);
void _gdk_quartz_events_init (void);
void _gdk_quartz_event_loop_init (void);
/* Cursor */
NSCursor *_gdk_quartz_cursor_get_ns_cursor (GdkCursor *cursor);
/* Events */
typedef enum {
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
} GdkQuartzEventSubType;
void _gdk_quartz_events_update_focus_window (GdkWindow *new_window,
gboolean got_focus);
void _gdk_quartz_events_send_map_event (GdkWindow *window);
GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers (void);
GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void);
void _gdk_quartz_events_break_all_grabs (guint32 time);
/* Event loop */
gboolean _gdk_quartz_event_loop_check_pending (void);
NSEvent * _gdk_quartz_event_loop_get_pending (void);
void _gdk_quartz_event_loop_release_event (NSEvent *event);
/* Keys */
GdkEventType _gdk_quartz_keys_event_type (NSEvent *event);
gboolean _gdk_quartz_keys_is_modifier (guint keycode);
void _gdk_quartz_synthesize_null_key_event (GdkWindow *window);
/* Drag and Drop */
void _gdk_quartz_window_register_dnd (GdkWindow *window);
GdkDragContext * _gdk_quartz_window_drag_begin (GdkWindow *window,
GdkDevice *device,
GList *targets,
gint x_root,
gint y_root);
/* Display */
GdkDisplay * _gdk_quartz_display_open (const gchar *name);
/* Display methods - events */
void _gdk_quartz_display_queue_events (GdkDisplay *display);
gboolean _gdk_quartz_display_has_pending (GdkDisplay *display);
void _gdk_quartz_display_event_data_copy (GdkDisplay *display,
const GdkEvent *src,
GdkEvent *dst);
void _gdk_quartz_display_event_data_free (GdkDisplay *display,
GdkEvent *event);
/* Display methods - cursor */
GdkCursor *_gdk_quartz_display_get_cursor_for_type (GdkDisplay *display,
GdkCursorType type);
GdkCursor *_gdk_quartz_display_get_cursor_for_name (GdkDisplay *display,
const gchar *name);
GdkCursor *_gdk_quartz_display_get_cursor_for_surface (GdkDisplay *display,
cairo_surface_t *surface,
gdouble x,
gdouble y);
gboolean _gdk_quartz_display_supports_cursor_alpha (GdkDisplay *display);
gboolean _gdk_quartz_display_supports_cursor_color (GdkDisplay *display);
void _gdk_quartz_display_get_default_cursor_size (GdkDisplay *display,
guint *width,
guint *height);
void _gdk_quartz_display_get_maximal_cursor_size (GdkDisplay *display,
guint *width,
guint *height);
/* Display methods - keymap */
GdkKeymap * _gdk_quartz_display_get_keymap (GdkDisplay *display);
/* Display methods - selection */
gboolean _gdk_quartz_display_set_selection_owner (GdkDisplay *display,
GdkWindow *owner,
GdkAtom selection,
guint32 time,
gboolean send_event);
GdkWindow * _gdk_quartz_display_get_selection_owner (GdkDisplay *display,
GdkAtom selection);
gint _gdk_quartz_display_get_selection_property (GdkDisplay *display,
GdkWindow *requestor,
guchar **data,
GdkAtom *ret_type,
gint *ret_format);
void _gdk_quartz_display_convert_selection (GdkDisplay *display,
GdkWindow *requestor,
GdkAtom selection,
GdkAtom target,
guint32 time);
gint _gdk_quartz_display_text_property_to_utf8_list (GdkDisplay *display,
GdkAtom encoding,
gint format,
const guchar *text,
gint length,
gchar ***list);
gchar * _gdk_quartz_display_utf8_to_string_target (GdkDisplay *displayt,
const gchar *str);
/* Screen */
GdkScreen *_gdk_quartz_screen_new (void);
void _gdk_quartz_screen_update_window_sizes (GdkScreen *screen);
/* Screen methods - visual */
GdkVisual * _gdk_quartz_screen_get_rgba_visual (GdkScreen *screen);
GdkVisual * _gdk_quartz_screen_get_system_visual (GdkScreen *screen);
gint _gdk_quartz_screen_visual_get_best_depth (GdkScreen *screen);
GdkVisualType _gdk_quartz_screen_visual_get_best_type (GdkScreen *screen);
GdkVisual * _gdk_quartz_screen_get_system_visual (GdkScreen *screen);
GdkVisual* _gdk_quartz_screen_visual_get_best (GdkScreen *screen);
GdkVisual* _gdk_quartz_screen_visual_get_best_with_depth (GdkScreen *screen,
gint depth);
GdkVisual* _gdk_quartz_screen_visual_get_best_with_type (GdkScreen *screen,
GdkVisualType visual_type);
GdkVisual* _gdk_quartz_screen_visual_get_best_with_both (GdkScreen *screen,
gint depth,
GdkVisualType visual_type);
void _gdk_quartz_screen_query_depths (GdkScreen *screen,
gint **depths,
gint *count);
void _gdk_quartz_screen_query_visual_types (GdkScreen *screen,
GdkVisualType **visual_types,
gint *count);
void _gdk_quartz_screen_init_visuals (GdkScreen *screen);
GList * _gdk_quartz_screen_list_visuals (GdkScreen *screen);
/* Screen methods - events */
void _gdk_quartz_screen_broadcast_client_message (GdkScreen *screen,
GdkEvent *event);
gboolean _gdk_quartz_screen_get_setting (GdkScreen *screen,
const gchar *name,
GValue *value);
/* Window */
gboolean _gdk_quartz_window_is_ancestor (GdkWindow *ancestor,
GdkWindow *window);
void _gdk_quartz_window_gdk_xy_to_xy (gint gdk_x,
gint gdk_y,
gint *ns_x,
gint *ns_y);
void _gdk_quartz_window_xy_to_gdk_xy (gint ns_x,
gint ns_y,
gint *gdk_x,
gint *gdk_y);
void _gdk_quartz_window_nspoint_to_gdk_xy (NSPoint point,
gint *x,
gint *y);
GdkWindow *_gdk_quartz_window_find_child (GdkWindow *window,
gint x,
gint y,
gboolean get_toplevel);
void _gdk_quartz_window_attach_to_parent (GdkWindow *window);
void _gdk_quartz_window_detach_from_parent (GdkWindow *window);
void _gdk_quartz_window_did_become_main (GdkWindow *window);
void _gdk_quartz_window_did_resign_main (GdkWindow *window);
void _gdk_quartz_window_debug_highlight (GdkWindow *window,
gint number);
void _gdk_quartz_window_update_position (GdkWindow *window);
void _gdk_quartz_window_update_fullscreen_state (GdkWindow *window);
/* Window methods - testing */
void _gdk_quartz_window_sync_rendering (GdkWindow *window);
gboolean _gdk_quartz_window_simulate_key (GdkWindow *window,
gint x,
gint y,
guint keyval,
GdkModifierType modifiers,
GdkEventType key_pressrelease);
gboolean _gdk_quartz_window_simulate_button (GdkWindow *window,
gint x,
gint y,
guint button,
GdkModifierType modifiers,
GdkEventType button_pressrelease);
/* Window methods - property */
gboolean _gdk_quartz_window_get_property (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gulong offset,
gulong length,
gint pdelete,
GdkAtom *actual_property_type,
gint *actual_format_type,
gint *actual_length,
guchar **data);
void _gdk_quartz_window_change_property (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gint format,
GdkPropMode mode,
const guchar *data,
gint nelements);
void _gdk_quartz_window_delete_property (GdkWindow *window,
GdkAtom property);
#endif /* __GDK_PRIVATE_QUARTZ_H__ */
+50
View File
@@ -0,0 +1,50 @@
/* gdkquartz-gtk-only.h
*
* Copyright (C) 2005-2007 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_QUARTZ_GTK_ONLY_H__
#define __GDK_QUARTZ_GTK_ONLY_H__
#if !(defined (GTK_COMPILATION) || defined (GDK_COMPILATION))
#error "This API is for use only in Gtk internal code."
#endif
#include <Appkit/Appkit.h>
#include <gdk/gdk.h>
#include <gdk/quartz/gdkquartz.h>
/* Drag and Drop/Clipboard */
GDK_AVAILABLE_IN_ALL
GdkAtom gdk_quartz_pasteboard_type_to_atom_libgtk_only (NSString *type);
GDK_AVAILABLE_IN_ALL
NSString *gdk_quartz_target_to_pasteboard_type_libgtk_only (const gchar *target);
GDK_AVAILABLE_IN_ALL
NSString *gdk_quartz_atom_to_pasteboard_type_libgtk_only (GdkAtom atom);
/* Utilities */
GDK_AVAILABLE_IN_ALL
NSImage *gdk_quartz_pixbuf_to_ns_image_libgtk_only (GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
NSEvent *gdk_quartz_event_get_nsevent (GdkEvent *event);
/* Window */
GDK_AVAILABLE_IN_ALL
NSWindow *gdk_quartz_window_get_nswindow (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
NSView *gdk_quartz_window_get_nsview (GdkWindow *window);
#endif
-23
View File
@@ -20,26 +20,11 @@
#ifndef __GDK_QUARTZ_H__
#define __GDK_QUARTZ_H__
#include <AppKit/AppKit.h>
#include <gdk/gdk.h>
#include <gdk/gdkprivate.h>
G_BEGIN_DECLS
/* NSInteger only exists in Leopard and newer. This check has to be
* done after inclusion of the system headers. If NSInteger has not
* been defined, we know for sure that we are on 32-bit.
*/
#ifndef NSINTEGER_DEFINED
typedef int NSInteger;
typedef unsigned int NSUInteger;
#endif
#ifndef CGFLOAT_DEFINED
typedef float CGFloat;
#endif
typedef enum
{
GDK_OSX_UNSUPPORTED = 0,
@@ -62,13 +47,6 @@ typedef enum
GDK_AVAILABLE_IN_ALL
GdkOSXVersion gdk_quartz_osx_version (void);
GDK_AVAILABLE_IN_ALL
GdkAtom gdk_quartz_pasteboard_type_to_atom_libgtk_only (NSString *type);
GDK_AVAILABLE_IN_ALL
NSString *gdk_quartz_target_to_pasteboard_type_libgtk_only (const gchar *target);
GDK_AVAILABLE_IN_ALL
NSString *gdk_quartz_atom_to_pasteboard_type_libgtk_only (GdkAtom atom);
G_END_DECLS
#define __GDKQUARTZ_H_INSIDE__
@@ -78,7 +56,6 @@ G_END_DECLS
#include <gdk/quartz/gdkquartzdevicemanager-core.h>
#include <gdk/quartz/gdkquartzdisplay.h>
#include <gdk/quartz/gdkquartzdisplaymanager.h>
#include <gdk/quartz/gdkquartzdnd.h>
#include <gdk/quartz/gdkquartzkeys.h>
#include <gdk/quartz/gdkquartzmonitor.h>
#include <gdk/quartz/gdkquartzscreen.h>
+2 -2
View File
@@ -19,8 +19,8 @@
#ifndef __GDK_QUARTZ_DND_H__
#define __GDK_QUARTZ_DND_H__
#if !defined(__GDKQUARTZ_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdkquartz.h> can be included directly."
#if !defined (GTK_COMPILATION) && !defined (GDK_COMPILATION)
#error "gdkquartzdnd.h is for Gtk's internal use only"
#endif
#include <gdk/gdk.h>
-73
View File
@@ -45,79 +45,6 @@ typedef struct _GdkQuartzKeymapClass GdkQuartzKeymapClass;
GDK_AVAILABLE_IN_ALL
GType gdk_quartz_keymap_get_type (void);
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
typedef enum
{
GDK_QUARTZ_FLAGS_CHANGED = NSFlagsChanged,
GDK_QUARTZ_KEY_UP = NSKeyUp,
GDK_QUARTZ_KEY_DOWN = NSKeyDown,
GDK_QUARTZ_MOUSE_ENTERED = NSMouseEntered,
GDK_QUARTZ_MOUSE_EXITED = NSMouseExited,
GDK_QUARTZ_SCROLL_WHEEL = NSScrollWheel,
GDK_QUARTZ_MOUSE_MOVED = NSMouseMoved,
GDK_QUARTZ_OTHER_MOUSE_DRAGGED = NSOtherMouseDragged,
GDK_QUARTZ_RIGHT_MOUSE_DRAGGED = NSRightMouseDragged,
GDK_QUARTZ_LEFT_MOUSE_DRAGGED = NSLeftMouseDragged,
GDK_QUARTZ_OTHER_MOUSE_UP = NSOtherMouseUp,
GDK_QUARTZ_RIGHT_MOUSE_UP = NSRightMouseUp,
GDK_QUARTZ_LEFT_MOUSE_UP = NSLeftMouseUp,
GDK_QUARTZ_OTHER_MOUSE_DOWN = NSOtherMouseDown,
GDK_QUARTZ_RIGHT_MOUSE_DOWN = NSRightMouseDown,
GDK_QUARTZ_LEFT_MOUSE_DOWN = NSLeftMouseDown,
} GdkQuartzEventType;
typedef enum
{
GDK_QUARTZ_ALTERNATE_KEY_MASK = NSAlternateKeyMask,
GDK_QUARTZ_CONTROL_KEY_MASK = NSControlKeyMask,
GDK_QUARTZ_SHIFT_KEY_MASK = NSShiftKeyMask,
GDK_QUARTZ_ALPHA_SHIFT_KEY_MASK = NSAlphaShiftKeyMask,
GDK_QUARTZ_COMMAND_KEY_MASK = NSCommandKeyMask,
GDK_QUARTZ_ANY_EVENT_MASK = NSAnyEventMask,
} GdkQuartzEventModifierFlags;
typedef enum
{
GDK_QUARTZ_EVENT_MASK_ANY = NSAnyEventMask,
} GdkQuartzEventMask;
#else
typedef enum
{
GDK_QUARTZ_FLAGS_CHANGED = NSEventTypeFlagsChanged,
GDK_QUARTZ_KEY_UP = NSEventTypeKeyUp,
GDK_QUARTZ_KEY_DOWN = NSEventTypeKeyDown,
GDK_QUARTZ_MOUSE_ENTERED = NSEventTypeMouseEntered,
GDK_QUARTZ_MOUSE_EXITED = NSEventTypeMouseExited,
GDK_QUARTZ_SCROLL_WHEEL = NSEventTypeScrollWheel,
GDK_QUARTZ_MOUSE_MOVED = NSEventTypeMouseMoved,
GDK_QUARTZ_OTHER_MOUSE_DRAGGED = NSEventTypeOtherMouseDragged,
GDK_QUARTZ_RIGHT_MOUSE_DRAGGED = NSEventTypeRightMouseDragged,
GDK_QUARTZ_LEFT_MOUSE_DRAGGED = NSEventTypeLeftMouseDragged,
GDK_QUARTZ_OTHER_MOUSE_UP = NSEventTypeOtherMouseUp,
GDK_QUARTZ_RIGHT_MOUSE_UP = NSEventTypeRightMouseUp,
GDK_QUARTZ_LEFT_MOUSE_UP = NSEventTypeLeftMouseUp,
GDK_QUARTZ_OTHER_MOUSE_DOWN = NSEventTypeOtherMouseDown,
GDK_QUARTZ_RIGHT_MOUSE_DOWN = NSEventTypeRightMouseDown,
GDK_QUARTZ_LEFT_MOUSE_DOWN = NSEventTypeLeftMouseDown,
} GdkQuartzEventType;
typedef enum
{
GDK_QUARTZ_ALTERNATE_KEY_MASK = NSEventModifierFlagOption,
GDK_QUARTZ_CONTROL_KEY_MASK = NSEventModifierFlagControl,
GDK_QUARTZ_SHIFT_KEY_MASK = NSEventModifierFlagShift,
GDK_QUARTZ_ALPHA_SHIFT_KEY_MASK = NSEventModifierFlagCapsLock,
GDK_QUARTZ_COMMAND_KEY_MASK = NSEventModifierFlagCommand,
} GdkQuartzEventModifierFlags;
typedef enum
{
GDK_QUARTZ_EVENT_MASK_ANY = NSEventMaskAny,
} GdkQuartzEventMask;
#endif
G_END_DECLS
#endif /* __GDK_QUARTZ_KEYS_H__ */
-4
View File
@@ -28,10 +28,6 @@
G_BEGIN_DECLS
GDK_AVAILABLE_IN_ALL
NSImage *gdk_quartz_pixbuf_to_ns_image_libgtk_only (GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
NSEvent *gdk_quartz_event_get_nsevent (GdkEvent *event);
GDK_AVAILABLE_IN_3_12
gunichar gdk_quartz_get_key_equivalent (guint key);
-5
View File
@@ -45,11 +45,6 @@ typedef struct _GdkQuartzWindowClass GdkQuartzWindowClass;
GDK_AVAILABLE_IN_ALL
GType gdk_quartz_window_get_type (void);
GDK_AVAILABLE_IN_ALL
NSWindow *gdk_quartz_window_get_nswindow (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
NSView *gdk_quartz_window_get_nsview (GdkWindow *window);
G_END_DECLS
#endif /* __GDK_QUARTZ_WINDOW_H__ */
+2
View File
@@ -23,6 +23,8 @@
#include "gdkselection.h"
#include "gdkproperty.h"
#include "gdkquartz.h"
#include "gdkinternal-quartz.h"
#include "gdkquartz-gtk-only.h"
gboolean
_gdk_quartz_display_set_selection_owner (GdkDisplay *display,
+3 -2
View File
@@ -19,10 +19,11 @@
#include "config.h"
#include <AppKit/AppKit.h>
#include <gdk/gdk.h>
#include <gdkinternals.h>
#include "gdkquartz-gtk-only.h"
#include <gdkquartzutils.h>
#include "gdkprivate-quartz.h"
NSImage *
gdk_quartz_pixbuf_to_ns_image_libgtk_only (GdkPixbuf *pixbuf)
+4 -3
View File
@@ -24,11 +24,13 @@
#include <gdk/gdkdisplayprivate.h>
#include "gdkwindowimpl.h"
#include "gdkwindow-quartz.h"
#include "gdkprivate-quartz.h"
#include "gdkglcontext-quartz.h"
#include "gdkquartzglcontext.h"
#include "gdkquartzscreen.h"
#include "gdkquartzcursor.h"
#include "gdkquartz-gtk-only.h"
#include <Carbon/Carbon.h>
#include <AvailabilityMacros.h>
@@ -2858,8 +2860,8 @@ _gdk_quartz_window_update_fullscreen_state (GdkWindow *window)
if (gdk_quartz_osx_version() >= GDK_OSX_LION)
{
gboolean is_fullscreen = window_is_fullscreen (window);
gboolean was_fullscreen = (gdk_window_get_state (window) &&
GDK_WINDOW_STATE_FULLSCREEN != 0);
gboolean was_fullscreen = (gdk_window_get_state (window) &
GDK_WINDOW_STATE_FULLSCREEN) != 0;
if (is_fullscreen != was_fullscreen)
{
@@ -3078,7 +3080,6 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
impl_class->set_decorations = gdk_quartz_window_set_decorations;
impl_class->get_decorations = gdk_quartz_window_get_decorations;
impl_class->set_functions = gdk_quartz_window_set_functions;
impl_class->set_functions = gdk_quartz_window_set_functions;
impl_class->begin_resize_drag = gdk_quartz_window_begin_resize_drag;
impl_class->begin_move_drag = gdk_quartz_window_begin_move_drag;
impl_class->set_opacity = gdk_quartz_window_set_opacity;
+1 -1
View File
@@ -22,6 +22,7 @@
#import <gdk/quartz/GdkQuartzView.h>
#import <gdk/quartz/GdkQuartzNSWindow.h>
#include "gdk/gdkwindowimpl.h"
#include "gdkinternal-quartz.h"
G_BEGIN_DECLS
@@ -108,7 +109,6 @@ struct _GdkRootWindowImplQuartzClass
GType _gdk_root_window_impl_quartz_get_type (void);
G_END_DECLS
#endif /* __GDK_WINDOW_QUARTZ_H__ */
+14 -7
View File
@@ -3468,6 +3468,8 @@ static void
gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
guint32 time)
{
GdkEventType event_type;
GdkWindow *window;
GdkEvent *event;
event = tablet->pointer_info.frame.event;
@@ -3476,7 +3478,10 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
if (!event)
return;
switch (event->type)
event_type = event->type;
window = g_object_ref (gdk_event_get_window (event));
switch (event_type)
{
case GDK_MOTION_NOTIFY:
event->motion.time = time;
@@ -3504,18 +3509,20 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
return;
}
if (event->type == GDK_PROXIMITY_OUT)
emulate_crossing (event->proximity.window, NULL, tablet->master,
if (event_type == GDK_PROXIMITY_OUT)
emulate_crossing (window, NULL, tablet->master,
tablet->current_device, GDK_LEAVE_NOTIFY,
GDK_CROSSING_NORMAL, time);
_gdk_wayland_display_deliver_event (gdk_seat_get_display (tablet->seat),
event);
if (event->type == GDK_PROXIMITY_IN)
emulate_crossing (event->proximity.window, NULL, tablet->master,
if (event_type == GDK_PROXIMITY_IN)
emulate_crossing (window, NULL, tablet->master,
tablet->current_device, GDK_ENTER_NOTIFY,
GDK_CROSSING_NORMAL, time);
g_object_unref (window);
}
static GdkEvent *
@@ -4616,7 +4623,7 @@ pointer_surface_enter (void *data,
if (tablet)
{
tablet->pointer_info.pointer_surface_outputs =
g_slist_append (seat->pointer_info.pointer_surface_outputs, output);
g_slist_append (tablet->pointer_info.pointer_surface_outputs, output);
}
else
{
@@ -4645,7 +4652,7 @@ pointer_surface_leave (void *data,
if (tablet)
{
tablet->pointer_info.pointer_surface_outputs =
g_slist_remove (seat->pointer_info.pointer_surface_outputs, output);
g_slist_remove (tablet->pointer_info.pointer_surface_outputs, output);
}
else
{
+11 -12
View File
@@ -937,7 +937,7 @@ data_source_cancelled (void *data,
gdk_drag_context_cancel (context, GDK_DRAG_CANCEL_ERROR);
emit_selection_clear (display, atom);
gdk_selection_owner_set (NULL, atom, GDK_CURRENT_TIME, TRUE);
gdk_selection_owner_set (NULL, atom, GDK_CURRENT_TIME, FALSE);
gdk_wayland_selection_unset_data_source (display, atom);
}
@@ -1048,7 +1048,7 @@ primary_source_cancelled (void *data,
atom = atoms[ATOM_PRIMARY];
emit_selection_clear (display, atom);
gdk_selection_owner_set (NULL, atom, GDK_CURRENT_TIME, TRUE);
gdk_selection_owner_set (NULL, atom, GDK_CURRENT_TIME, FALSE);
gdk_wayland_selection_unset_data_source (display, atom);
}
@@ -1140,10 +1140,6 @@ gdk_wayland_selection_unset_data_source (GdkDisplay *display,
if (selection == atoms[ATOM_CLIPBOARD])
{
GdkSeat *seat = gdk_display_get_default_seat (display);
gdk_wayland_seat_set_selection (seat, NULL);
if (wayland_selection->clipboard_source)
{
wl_data_source_destroy (wayland_selection->clipboard_source);
@@ -1152,10 +1148,6 @@ gdk_wayland_selection_unset_data_source (GdkDisplay *display,
}
else if (selection == atoms[ATOM_PRIMARY])
{
GdkSeat *seat = gdk_display_get_default_seat (display);
gdk_wayland_seat_set_primary (seat, NULL);
if (wayland_selection->primary_source)
{
gtk_primary_selection_source_destroy (wayland_selection->primary_source);
@@ -1192,19 +1184,26 @@ _gdk_wayland_display_set_selection_owner (GdkDisplay *display,
gboolean send_event)
{
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
GdkSeat *seat = gdk_display_get_default_seat (display);
if (selection == atoms[ATOM_CLIPBOARD])
{
wayland_selection->clipboard_owner = owner;
if (send_event && !owner)
gdk_wayland_selection_unset_data_source (display, selection);
{
gdk_wayland_seat_set_selection (seat, NULL);
gdk_wayland_selection_unset_data_source (display, selection);
}
return TRUE;
}
else if (selection == atoms[ATOM_PRIMARY])
{
wayland_selection->primary_owner = owner;
if (send_event && !owner)
gdk_wayland_selection_unset_data_source (display, selection);
{
gdk_wayland_seat_set_primary (seat, NULL);
gdk_wayland_selection_unset_data_source (display, selection);
}
return TRUE;
}
else if (selection == atoms[ATOM_DND])
+2 -3
View File
@@ -992,15 +992,14 @@ gdk_window_impl_wayland_beep (GdkWindow *window)
static void
gdk_window_impl_wayland_finalize (GObject *object)
{
GdkWindow *window = GDK_WINDOW (object);
GdkWindowImplWayland *impl;
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (object));
impl = GDK_WINDOW_IMPL_WAYLAND (object);
if (gdk_wayland_window_is_exported (window))
gdk_wayland_window_unexport_handle (window);
if (gdk_wayland_window_is_exported (impl->wrapper))
gdk_wayland_window_unexport_handle (impl->wrapper);
g_free (impl->title);
+2 -27
View File
@@ -523,8 +523,6 @@ gdk_win32_display_supports_selection_notification (GdkDisplay *display)
return TRUE;
}
static HWND _hwnd_next_viewer = NULL;
/*
* maybe this should be integrated with the default message loop - or maybe not ;-)
*/
@@ -538,24 +536,11 @@ inner_clipboard_window_procedure (HWND hwnd,
{
case WM_DESTROY: /* remove us from chain */
{
ChangeClipboardChain (hwnd, _hwnd_next_viewer);
RemoveClipboardFormatListener (hwnd);
PostQuitMessage (0);
return 0;
}
case WM_CHANGECBCHAIN:
{
HWND hwndRemove = (HWND) wparam; /* handle of window being removed */
HWND hwndNext = (HWND) lparam; /* handle of next window in chain */
if (hwndRemove == _hwnd_next_viewer)
_hwnd_next_viewer = hwndNext == hwnd ? NULL : hwndNext;
else if (_hwnd_next_viewer != NULL)
return SendMessage (_hwnd_next_viewer, message, wparam, lparam);
return 0;
}
case WM_CLIPBOARDUPDATE:
case WM_DRAWCLIPBOARD:
{
HWND hwnd_owner;
HWND stored_hwnd_owner;
@@ -632,9 +617,6 @@ inner_clipboard_window_procedure (HWND hwnd,
event->owner_change.selection_time = GDK_CURRENT_TIME;
_gdk_win32_append_event (event);
if (_hwnd_next_viewer != NULL)
return SendMessage (_hwnd_next_viewer, message, wparam, lparam);
/* clear error to avoid confusing SetClipboardViewer() return */
SetLastError (0);
return 0;
@@ -694,16 +676,10 @@ register_clipboard_notification (GdkDisplay *display)
goto failed;
SetLastError (0);
_hwnd_next_viewer = SetClipboardViewer (display_win32->clipboard_hwnd);
if (_hwnd_next_viewer == NULL && GetLastError() != 0)
if (AddClipboardFormatListener (display_win32->clipboard_hwnd) == FALSE)
goto failed;
/* FIXME: http://msdn.microsoft.com/en-us/library/ms649033(v=VS.85).aspx */
/* This is only supported by Vista, and not yet by mingw64 */
/* if (AddClipboardFormatListener (hwnd) == FALSE) */
/* goto failed; */
return TRUE;
failed:
@@ -850,7 +826,6 @@ gdk_win32_display_dispose (GObject *object)
{
DestroyWindow (display_win32->clipboard_hwnd);
display_win32->clipboard_hwnd = NULL;
_hwnd_next_viewer = NULL;
}
if (display_win32->have_at_least_win81)
+1
View File
@@ -2251,6 +2251,7 @@ _gdk_win32_display_convert_selection (GdkDisplay *display,
queue_open_clipboard (GDK_WIN32_CLIPBOARD_QUEUE_ACTION_CONVERT, display, requestor, target, time);
open_clipboard_timeout (NULL);
return;
}
else
{
+22 -3
View File
@@ -5312,6 +5312,8 @@ gdk_win32_window_fullscreen (GdkWindow *window)
FullscreenInfo *fi;
HMONITOR monitor;
MONITORINFO mi;
DWORD extra_styles = WS_POPUP;
gint workaround_padding = 0;
g_return_if_fail (GDK_IS_WINDOW (window));
@@ -5348,12 +5350,29 @@ gdk_win32_window_fullscreen (GdkWindow *window)
/* Send state change before configure event */
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
/* If we are using GL windows, and we set the envvar GDK_WIN32_GL_FULLSCREEN_WORKAROUND,
* set the WS_BORDER style so that DWM will not get deactivated. This is necessary
* when menus could not be shown correctly in fullscreen GL windows. To avoid seeing
* a border, we intentionally make the window bigger by 1px on all sides and place the
* window just 1px outside the top left-hand coordinates outside the screen area.
*/
if (window->gl_paint_context != NULL && g_getenv ("GDK_WIN32_GL_FULLSCREEN_WORKAROUND"))
{
extra_styles |= WS_BORDER;
workaround_padding = 1;
GDK_NOTE (MISC, g_print ("GL fullscreen workaround enabled for window [%p]\n",
GDK_WINDOW_HWND (window)));
}
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE,
(fi->style & ~WS_OVERLAPPEDWINDOW) | WS_POPUP);
(fi->style & ~WS_OVERLAPPEDWINDOW) | extra_styles);
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP,
x, y, width, height,
SWP_NOCOPYBITS | SWP_SHOWWINDOW | SWP_NOOWNERZORDER));
x - workaround_padding,
y - workaround_padding,
width + (workaround_padding * 2),
height + (workaround_padding * 2),
SWP_NOCOPYBITS | SWP_SHOWWINDOW | SWP_NOOWNERZORDER));
}
}
+5 -5
View File
@@ -643,14 +643,14 @@ remove_device (GdkX11DeviceManagerXI2 *device_manager,
if (device)
{
detach_from_seat (device);
device_manager->devices = g_list_remove (device_manager->devices, device);
g_signal_emit_by_name (device_manager, "device-removed", device);
g_object_run_dispose (G_OBJECT (device));
g_hash_table_remove (device_manager->id_table,
GINT_TO_POINTER (device_id));
device_manager->devices = g_list_remove (device_manager->devices, device);
g_signal_emit_by_name (device_manager, "device-removed", device);
g_object_run_dispose (G_OBJECT (device));
g_object_unref (device);
}
}
+4 -2
View File
@@ -2613,8 +2613,10 @@ gdk_drag_anim_timeout (gpointer data)
gdk_window_show (context->drag_window);
gdk_window_move (context->drag_window,
context->last_x + (context->start_x - context->last_x) * t,
context->last_y + (context->start_y - context->last_y) * t);
(context->last_x - context->hot_x) +
(context->start_x - context->last_x) * t,
(context->last_y - context->hot_y) +
(context->start_y - context->last_y) * t);
gdk_window_set_opacity (context->drag_window, 1.0 - f);
return G_SOURCE_CONTINUE;
+18 -10
View File
@@ -66,19 +66,27 @@ gdk_x11_monitor_get_workarea (GdkMonitor *monitor,
gdk_monitor_get_geometry (monitor, dest);
/* The EWMH constrains workarea to be a rectangle, so it
* can't adequately deal with L-shaped monitor arrangements.
* As a workaround, we ignore the workarea for anything
* but the primary monitor. Since that is where the 'desktop
* chrome' usually lives, this works ok in practice.
*/
if (gdk_monitor_is_primary (monitor) &&
!gdk_monitor_has_fullscreen_window (monitor))
if (_gdk_x11_screen_get_monitor_work_area (screen, monitor, &workarea))
{
gdk_x11_screen_get_work_area (screen, &workarea);
if (gdk_rectangle_intersect (dest, &workarea, &workarea))
if (!gdk_monitor_has_fullscreen_window (monitor))
*dest = workarea;
}
else
{
/* The EWMH constrains workarea to be a rectangle, so it
* can't adequately deal with L-shaped monitor arrangements.
* As a workaround, we ignore the workarea for anything
* but the primary monitor. Since that is where the 'desktop
* chrome' usually lives, this works ok in practice.
*/
if (gdk_monitor_is_primary (monitor) &&
!gdk_monitor_has_fullscreen_window (monitor))
{
gdk_x11_screen_get_work_area (screen, &workarea);
if (gdk_rectangle_intersect (dest, &workarea, &workarea))
*dest = workarea;
}
}
}
static void
+104
View File
@@ -234,6 +234,106 @@ get_current_desktop (GdkScreen *screen)
return workspace;
}
gboolean
_gdk_x11_screen_get_monitor_work_area (GdkScreen *screen,
GdkMonitor *monitor,
GdkRectangle *area)
{
GdkX11Screen *x11_screen;
GdkAtom net_workareas;
GdkDisplay *display;
Display *xdisplay;
int current_desktop;
char *workareas_dn_name;
Atom workareas_dn;
int screen_number;
Window xroot;
int result;
Atom type;
int format;
gulong num;
gulong leftovers;
guchar *ret_workarea;
long *workareas;
GdkRectangle geometry;
int i;
x11_screen = GDK_X11_SCREEN (screen);
net_workareas = gdk_atom_intern_static_string ("_GTK_WORKAREAS");
if (!gdk_x11_screen_supports_net_wm_hint (screen, net_workareas))
return FALSE;
display = gdk_screen_get_display (screen);
xdisplay = gdk_x11_display_get_xdisplay (display);
current_desktop = get_current_desktop (screen);
workareas_dn_name = g_strdup_printf ("_GTK_WORKAREAS_D%d", current_desktop);
workareas_dn = XInternAtom (xdisplay, workareas_dn_name, True);
g_free (workareas_dn_name);
if (workareas_dn == None)
return FALSE;
screen_number = gdk_x11_screen_get_screen_number (screen);
xroot = XRootWindow (xdisplay, screen_number);
gdk_x11_display_error_trap_push (display);
ret_workarea = NULL;
result = XGetWindowProperty (xdisplay,
xroot,
workareas_dn,
0,
G_MAXLONG,
False,
AnyPropertyType,
&type,
&format,
&num,
&leftovers,
&ret_workarea);
gdk_x11_display_error_trap_pop_ignored (display);
if (result != Success ||
type == None ||
format == 0 ||
leftovers ||
num % 4 != 0)
{
XFree (ret_workarea);
return FALSE;
}
workareas = (long *) ret_workarea;
gdk_monitor_get_geometry (monitor, &geometry);
*area = geometry;
for (i = 0; i < num / 4; i++)
{
GdkRectangle work_area;
work_area = (GdkRectangle) {
.x = workareas[0] / x11_screen->window_scale,
.y = workareas[1] / x11_screen->window_scale,
.width = workareas[2] / x11_screen->window_scale,
.height = workareas[3] / x11_screen->window_scale,
};
if (gdk_rectangle_intersect (area, &work_area, &work_area))
*area = work_area;
workareas += 4;
}
XFree (ret_workarea);
return TRUE;
}
void
gdk_x11_screen_get_work_area (GdkScreen *screen,
GdkRectangle *area)
@@ -1007,6 +1107,10 @@ _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen,
root = x11_screen->root_window;
GDK_WINDOW_IMPL_X11 (root->impl)->window_scale = scale;
if (GDK_WINDOW_IMPL_X11 (root->impl)->cairo_surface)
cairo_surface_set_device_scale (GDK_WINDOW_IMPL_X11 (root->impl)->cairo_surface,
scale, scale);
toplevels = gdk_screen_get_toplevel_windows (GDK_SCREEN (x11_screen));
for (l = toplevels; l != NULL; l = l->next)
+3
View File
@@ -119,6 +119,9 @@ void _gdk_x11_screen_get_edge_monitors (GdkScreen *screen,
gint *right);
void _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen,
int scale);
gboolean _gdk_x11_screen_get_monitor_work_area (GdkScreen *screen,
GdkMonitor *monitor,
GdkRectangle *area);
void gdk_x11_screen_get_work_area (GdkScreen *screen,
GdkRectangle *area);
gint gdk_x11_screen_get_width (GdkScreen *screen);
+5 -4
View File
@@ -50,10 +50,11 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
* from #GtkBox. No further changes are needed, since the default
* value of the #GtkOrientable:orientation property is
* %GTK_ORIENTATION_HORIZONTAL.
* If you dont need first-child or last-child styling, and want your code
* to be future-proof, the recommendation is to switch to #GtkGrid instead
* of nested boxes. For more information about migrating to #GtkGrid,
* see [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
*
* If you have a grid-like layout composed of nested boxes, and you dont
* need first-child or last-child styling, the recommendation is to switch
* to #GtkGrid. For more information about migrating to #GtkGrid, see
* [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
*/
+3 -1
View File
@@ -22,7 +22,9 @@
*/
#import <Cocoa/Cocoa.h>
#include <quartz/gdkquartz.h>
#define __GTK_H_INSIDE__
#include <quartz/gdkquartz-gtk-only.h>
#undef __GTK_H_INSIDE__
#define QUARTZ_POOL_ALLOC NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]
#define QUARTZ_POOL_RELEASE [pool release]
+48 -31
View File
@@ -1398,13 +1398,18 @@ gtk_status_icon_update_image (GtkStatusIcon *status_icon)
GtkIconHelper *icon_helper;
cairo_surface_t *surface;
GtkWidget *widget;
#ifndef GDK_WINDOWING_X11
GdkPixbuf *pixbuf;
#endif
gint round_size;
gint scale;
#ifdef GDK_WINDOWING_X11
widget = priv->image;
scale = gtk_widget_get_scale_factor (widget);
#else
widget = priv->dummy_widget;
scale = 1;
#endif
if (widget == NULL)
@@ -1417,7 +1422,23 @@ gtk_status_icon_update_image (GtkStatusIcon *status_icon)
_gtk_icon_helper_set_definition (icon_helper, priv->image_def);
_gtk_icon_helper_set_icon_size (icon_helper, GTK_ICON_SIZE_SMALL_TOOLBAR);
_gtk_icon_helper_set_pixel_size (icon_helper, round_size);
surface = gtk_icon_helper_load_surface (icon_helper, 1);
surface = gtk_icon_helper_load_surface (icon_helper, scale);
g_object_unref (icon_helper);
#ifdef GDK_WINDOWING_X11
if (surface)
{
gtk_image_set_from_surface (GTK_IMAGE (priv->image), surface);
cairo_surface_destroy (surface);
}
else
{
gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), NULL);
}
#endif
#ifdef GDK_WINDOWING_WIN32
if (surface)
{
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0,
@@ -1425,16 +1446,9 @@ gtk_status_icon_update_image (GtkStatusIcon *status_icon)
cairo_image_surface_get_height (surface));
cairo_surface_destroy (surface);
}
else
pixbuf = NULL;
g_object_unref (icon_helper);
if (pixbuf != NULL)
{
#ifdef GDK_WINDOWING_X11
gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), pixbuf);
#endif
#ifdef GDK_WINDOWING_WIN32
prev_hicon = priv->nid.hIcon;
priv->nid.hIcon = gdk_win32_pixbuf_to_hicon_libgtk_only (pixbuf);
priv->nid.uFlags |= NIF_ICON;
@@ -1443,30 +1457,40 @@ gtk_status_icon_update_image (GtkStatusIcon *status_icon)
g_warning (G_STRLOC ": Shell_NotifyIcon(NIM_MODIFY) failed");
if (prev_hicon)
DestroyIcon (prev_hicon);
#endif
#ifdef GDK_WINDOWING_QUARTZ
QUARTZ_POOL_ALLOC;
[priv->status_item setImage:pixbuf];
QUARTZ_POOL_RELEASE;
#endif
}
else
{
#ifdef GDK_WINDOWING_X11
gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), NULL);
#endif
#ifdef GDK_WINDOWING_WIN32
priv->nid.uFlags &= ~NIF_ICON;
if (priv->nid.hWnd != NULL && priv->visible)
if (!Shell_NotifyIconW (NIM_MODIFY, &priv->nid))
g_warning (G_STRLOC ": Shell_NotifyIcon(NIM_MODIFY) failed");
#endif
#ifdef GDK_WINDOWING_QUARTZ
[priv->status_item setImage:NULL];
#endif
}
g_clear_object (&pixbuf);
#endif
#ifdef GDK_WINDOWING_QUARTZ
if (surface)
{
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0,
cairo_image_surface_get_width (surface),
cairo_image_surface_get_height (surface));
cairo_surface_destroy (surface);
}
if (pixbuf != NULL)
{
QUARTZ_POOL_ALLOC;
[priv->status_item setImage:pixbuf];
QUARTZ_POOL_RELEASE;
}
else
{
[priv->status_item setImage:NULL];
}
g_clear_object (&pixbuf);
#endif
}
#ifdef GDK_WINDOWING_X11
@@ -2248,18 +2272,11 @@ gtk_status_icon_is_embedded (GtkStatusIcon *status_icon)
g_return_val_if_fail (GTK_IS_STATUS_ICON (status_icon), FALSE);
#ifdef GDK_WINDOWING_X11
if (status_icon->priv->tray_icon &&
gtk_plug_get_embedded (GTK_PLUG (status_icon->priv->tray_icon)))
return TRUE;
else
if (status_icon->priv->tray_icon == NULL ||
!gtk_plug_get_embedded (GTK_PLUG (status_icon->priv->tray_icon)))
return FALSE;
#endif
#ifdef GDK_WINDOWING_WIN32
return TRUE;
#endif
#ifdef GDK_WINDOWING_QUARTZ
return TRUE;
#endif
}
/**
+14 -10
View File
@@ -45,20 +45,24 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
*
* All children are allocated the same width.
*
* GtkVBox has been deprecated. You can use #GtkBox instead, which is a
* very quick and easy change. If you have derived your own classes from
* GtkVBox, you can simply change the inheritance to derive directly
* from #GtkBox, and set the #GtkOrientable:orientation property to
* %GTK_ORIENTATION_VERTICAL in your instance init function, with a
* call like:
* GtkVBox has been deprecated. You can use #GtkBox with a #GtkOrientable:orientation
* set to %GTK_ORIENTATION_VERTICAL instead when calling gtk_box_new(),
* which is a very quick and easy change.
*
* If you have derived your own classes from GtkVBox, you can change the
* inheritance to derive directly from #GtkBox, and set the #GtkOrientable:orientation
* property to %GTK_ORIENTATION_VERTICAL in your instance init function,
* with a call like:
*
* |[<!-- language="C" -->
* gtk_orientable_set_orientation (GTK_ORIENTABLE (object),
* GTK_ORIENTATION_VERTICAL);
* ]|
* If you dont need first-child or last-child styling and want your code
* to be future-proof, the recommendation is to switch to #GtkGrid instead
* of nested boxes. For more information about migrating to #GtkGrid,
* see [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
*
* If you have a grid-like layout composed of nested boxes, and you dont
* need first-child or last-child styling, the recommendation is to switch
* to #GtkGrid. For more information about migrating to #GtkGrid, see
* [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
*/
G_DEFINE_TYPE (GtkVBox, gtk_vbox, GTK_TYPE_BOX)
+1 -1
View File
@@ -1306,9 +1306,9 @@ gtk_accelerator_parse_with_keycode (const gchar *accelerator,
last_ch = *accelerator;
while (last_ch && last_ch != '>')
{
last_ch = *accelerator;
accelerator += 1;
len -= 1;
last_ch = *accelerator;
}
}
}
+9 -2
View File
@@ -393,8 +393,15 @@ menu_item_removed (gint position,
gpointer user_data)
{
GNSMenu *menu = user_data;
[menu removeItemAtIndex:position];
@try
{
[menu removeItemAtIndex:position];
}
@catch(NSException *err)
{
g_critical("GNSMenu removeItemAtIndex: %d raised exception %s", position,
[[err reason] UTF8String]);
}
}
@implementation GNSMenu
+12
View File
@@ -376,6 +376,18 @@ static void
gtk_application_after_emit (GApplication *application,
GVariant *platform_data)
{
const char *startup_notification_id = NULL;
g_variant_lookup (platform_data, "desktop-startup-id", "&s", &startup_notification_id);
if (startup_notification_id)
{
GdkDisplay *display;
display = gdk_display_get_default ();
if (display)
gdk_display_notify_startup_complete (display, startup_notification_id);
}
gdk_threads_leave ();
}
+3 -3
View File
@@ -137,8 +137,8 @@
* property value using the attributes
* "bind-source" to specify the source object of the binding,
* "bind-property" to specify the source property and optionally
* "bind-flags" to specify the binding flags
* Internally builder implement this using GBinding objects.
* "bind-flags" to specify the binding flags.
* Internally builder implements this using GBinding objects.
* For more information see g_object_bind_property()
*
* Signal handlers are set up with the <signal> element. The name
@@ -157,7 +157,7 @@
* been constructed by GTK+ as part of a composite widget, to set
* properties on them or to add further children (e.g. the @vbox of
* a #GtkDialog). This can be achieved by setting the internal-child
* propery of the <child> element to a true value. Note that GtkBuilder
* property of the <child> element to a true value. Note that GtkBuilder
* still requires an <object> element for the internal child, even if it
* has already been constructed.
*
+1 -1
View File
@@ -31,7 +31,7 @@
#include "gtktextbuffer.h"
#include "gtkselectionprivate.h"
#include "gtkquartz.h"
#include "../gdk/quartz/gdkquartz.h"
#include "quartz/gdkquartz-gtk-only.h"
enum {
OWNER_CHANGE,
+2
View File
@@ -140,6 +140,8 @@ gtk_css_image_surface_dispose (GObject *object)
surface->surface = NULL;
}
g_clear_pointer (&surface->cache, cairo_surface_destroy);
G_OBJECT_CLASS (_gtk_css_image_surface_parent_class)->dispose (object);
}
+1 -1
View File
@@ -396,7 +396,7 @@ parse_border (GtkCssShorthandProperty *shorthand,
values[6] = _gtk_css_value_ref (values[4]);
values[7] = _gtk_css_value_ref (values[4]);
}
else if (!G_IS_VALUE (&values[8]))
else if (values[8] == NULL)
{
values[8] = _gtk_css_color_value_parse (parser);
if (values[8] == NULL)
+6 -2
View File
@@ -42,6 +42,8 @@
#include "gtkintl.h"
#include "gtkquartz.h"
#include "gdk/quartz/gdkquartz.h"
#include "gdk/quartz/gdkquartz-gtk-only.h"
#include "gdk/quartz/gdkquartzdnd.h"
#include "gtkselectionprivate.h"
#include "gtksettings.h"
#include "gtkiconhelperprivate.h"
@@ -442,7 +444,7 @@ gtk_drag_dest_set (GtkWidget *widget,
old_site = g_object_get_data (G_OBJECT (widget), "gtk-drag-dest");
site = g_new (GtkDragDestSite, 1);
site = g_new0 (GtkDragDestSite, 1);
site->flags = flags;
site->have_drag = FALSE;
if (targets)
@@ -517,6 +519,7 @@ gtk_drag_dest_unset (GtkWidget *widget)
/**
* gtk_drag_dest_get_target_list: (method)
* @widget: a #GtkWidget
* Returns: (nullable) (transfer none): the #GtkTargetList, or %NULL if none
*/
GtkTargetList*
gtk_drag_dest_get_target_list (GtkWidget *widget)
@@ -1200,7 +1203,8 @@ gtk_drag_begin_internal (GtkWidget *widget,
window = [(id<GdkNSView>)[nswindow contentView] gdkWindow];
g_return_val_if_fail (nsevent != NULL, NULL);
g_return_val_if_fail (target_list != NULL, NULL);
context = gdk_drag_begin (window, g_list_copy (target_list->list));
g_return_val_if_fail (context != NULL, NULL);
+10
View File
@@ -5039,7 +5039,14 @@ void
_gtk_entry_grab_focus (GtkEntry *entry,
gboolean select_all)
{
if (!gtk_widget_get_can_focus (GTK_WIDGET (entry)))
return;
if (!gtk_widget_is_sensitive (GTK_WIDGET (entry)))
return;
GTK_WIDGET_CLASS (gtk_entry_parent_class)->grab_focus (GTK_WIDGET (entry));
if (select_all)
gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
}
@@ -11086,6 +11093,9 @@ gtk_entry_insert_emoji (GtkEntry *entry)
GtkWidget *chooser;
GdkRectangle rect;
if (gtk_entry_get_input_hints (entry) & GTK_INPUT_HINT_NO_EMOJI)
return;
if (gtk_widget_get_ancestor (GTK_WIDGET (entry), GTK_TYPE_EMOJI_CHOOSER) != NULL)
return;
+3 -1
View File
@@ -985,6 +985,7 @@ G_END_DECLS
* @GTK_INPUT_PURPOSE_NAME: Edited field expects the name of a person
* @GTK_INPUT_PURPOSE_PASSWORD: Like @GTK_INPUT_PURPOSE_FREE_FORM, but characters are hidden
* @GTK_INPUT_PURPOSE_PIN: Like @GTK_INPUT_PURPOSE_DIGITS, but characters are hidden
* @GTK_INPUT_PURPOSE_TERMINAL: Allow any character, in addition to control codes
*
* Describes primary purpose of the input widget. This information is
* useful for on-screen keyboards and similar input methods to decide
@@ -1018,7 +1019,8 @@ typedef enum
GTK_INPUT_PURPOSE_EMAIL,
GTK_INPUT_PURPOSE_NAME,
GTK_INPUT_PURPOSE_PASSWORD,
GTK_INPUT_PURPOSE_PIN
GTK_INPUT_PURPOSE_PIN,
GTK_INPUT_PURPOSE_TERMINAL,
} GtkInputPurpose;
/**
+10 -16
View File
@@ -47,6 +47,8 @@ struct _GtkEventControllerKey
GtkIMContext *im_context;
GHashTable *pressed_keys;
GdkModifierType state;
const GdkEvent *current_event;
};
@@ -87,10 +89,10 @@ gtk_event_controller_key_handle_event (GtkEventController *controller,
{
GtkEventControllerKey *key = GTK_EVENT_CONTROLLER_KEY (controller);
GdkEventType event_type = gdk_event_get_event_type (event);
gboolean handled;
GdkModifierType state;
guint16 keycode;
guint keyval;
gboolean handled = FALSE;
if (event_type == GDK_FOCUS_CHANGE)
{
@@ -112,23 +114,15 @@ gtk_event_controller_key_handle_event (GtkEventController *controller,
return TRUE;
}
if (!gdk_event_get_state (event, &state) || !event->key.is_modifier)
return FALSE;
key->current_event = event;
if (event->key.is_modifier)
gdk_event_get_state (event, &state);
if (key->state != state)
{
if (event_type == GDK_KEY_PRESS)
g_signal_emit (controller, signals[MODIFIERS], 0, state, &handled);
else
handled = TRUE;
gboolean unused;
if (handled == TRUE)
{
key->current_event = NULL;
return TRUE;
}
key->state = state;
g_signal_emit (controller, signals[MODIFIERS], 0, state, &unused);
}
gdk_event_get_keycode (event, &keycode);
@@ -206,11 +200,11 @@ gtk_event_controller_key_class_init (GtkEventControllerKeyClass *klass)
GTK_TYPE_EVENT_CONTROLLER_KEY,
G_SIGNAL_RUN_LAST,
0, NULL, NULL,
_gtk_marshal_BOOLEAN__UINT_UINT_FLAGS,
_gtk_marshal_VOID__UINT_UINT_FLAGS,
G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, GDK_TYPE_MODIFIER_TYPE);
g_signal_set_va_marshaller (signals[KEY_RELEASED],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_BOOLEAN__UINT_UINT_FLAGSv);
_gtk_marshal_VOID__UINT_UINT_FLAGSv);
signals[MODIFIERS] =
g_signal_new (I_("modifiers"),
+3
View File
@@ -455,6 +455,9 @@ gtk_event_controller_scroll_init (GtkEventControllerScroll *scroll)
{
scroll->scroll_history = g_array_new (FALSE, FALSE,
sizeof (ScrollHistoryElem));
gtk_event_controller_set_event_mask (GTK_EVENT_CONTROLLER (scroll),
GDK_SCROLL_MASK |
GDK_SMOOTH_SCROLL_MASK);
}
/**
+1 -2
View File
@@ -40,8 +40,7 @@
#include "gtklabel.h"
#include "gtkfilechooserentry.h"
#include "gtkfilefilterprivate.h"
#include "quartz/gdkquartz.h"
#include <quartz/gdkquartz-gtk-only.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
typedef struct {
+4
View File
@@ -112,6 +112,7 @@ struct _GtkFontChooserWidgetPrivate
gchar *preview_text;
gboolean show_preview_entry;
GtkWidget *size_label;
GtkWidget *size_spin;
GtkWidget *size_slider;
GtkWidget *size_slider2;
@@ -715,6 +716,7 @@ gtk_font_chooser_widget_class_init (GtkFontChooserWidgetClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, filter_model);
gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, preview);
gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, preview2);
gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, size_label);
gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, size_spin);
gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, size_slider);
gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, size_slider2);
@@ -2466,11 +2468,13 @@ gtk_font_chooser_widget_set_level (GtkFontChooserWidget *fontchooser,
{
gtk_widget_show (priv->size_slider);
gtk_widget_show (priv->size_spin);
gtk_widget_show (priv->size_label);
}
else
{
gtk_widget_hide (priv->size_slider);
gtk_widget_hide (priv->size_spin);
gtk_widget_hide (priv->size_label);
}
gtk_font_chooser_widget_load_fonts (fontchooser, TRUE);
+8 -1
View File
@@ -1455,12 +1455,19 @@ gtk_gesture_get_bounding_box_center (GtkGesture *gesture,
gdouble *x,
gdouble *y)
{
const GdkEvent *last_event;
GdkRectangle rect;
GdkEventSequence *sequence;
g_return_val_if_fail (GTK_IS_GESTURE (gesture), FALSE);
g_return_val_if_fail (x != NULL && y != NULL, FALSE);
if (!gtk_gesture_get_bounding_box (gesture, &rect))
sequence = gtk_gesture_get_last_updated_sequence (gesture);
last_event = gtk_gesture_get_last_event (gesture, sequence);
if (EVENT_IS_TOUCHPAD_GESTURE (last_event))
return gtk_gesture_get_point (gesture, sequence, x, y);
else if (!gtk_gesture_get_bounding_box (gesture, &rect))
return FALSE;
*x = rect.x + rect.width / 2;
+10 -7
View File
@@ -82,20 +82,20 @@ _gtk_gesture_rotate_get_angle (GtkGestureRotate *rotate,
gdouble x1, y1, x2, y2;
GtkGesture *gesture;
gdouble dx, dy;
GList *sequences;
GList *sequences = NULL;
gboolean retval = FALSE;
gesture = GTK_GESTURE (rotate);
priv = gtk_gesture_rotate_get_instance_private (rotate);
if (!gtk_gesture_is_recognized (gesture))
return FALSE;
goto out;
sequences = gtk_gesture_get_sequences (gesture);
if (!sequences)
return FALSE;
goto out;
last_event = gtk_gesture_get_last_event (gesture, sequences->data);
if (last_event->type == GDK_TOUCHPAD_PINCH &&
(last_event->touchpad_pinch.phase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN ||
last_event->touchpad_pinch.phase == GDK_TOUCHPAD_GESTURE_PHASE_UPDATE ||
@@ -106,11 +106,10 @@ _gtk_gesture_rotate_get_angle (GtkGestureRotate *rotate,
else
{
if (!sequences->next)
return FALSE;
goto out;
gtk_gesture_get_point (gesture, sequences->data, &x1, &y1);
gtk_gesture_get_point (gesture, sequences->next->data, &x2, &y2);
g_list_free (sequences);
dx = x1 - x2;
dy = y1 - y2;
@@ -124,7 +123,11 @@ _gtk_gesture_rotate_get_angle (GtkGestureRotate *rotate,
*angle = fmod (*angle, 2 * G_PI);
}
return TRUE;
retval = TRUE;
out:
g_list_free (sequences);
return retval;
}
static gboolean
+12 -7
View File
@@ -608,9 +608,10 @@ unset_screen (GtkIconTheme *icon_theme)
g_signal_handlers_disconnect_by_func (display,
(gpointer) display_closed,
icon_theme);
g_signal_handlers_disconnect_by_func (settings,
(gpointer) theme_changed,
icon_theme);
if (settings)
g_signal_handlers_disconnect_by_func (settings,
(gpointer) theme_changed,
icon_theme);
priv->screen = NULL;
}
@@ -3204,8 +3205,12 @@ theme_list_contexts (IconTheme *theme,
{
dir = l->data;
context = g_quark_to_string (dir->context);
g_hash_table_replace (contexts, (gpointer) context, NULL);
/* The "Context" key can be unset */
if (dir->context != 0)
{
context = g_quark_to_string (dir->context);
g_hash_table_replace (contexts, (gpointer) context, NULL);
}
l = l->next;
}
@@ -4022,8 +4027,8 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info)
else
{
icon_info->pixbuf = gdk_pixbuf_scale_simple (source_pixbuf,
0.5 + image_width * icon_info->scale,
0.5 + image_height * icon_info->scale,
MAX (1, 0.5 + image_width * icon_info->scale),
MAX (1, 0.5 + image_height * icon_info->scale),
GDK_INTERP_BILINEAR);
g_object_unref (source_pixbuf);
}
+1 -1
View File
@@ -140,7 +140,7 @@ get_x11_compose_file_dir (void)
{
gchar* compose_file_dir;
#if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WAYLAND)
#if defined (GDK_WINDOWING_X11)
compose_file_dir = g_strdup (X11_DATA_PREFIX "/share/X11/locale");
#else
compose_file_dir = g_build_filename (_gtk_get_datadir (), "X11", "locale", NULL);
+155 -1
View File
@@ -50,6 +50,7 @@
#include "gtktypebuiltins.h"
#include "gtkwidgetprivate.h"
#include "deprecated/gtkstock.h"
#include "gtkgesturemultipress.h"
/**
* SECTION:gtkinfobar
@@ -147,6 +148,10 @@ struct _GtkInfoBarPrivate
gboolean show_close_button;
GtkMessageType message_type;
int default_response;
gboolean default_response_sensitive;
GtkGesture *gesture;
};
typedef struct _ResponseData ResponseData;
@@ -299,6 +304,93 @@ find_button (GtkInfoBar *info_bar,
return child;
}
static void
update_state (GtkWidget *widget,
gboolean in)
{
GtkStateFlags state;
state = gtk_widget_get_state_flags (widget);
if (in)
state |= GTK_STATE_FLAG_PRELIGHT;
else
state &= ~GTK_STATE_FLAG_PRELIGHT;
gtk_widget_set_state_flags (widget, state, TRUE);
}
static gboolean
gtk_info_bar_enter_notify (GtkWidget *widget,
GdkEventCrossing *event)
{
if (event->detail != GDK_NOTIFY_INFERIOR)
update_state (widget, TRUE);
return FALSE;
}
static gboolean
gtk_info_bar_leave_notify (GtkWidget *widget,
GdkEventCrossing *event)
{
if (event->detail != GDK_NOTIFY_INFERIOR)
update_state (widget, FALSE);
return FALSE;
}
static void
gtk_info_bar_realize (GtkWidget *widget)
{
GtkAllocation allocation;
GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
gtk_widget_get_allocation (widget, &allocation);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_ONLY;
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= (GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_TOUCH_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK);
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
gtk_widget_register_window (widget, window);
gtk_widget_set_window (widget, window);
}
static void
gtk_info_bar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GdkWindow *window;
gtk_widget_set_allocation (widget, allocation);
window = gtk_widget_get_window (widget);
if (window != NULL)
gdk_window_move_resize (window,
allocation->x, allocation->y,
allocation->width, allocation->height);
allocation->x = 0;
allocation->y = 0;
GTK_WIDGET_CLASS (gtk_info_bar_parent_class)->size_allocate (widget, allocation);
}
static void
gtk_info_bar_close (GtkInfoBar *info_bar)
{
@@ -310,6 +402,16 @@ gtk_info_bar_close (GtkInfoBar *info_bar)
GTK_RESPONSE_CANCEL);
}
static void
gtk_info_bar_finalize (GObject *object)
{
GtkInfoBar *info_bar = GTK_INFO_BAR (object);
g_object_unref (info_bar->priv->gesture);
G_OBJECT_CLASS (gtk_info_bar_parent_class)->finalize (object);
}
static void
gtk_info_bar_class_init (GtkInfoBarClass *klass)
{
@@ -320,9 +422,15 @@ gtk_info_bar_class_init (GtkInfoBarClass *klass)
widget_class = GTK_WIDGET_CLASS (klass);
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gtk_info_bar_finalize;
object_class->get_property = gtk_info_bar_get_property;
object_class->set_property = gtk_info_bar_set_property;
widget_class->realize = gtk_info_bar_realize;
widget_class->enter_notify_event = gtk_info_bar_enter_notify;
widget_class->leave_notify_event = gtk_info_bar_leave_notify;
widget_class->size_allocate = gtk_info_bar_size_allocate;
klass->close = gtk_info_bar_close;
/**
@@ -498,6 +606,19 @@ close_button_clicked_cb (GtkWidget *button,
GTK_RESPONSE_CLOSE);
}
static void
click_pressed_cb (GtkGestureMultiPress *gesture,
guint n_press,
gdouble x,
gdouble y,
GtkInfoBar *info_bar)
{
GtkInfoBarPrivate *priv = gtk_info_bar_get_instance_private (info_bar);
if (priv->default_response && priv->default_response_sensitive)
gtk_info_bar_response (info_bar, priv->default_response);
}
static void
gtk_info_bar_init (GtkInfoBar *info_bar)
{
@@ -511,11 +632,16 @@ gtk_info_bar_init (GtkInfoBar *info_bar)
* during construction */
priv->message_type = GTK_MESSAGE_OTHER;
gtk_widget_set_has_window (widget, TRUE);
gtk_widget_init_template (widget);
gtk_widget_set_no_show_all (priv->close_button, TRUE);
g_signal_connect (priv->close_button, "clicked",
G_CALLBACK (close_button_clicked_cb), info_bar);
priv->gesture = gtk_gesture_multi_press_new (widget);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->gesture), GDK_BUTTON_PRIMARY);
g_signal_connect (priv->gesture, "pressed", G_CALLBACK (click_pressed_cb), widget);
}
static GtkBuildableIface *parent_buildable_iface;
@@ -789,6 +915,22 @@ gtk_info_bar_new_with_buttons (const gchar *first_button_text,
return GTK_WIDGET (info_bar);
}
static void
update_default_response (GtkInfoBar *info_bar,
int response_id,
gboolean sensitive)
{
GtkInfoBarPrivate *priv = gtk_info_bar_get_instance_private (info_bar);
priv->default_response = response_id;
priv->default_response_sensitive = sensitive;
if (response_id && sensitive)
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (info_bar)), "action");
else
gtk_style_context_remove_class (gtk_widget_get_style_context (GTK_WIDGET (info_bar)), "action");
}
/**
* gtk_info_bar_set_response_sensitive:
* @info_bar: a #GtkInfoBar
@@ -810,6 +952,9 @@ gtk_info_bar_set_response_sensitive (GtkInfoBar *info_bar,
g_return_if_fail (GTK_IS_INFO_BAR (info_bar));
if (info_bar->priv->default_response == response_id)
info_bar->priv->default_response_sensitive = setting;
children = gtk_container_get_children (GTK_CONTAINER (info_bar->priv->action_area));
for (list = children; list; list = list->next)
@@ -822,6 +967,9 @@ gtk_info_bar_set_response_sensitive (GtkInfoBar *info_bar,
}
g_list_free (children);
if (response_id == info_bar->priv->default_response)
update_default_response (info_bar, response_id, setting);
}
/**
@@ -843,6 +991,7 @@ gtk_info_bar_set_default_response (GtkInfoBar *info_bar,
gint response_id)
{
GList *children, *list;
gboolean sensitive = TRUE;
g_return_if_fail (GTK_IS_INFO_BAR (info_bar));
@@ -854,10 +1003,15 @@ gtk_info_bar_set_default_response (GtkInfoBar *info_bar,
ResponseData *rd = get_response_data (widget, FALSE);
if (rd && rd->response_id == response_id)
gtk_widget_grab_default (widget);
{
gtk_widget_grab_default (widget);
sensitive = gtk_widget_get_sensitive (widget);
}
}
g_list_free (children);
update_default_response (info_bar, response_id, sensitive);
}
/**
+4 -1
View File
@@ -2426,8 +2426,11 @@ gtk_list_box_update_header (GtkListBox *box,
priv->update_header_func_target);
if (old_header != ROW_PRIV (row)->header)
{
if (old_header != NULL)
if (old_header != NULL &&
g_hash_table_lookup (priv->header_hash, old_header) == row)
{
/* Only unparent the @old_header if it hasnt been re-used as the
* header for a different row. */
gtk_widget_unparent (old_header);
g_hash_table_remove (priv->header_hash, old_header);
}
+1
View File
@@ -115,6 +115,7 @@ VOID:STRING,UINT,FLAGS
VOID:STRING,UINT,FLAGS,UINT
VOID:UINT,FLAGS,BOXED
VOID:UINT,UINT
VOID:UINT,UINT,FLAGS
VOID:UINT,STRING
VOID:UINT,BOXED,UINT,FLAGS,FLAGS
VOID:UINT,OBJECT,UINT,FLAGS,FLAGS
+6 -3
View File
@@ -3343,17 +3343,20 @@ menu_grab_transfer_window_get (GtkMenu *menu)
static void
menu_grab_transfer_window_destroy (GtkMenu *menu)
{
GtkMenuPrivate *priv = menu->priv;
GdkWindow *window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window");
if (window)
{
GdkWindow *widget_window;
GdkWindow *toplevel_window;
gtk_widget_unregister_window (GTK_WIDGET (menu), window);
gdk_window_destroy (window);
g_object_set_data (G_OBJECT (menu), I_("gtk-menu-transfer-window"), NULL);
widget_window = gtk_widget_get_window (GTK_WIDGET (menu));
g_object_set_data (G_OBJECT (widget_window), I_("gdk-attached-grab-window"), window);
toplevel_window = gtk_widget_get_window (priv->toplevel);
if (toplevel_window != NULL)
g_object_set_data (G_OBJECT (toplevel_window), I_("gdk-attached-grab-window"), NULL);
}
}
+22
View File
@@ -247,6 +247,15 @@ gtk_model_button_update_state (GtkModelButton *button)
gtk_css_gadget_set_state (button->gadget, state);
gtk_css_gadget_set_state (button->indicator_gadget, indicator_state);
if (button->role == GTK_BUTTON_ROLE_CHECK ||
button->role == GTK_BUTTON_ROLE_RADIO)
{
AtkObject *object = _gtk_widget_peek_accessible (GTK_WIDGET (button));
if (object)
atk_object_notify_state_change (object, ATK_STATE_CHECKED,
(indicator_state & GTK_STATE_FLAG_CHECKED));
}
}
static void
@@ -1090,6 +1099,18 @@ gtk_model_button_finalize (GObject *object)
G_OBJECT_CLASS (gtk_model_button_parent_class)->finalize (object);
}
static AtkObject *
gtk_model_button_get_accessible (GtkWidget *widget)
{
AtkObject *object;
object = GTK_WIDGET_CLASS (gtk_model_button_parent_class)->get_accessible (widget);
gtk_model_button_update_state (GTK_MODEL_BUTTON (widget));
return object;
}
static void
gtk_model_button_class_init (GtkModelButtonClass *class)
{
@@ -1111,6 +1132,7 @@ gtk_model_button_class_init (GtkModelButtonClass *class)
widget_class->destroy = gtk_model_button_destroy;
widget_class->state_flags_changed = gtk_model_button_state_flags_changed;
widget_class->direction_changed = gtk_model_button_direction_changed;
widget_class->get_accessible = gtk_model_button_get_accessible;
button_class->clicked = gtk_model_button_clicked;
+4 -4
View File
@@ -463,10 +463,10 @@ display_closed_cb (GdkDisplay *display,
screen = gdk_display_get_default_screen (display);
settings = gtk_settings_get_for_screen (screen);
g_object_set_data_full (G_OBJECT (settings),
I_("gtk-modules"),
NULL, NULL);
if (settings)
g_object_set_data_full (G_OBJECT (settings),
I_("gtk-modules"),
NULL, NULL);
}
+6 -5
View File
@@ -229,17 +229,18 @@ _gtk_pixel_cache_create_surface_if_needed (GtkPixelCache *cache,
{
cache->surface_x = -canvas_rect->x;
cache->surface_y = -canvas_rect->y;
cache->surface_w = surface_w;
cache->surface_h = surface_h;
cache->surface_w = MAX (surface_w, 1);
cache->surface_h = MAX (surface_h, 1);
cache->surface_scale = gdk_window_get_scale_factor (window);
cache->surface =
gdk_window_create_similar_surface (window, content,
surface_w, surface_h);
cache->surface_w,
cache->surface_h);
rect.x = 0;
rect.y = 0;
rect.width = surface_w;
rect.height = surface_h;
rect.width = cache->surface_w;
rect.height = cache->surface_h;
cache->surface_dirty =
cairo_region_create_rectangle (&rect);
}
+1 -1
View File
@@ -20,7 +20,7 @@
#include "gtkquartz.h"
#include "gtkselectionprivate.h"
#include <gdk/quartz/gdkquartz.h>
#include <gdk/quartz/gdkquartz-gtk-only.h>
static gboolean
+2
View File
@@ -70,6 +70,8 @@
*
* GtkScaleButton has a single CSS node with name button. To differentiate
* it from a plain #GtkButton, it gets the .scale style class.
*
* The popup widget that contains the scale has a .scale-popup style class.
*/
+23
View File
@@ -112,6 +112,10 @@
#include <gdk/wayland/gdkwayland.h>
#endif
#ifdef GDK_WINDOWING_BROADWAY
#include "broadway/gdkbroadway.h"
#endif
#undef DEBUG_SELECTION
/* Maximum size of a sent chunk, in bytes. Also the default size of
@@ -1180,6 +1184,25 @@ gtk_selection_convert (GtkWidget *widget,
return TRUE;
}
}
#if defined GDK_WINDOWING_BROADWAY
/* This patch is a workaround to circumvent unimplemented
clipboard functionality in broadwayd. It eliminates
35s delay on popup menu before first clipboard copy,
by preventing conversion to be started.
https://gitlab.gnome.org/GNOME/gtk/issues/1630
*/
if (GDK_IS_BROADWAY_DISPLAY (display))
{
g_debug("gtk_selection_convert: disabled for broadway backend");
gtk_selection_retrieval_report (
info, GDK_NONE, 0, NULL, -1, GDK_CURRENT_TIME);
return FALSE;
}
#endif
/* Otherwise, we need to go through X */
+31 -2
View File
@@ -59,7 +59,7 @@
#include "deprecated/gtkrc.h"
#ifdef GDK_WINDOWING_QUARTZ
#define PRINT_PREVIEW_COMMAND "open -a /Applications/Preview.app %f"
#define PRINT_PREVIEW_COMMAND "open -b com.apple.Preview %f"
#else
#define PRINT_PREVIEW_COMMAND "evince --unlink-tempfile --preview --print-settings %s %f"
#endif
@@ -1900,6 +1900,29 @@ settings_init_style (GtkSettings *settings)
settings_update_key_theme (settings);
}
static void
settings_display_closed (GdkDisplay *display,
gboolean is_error,
gpointer data)
{
DisplaySettings *ds;
int i;
if (G_UNLIKELY (display_settings == NULL))
return;
ds = (DisplaySettings *)display_settings->data;
for (i = 0; i < display_settings->len; i++)
{
if (ds[i].display == display)
{
g_clear_object (&ds[i].settings);
display_settings = g_array_remove_index_fast (display_settings, i);
break;
}
}
}
static GtkSettings *
gtk_settings_create_for_display (GdkDisplay *display)
{
@@ -1955,7 +1978,9 @@ gtk_settings_create_for_display (GdkDisplay *display)
v.display = display;
v.settings = settings;
g_array_append_val (display_settings, v);
display_settings = g_array_append_val (display_settings, v);
g_signal_connect (display, "closed",
G_CALLBACK (settings_display_closed), NULL);
settings_init_style (settings);
settings_update_xsettings (settings);
@@ -1975,6 +2000,10 @@ gtk_settings_get_for_display (GdkDisplay *display)
DisplaySettings *ds;
int i;
/* If the display is closed, we don't want to recreate the settings! */
if G_UNLIKELY (gdk_display_is_closed (display))
return NULL;
if G_UNLIKELY (display_settings == NULL)
display_settings = g_array_new (FALSE, TRUE, sizeof (DisplaySettings));
+3
View File
@@ -208,6 +208,7 @@ gtk_switch_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
gtk_widget_get_allocation (GTK_WIDGET (sw), &allocation);
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
priv->in_switch = TRUE;
/* If the press didn't happen in the draggable handle,
* cancel the pan gesture right away
@@ -232,6 +233,8 @@ gtk_switch_multipress_gesture_released (GtkGestureMultiPress *gesture,
if (priv->in_switch &&
gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
gtk_switch_begin_toggle_animation (sw);
priv->in_switch = FALSE;
}
static void
+3
View File
@@ -11462,6 +11462,9 @@ gtk_text_view_insert_emoji (GtkTextView *text_view)
GdkRectangle rect;
GtkTextBuffer *buffer;
if (gtk_text_view_get_input_hints (text_view) & GTK_INPUT_HINT_NO_EMOJI)
return;
if (gtk_widget_get_ancestor (GTK_WIDGET (text_view), GTK_TYPE_EMOJI_CHOOSER) != NULL)
return;
+3 -3
View File
@@ -526,12 +526,12 @@ gtk_tree_model_sort_drag_source_init (GtkTreeDragSourceIface *iface)
}
/**
* gtk_tree_model_sort_new_with_model:
* gtk_tree_model_sort_new_with_model: (constructor)
* @child_model: A #GtkTreeModel
*
* Creates a new #GtkTreeModel, with @child_model as the child model.
* Creates a new #GtkTreeModelSort, with @child_model as the child model.
*
* Returns: (transfer full): A new #GtkTreeModel.
* Returns: (transfer full) (type Gtk.TreeModelSort): A new #GtkTreeModelSort.
*/
GtkTreeModel *
gtk_tree_model_sort_new_with_model (GtkTreeModel *child_model)
+19
View File
@@ -673,6 +673,8 @@ static gboolean _gtk_widget_run_controllers (GtkWidget *widget,
static void gtk_widget_dispatch_child_properties_changed (GtkWidget *object,
guint n_pspecs,
GParamSpec **pspecs);
static gboolean gtk_widget_real_scroll_event (GtkWidget *widget,
GdkEventScroll *event);
static gboolean gtk_widget_real_button_event (GtkWidget *widget,
GdkEventButton *event);
static gboolean gtk_widget_real_motion_event (GtkWidget *widget,
@@ -1061,6 +1063,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
klass->move_focus = gtk_widget_real_move_focus;
klass->keynav_failed = gtk_widget_real_keynav_failed;
klass->event = NULL;
klass->scroll_event = gtk_widget_real_scroll_event;
klass->button_press_event = gtk_widget_real_button_event;
klass->button_release_event = gtk_widget_real_button_event;
klass->motion_notify_event = gtk_widget_real_motion_event;
@@ -7186,6 +7189,14 @@ gtk_widget_draw (GtkWidget *widget,
cairo_restore (cr);
}
static gboolean
gtk_widget_real_scroll_event (GtkWidget *widget,
GdkEventScroll *event)
{
return _gtk_widget_run_controllers (widget, (GdkEvent *) event,
GTK_PHASE_BUBBLE);
}
static gboolean
gtk_widget_real_button_event (GtkWidget *widget,
GdkEventButton *event)
@@ -7206,6 +7217,10 @@ static gboolean
gtk_widget_real_key_press_event (GtkWidget *widget,
GdkEventKey *event)
{
if (_gtk_widget_run_controllers (widget, (GdkEvent *) event,
GTK_PHASE_BUBBLE))
return GDK_EVENT_STOP;
return gtk_bindings_activate_event (G_OBJECT (widget), event);
}
@@ -7213,6 +7228,10 @@ static gboolean
gtk_widget_real_key_release_event (GtkWidget *widget,
GdkEventKey *event)
{
if (_gtk_widget_run_controllers (widget, (GdkEvent *) event,
GTK_PHASE_BUBBLE))
return GDK_EVENT_STOP;
return gtk_bindings_activate_event (G_OBJECT (widget), event);
}
+12 -5
View File
@@ -7236,13 +7236,20 @@ corner_rect (cairo_rectangle_int_t *rect,
}
static void
subtract_corners_from_region (cairo_region_t *region,
cairo_rectangle_int_t *extents,
GtkStyleContext *context,
GtkWindow *window)
subtract_decoration_corners_from_region (cairo_region_t *region,
cairo_rectangle_int_t *extents,
GtkStyleContext *context,
GtkWindow *window)
{
GtkWindowPrivate *priv = window->priv;
cairo_rectangle_int_t rect;
if (!priv->client_decorated ||
!priv->decorated ||
priv->fullscreen ||
priv->maximized)
return;
gtk_style_context_save_to_node (context, window->priv->decoration_node);
corner_rect (&rect, _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS));
@@ -7304,7 +7311,7 @@ update_opaque_region (GtkWindow *window,
opaque_region = cairo_region_create_rectangle (&rect);
subtract_corners_from_region (opaque_region, &rect, context, window);
subtract_decoration_corners_from_region (opaque_region, &rect, context, window);
}
else
{
+2 -1
View File
@@ -511,7 +511,8 @@ add_device (GtkInspectorGeneral *gen,
"Keyboard",
"Touchscreen",
"Touchpad",
"Trackpoint"
"Trackpoint",
"Pad"
};
name = gdk_device_get_name (device);
+11 -11
View File
@@ -964,17 +964,17 @@ foreach l: immodules
endforeach
# Library
libgtk = shared_library('gtk-3',
soversion: gtk_soversion,
version: gtk_library_version,
sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h],
c_args: gtk_cargs + common_cflags,
include_directories: [confinc, gdkinc, gtkinc],
dependencies: gtk_deps + [libgdk_dep] + gtk_included_im_deps,
link_with: libgdk,
link_args: common_ldflags,
darwin_versions : gtk_osxversions,
install: true)
libgtk = library('gtk-3',
soversion: gtk_soversion,
version: gtk_library_version,
sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h],
c_args: gtk_cargs + common_cflags,
include_directories: [confinc, gdkinc, gtkinc],
dependencies: gtk_deps + [libgdk_dep] + gtk_included_im_deps,
link_with: libgdk,
link_args: common_ldflags,
darwin_versions : gtk_osxversions,
install: true)
# Introspection
if build_gir
+224 -110
View File
@@ -179,13 +179,8 @@ label {
&.separator {
@extend .dim-label;
color: $fg_color;
&:backdrop { color: $backdrop_fg_color; }
}
row:selected &,
&:selected { @extend %nobg_selected_items; }
selection {
@@ -196,15 +191,19 @@ label {
&:disabled {
color: $insensitive_fg_color;
selection { @extend %selected_items:disabled; }
button & { color: inherit; }
&:backdrop { color: $backdrop_insensitive_color; }
&:backdrop {
color: $backdrop_insensitive_color;
button & { color: inherit; }
}
selection { @extend %selected_items_disabled; }
}
&:backdrop {
color: $backdrop_fg_color;
selection { @extend %selected_items:backdrop; }
selection { @extend %selected_items_backdrop; }
}
}
@@ -268,6 +267,47 @@ spinner {
}
}
/**********************
* General Typography *
**********************/
.large-title {
font-weight: 300;
font-size: 24pt;
letter-spacing: 0.2rem;
}
.title-1 {
font-weight: 800;
font-size: 20pt;
}
.title-2 {
font-weight: 800;
font-size: 15pt;
}
.title-3 {
font-weight: 700;
font-size: 15pt;
}
.title-4 {
font-weight: 700;
font-size: 13pt;
}
.heading {
font-weight: 700;
font-size: 11pt;
}
.body {
font-weight: 400;
font-size: 11pt;
}
.caption-heading {
font-weight: 700;
font-size: 9pt;
}
.caption {
font-weight: 400;
font-size: 9pt;
}
/****************
* Text Entries *
@@ -543,6 +583,7 @@ button {
@include button(normal);
@at-root %button_basic_flat,
&.flat {
@include button(undecorated);
// to avoid adiacent buttons borders clashing when transitioning, the transition on the normal state is set
@@ -590,6 +631,7 @@ button {
}
}
@at-root %button_basic_flat,
&.flat { &:backdrop, &:disabled, &:backdrop:disabled { @include button(undecorated); }}
&:disabled {
@@ -620,6 +662,7 @@ button {
}
}
@at-root %button_basic_drop_active,
&:drop(active) {
color: $drop_target_color;
border-color: $drop_target_color;
@@ -630,12 +673,16 @@ button {
@at-root %button_selected, & {
row:selected & {
@if $variant == 'light' { border-color: $selected_borders_color; }
}
&.flat:not(:active):not(:checked):not(:hover):not(disabled) {
color: $selected_fg_color;
border-color: transparent;
@at-root %button_selected_flat, &.flat {
row:selected & {
&:not(:active):not(:checked):not(:hover):not(disabled) {
color: $selected_fg_color;
border-color: transparent;
&:backdrop { color: if($variant=='light', $backdrop_base_color, $backdrop_fg_color); }
&:backdrop { color: if($variant=='light', $backdrop_base_color, $backdrop_fg_color); }
}
}
}
}
@@ -961,16 +1008,17 @@ toolbar.inline-toolbar toolbutton,
toolbar.inline-toolbar toolbutton:backdrop {
> button.flat { @extend %linked_middle; }
&:first-child > button.flat { @extend %linked:first-child; }
&:first-child > button.flat { @extend %linked_left; }
&:last-child > button.flat { @extend %linked:last-child; }
&:last-child > button.flat { @extend %linked_right; }
&:only-child > button.flat { @extend %linked:only-child; }
&:only-child > button.flat { @extend %linked_only_child; }
}
%linked_middle {
border-radius: 0;
border-right-style: none;
-gtk-outline-radius: 0;
}
%linked_left {
@@ -979,6 +1027,10 @@ toolbar.inline-toolbar toolbutton:backdrop {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-right-style: none;
-gtk-outline-bottom-left-radius: $button_radius;
-gtk-outline-top-left-radius: $button_radius;
-gtk-outline-top-right-radius: 0;
-gtk-outline-bottom-right-radius: 0;
}
%linked_right {
@@ -987,6 +1039,16 @@ toolbar.inline-toolbar toolbutton:backdrop {
border-top-right-radius: $button_radius;
border-bottom-right-radius: $button_radius;
border-right-style: solid;
-gtk-outline-bottom-right-radius: $button_radius;
-gtk-outline-top-right-radius: $button_radius;
-gtk-outline-bottom-left-radius: 0;
-gtk-outline-top-left-radius: 0;
}
%linked_only_child {
border-radius: $button_radius;
border-style: solid;
-gtk-outline-radius: $button_radius;
}
// .linked assumes Box, which reverses nodes in RTL, so 1st child is always left
@@ -996,10 +1058,7 @@ toolbar.inline-toolbar toolbutton:backdrop {
&:first-child { @extend %linked_left; }
&:last-child { @extend %linked_right; }
&:only-child {
border-radius: $button_radius;
border-style: solid;
}
&:only-child { @extend %linked_only_child; }
}
// Other widgets use widget child order, so 1st/last child are at text start/end
@@ -1016,10 +1075,7 @@ toolbar.inline-toolbar toolbutton:backdrop {
&:last-child { @extend %linked_left; }
}
&:only-child {
border-radius: $button_radius;
border-style: solid;
}
&:only-child { @extend %linked_only_child; }
}
%linked_vertical_middle {
@@ -1027,24 +1083,30 @@ toolbar.inline-toolbar toolbutton:backdrop {
border-radius: 0;
}
%linked_vertical_top {
border-top-left-radius: $button_radius;
border-top-right-radius: $button_radius;
}
%linked_vertical_bottom {
border-bottom-left-radius: $button_radius;
border-bottom-right-radius: $button_radius;
border-style: solid;
}
%linked_vertical_only_child {
border-radius: $button_radius;
border-style: solid;
}
%linked_vertical{
@extend %linked_vertical_middle;
&:first-child {
border-top-left-radius: $button_radius;
border-top-right-radius: $button_radius;
}
&:first-child { @extend %linked_vertical_top; }
&:last-child {
border-bottom-left-radius: $button_radius;
border-bottom-right-radius: $button_radius;
border-style: solid;
}
&:last-child { @extend %linked_vertical_bottom; }
&:only-child {
border-radius: $button_radius;
border-style: solid;
}
&:only-child { @extend %linked_vertical_only_child; }
}
%undecorated_button {
@@ -1130,35 +1192,36 @@ list row button.image-button:not(.flat) {
&:visited {
color: $link_visited_color;
*:selected & { color: mix($selected_fg_color, $selected_bg_color, 60%); }
*:selected & { color: mix($selected_fg_color, $link_visited_color, 60%); }
}
&:hover {
color: lighten($link_color,10%);
$_fg: lighten($link_color, 10%);
color: $_fg;
*:selected & { color: mix($selected_fg_color, $selected_bg_color, 90%); }
*:selected & { color: mix($selected_fg_color, $_fg, 90%); }
}
&:active {
color: $link_color;
*:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); }
*:selected & { color: mix($selected_fg_color, $link_color, 80%); }
}
&:disabled, &:disabled:backdrop { color: transparentize(desaturate($link_color,100%), 0.2); }
&:disabled, &:disabled:backdrop { color: transparentize(desaturate($link_color, 100%), 0.2); }
&:backdrop { &:backdrop:hover, &:backdrop:hover:selected, & { color: $selected_bg_color; }}
&:backdrop { &:backdrop:hover, &:backdrop:hover:selected, & { color: transparentize($link_color, 0.1); }}
@at-root %link_selected,
&:selected,
*:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); }
*:selected & { color: mix($selected_fg_color, $link_color, 80%); }
}
button:link,
button:visited {
@extend %undecorated_button;
@extend *:link;
@extend %link;
text-shadow: none;
@@ -1395,15 +1458,15 @@ combobox {
&.linked {
button:nth-child(2) {
&:dir(ltr) { @extend %linked:last-child; }
&:dir(rtl) { @extend %linked:first-child; }
&:dir(ltr) { @extend %linked_right; }
&:dir(rtl) { @extend %linked_left; }
}
}
&:drop(active) { // FIXME: untested
box-shadow: none;
button.combo { @extend %button_basic:drop(active); }
button.combo { @extend %button_basic_drop_active; }
}
}
@@ -1416,14 +1479,14 @@ combobox {
&:dir(rtl) { @extend %linked_middle; } // specificity bump
}
.linked:not(.vertical) > combobox:first-child > box > button.combo { @extend %linked:first-child; }
.linked:not(.vertical) > combobox:last-child > box > button.combo { @extend %linked:last-child; }
.linked:not(.vertical) > combobox:only-child > box > button.combo { @extend %linked:only-child; }
.linked:not(.vertical) > combobox:first-child > box > button.combo { @extend %linked_left; }
.linked:not(.vertical) > combobox:last-child > box > button.combo { @extend %linked_right; }
.linked:not(.vertical) > combobox:only-child > box > button.combo { @extend %linked_only_child; }
.linked.vertical > combobox > box > button.combo { @extend %linked_vertical_middle; }
.linked.vertical > combobox:first-child > box > button.combo { @extend %linked_vertical:first-child;}
.linked.vertical > combobox:last-child > box > button.combo { @extend %linked_vertical:last-child; }
.linked.vertical > combobox:only-child > box > button.combo { @extend %linked_vertical:only-child; }
.linked.vertical > combobox:first-child > box > button.combo { @extend %linked_vertical_top;}
.linked.vertical > combobox:last-child > box > button.combo { @extend %linked_vertical_bottom; }
.linked.vertical > combobox:only-child > box > button.combo { @extend %linked_vertical_only_child; }
/************
@@ -1583,11 +1646,12 @@ headerbar {
}
}
.subtitle:link { @extend *:link:selected; }
.subtitle:link { @extend %link_selected; }
button {
@include button(normal, $suggested_bg_color, $selected_fg_color);
@at-root %selection_mode_button_flat,
&.flat { @include button(undecorated); }
&:hover { @include button(hover, $suggested_bg_color, $selected_fg_color); }
@@ -1625,6 +1689,7 @@ headerbar {
}
}
@at-root %selection_mode_button_flat,
&.flat { &:backdrop, &:disabled, &:backdrop:disabled { @include button(undecorated); }}
&:disabled {
@@ -1834,26 +1899,20 @@ headerbar { // headerbar border rounding
window.devel {
headerbar.titlebar:not(.selection-mode) {
$c: darken($bg_color, 10%);
$gradient: -gtk-icontheme("system-run-symbolic") 90% 0/256px 256px no-repeat,
$gradient: cross-fade(10% -gtk-icontheme("system-run-symbolic"), image(transparent)) 90% 0/256px 256px no-repeat,
linear-gradient(to right, transparent 65%, transparentize($selected_bg_color, 0.8)),
linear-gradient(to top, darken($c, 3%), $c 3px, lighten($c, 6%));
@if $variant == 'dark' {
$gradient: -gtk-icontheme("system-run-symbolic") 90% 0/256px 256px no-repeat,
$gradient: cross-fade(10% -gtk-icontheme("system-run-symbolic"), image(transparent)) 90% 0/256px 256px no-repeat,
linear-gradient(to right, transparent 65%, transparentize($selected_bg_color, 0.9)),
linear-gradient(to top, lighten($c, 3%) 3px, lighten($c, 5%));
}
background: $bg_color $gradient;
color: transparentize($fg_color,.9);
label { color: $fg_color; }
&:backdrop {
background: $bg_color -gtk-icontheme("system-run-symbolic") 90% 0/256px 256px no-repeat,
background: $bg_color cross-fade(10% -gtk-icontheme("system-run-symbolic"), image(transparent)) 90% 0/256px 256px no-repeat,
image($bg_color); /* background-color would flash */
color: transparentize($fg_color,.95);
label { color: $backdrop_fg_color; }
}
}
}
@@ -2127,7 +2186,7 @@ menubar,
// remove padding and rounding from menubar submenus
menu {
.csd &, & {
&:dir(rtl), &:dir(ltr) { // specificity bump
border-radius: 0;
padding: 0;
}
@@ -2275,6 +2334,13 @@ popover.background {
border-radius: $popover_radius;
}
.csd & {
$_popover_border: if($variant=='light', transparentize(black, 0.77), transparentize($borders_color, 0.1));
background-clip: padding-box;
border-color: $_popover_border;
}
box-shadow: 0 1px 2px transparentize(black, 0.7);
&:backdrop {
@@ -2429,7 +2495,7 @@ notebook {
> tabs > arrow {
@extend %button_basic;
@extend %button_basic.flat;
@extend %button_basic_flat;
min-height: 16px;
min-width: 16px;
@@ -2932,20 +2998,42 @@ radio {
border: 1px solid;
-gtk-icon-source: none;
@include button(normal-alt, $edge: $shadow_color);
&:hover { @include button(hover-alt, $c:$checkradio_bg_color, $tc:$checkradio_fg_color, $edge: $shadow_color); }
&:hover:not(:checked) { @include button(hover-alt, $edge: $shadow_color); }
&:active { @include button(active, $c:$checkradio_bg_color, $tc:$checkradio_fg_color); }
&:checked { @include button(normal-alt, $c:$checkradio_bg_color, $tc:$checkradio_fg_color, $edge: $shadow_color); }
&:disabled { @include button(insensitive); }
&:backdrop {
@include button(backdrop);
& {
// for unchecked
$_c: if($variant=='light', white, $bg_color);
transition: $backdrop_transition;
&:disabled { @include button(backdrop-insensitive); }
@each $state, $t in ("", "normal"),
(":hover", "hover"),
(":active", "active"),
(":disabled", "insensitive"),
(":backdrop", "backdrop"),
(":backdrop:disabled", 'backdrop-insensitive') {
&#{$state} {
@include check($t, $_c);
}
}
}
& {
// for checked
@each $t in (':checked'), (':indeterminate') {
&#{$t} {
@each $state, $t in ("", "normal"),
(":hover", "hover"),
(":active", "active"),
(":disabled", "insensitive"),
(":backdrop", "backdrop"),
(":backdrop:disabled", 'backdrop-insensitive') {
&#{$state} {
@include check($t, $checkradio_bg_color, $checkradio_fg_color, $checked: true);
}
}
}
}
}
&:backdrop { transition: $backdrop_transition; }
@if $variant == 'light' {
// the borders of the light variant versions of checks and radios are too similar in luminosity to the selected background
// color, hence we need special casing.
@@ -2964,15 +3052,17 @@ radio {
menu menuitem & {
margin: 0; // this is a workaround for a menu check/radio size allocation issue
&, &:hover, &:disabled { //FIXME use button reset mixin
min-height: 14px;
min-width: 14px;
background-image: none;
background-color: transparent;
box-shadow: none;
-gtk-icon-shadow: none;
color: inherit;
border-color: currentColor;
&, &:checked, &:indeterminate {
&, &:hover, &:disabled { //FIXME use button reset mixin
min-height: 14px;
min-width: 14px;
background-image: none;
background-color: transparent;
box-shadow: none;
-gtk-icon-shadow: none;
color: inherit;
border-color: currentColor;
}
}
}
}
@@ -3031,15 +3121,7 @@ treeview.view radio {
@if $variant == 'light' { border-color: $selected_borders_color; }
}
&:disabled {
color: $insensitive_fg_color;
&:backdrop { color: $backdrop_insensitive_color; }
}
}
&:backdrop { &:selected, & { color: $backdrop_fg_color; }}
}
treeview.view radio:selected { &:focus, & { @extend %radio; }} // This is a workaround
@@ -3755,6 +3837,7 @@ list {
border-color: $borders_color;
&:backdrop {
color: $backdrop_text_color;
background-color: $backdrop_base_color;
border-color: $backdrop_borders_color;
}
@@ -3909,15 +3992,31 @@ messagedialog { // Message Dialog styling
border-right-style: none;
border-bottom-style: none;
&:first-child{
&:first-child:not(:only-child) {
border-left-style: none;
border-bottom-left-radius: 7px;
-gtk-outline-bottom-left-radius: 5px;
border-bottom-left-radius: $button_radius + 2;
-gtk-outline-bottom-left-radius: $button_radius + 2;
-gtk-outline-top-left-radius: 0px;
-gtk-outline-top-right-radius: 0px;
-gtk-outline-bottom-right-radius: 0px;
}
&:last-child {
border-bottom-right-radius: 7px;
-gtk-outline-bottom-right-radius: 5px;
&:last-child:not(:only-child) {
border-bottom-right-radius: $button_radius + 2;
-gtk-outline-bottom-right-radius: $button_radius + 2;
-gtk-outline-top-right-radius: 0px;
-gtk-outline-bottom-left-radius: 0px;
-gtk-outline-top-left-radius: 0px;
}
&:only-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
border-bottom-left-radius: $button_radius + 2;
border-bottom-right-radius: $button_radius + 2;
-gtk-outline-top-right-radius: 0px;
-gtk-outline-top-left-radius: 0px;
-gtk-outline-bottom-left-radius: $button_radius + 2;
-gtk-outline-bottom-right-radius: $button_radius + 2;
}
}
}
@@ -4058,9 +4157,9 @@ placessidebar {
}
@at-root button.sidebar-button {
@extend %button_basic.flat;
@extend %button_basic_flat;
@extend %button_selected.flat;
@extend %button_selected_flat;
min-height: 26px;
min-width: 26px;
@@ -4197,6 +4296,12 @@ paned {
infobar {
border-style: none;
&.action:hover > revealer > box {
background-color: if($variant == 'light', desaturate(lighten(invert($selected_bg_color), 47%), 30%),
desaturate(darken(invert($selected_bg_color),42%), 70%));
border-bottom: 1px solid lighten($borders_color, 5%);
}
&.info,
&.question,
&.warning,
@@ -4535,7 +4640,7 @@ decoration {
button.titlebutton {
@extend %button_basic;
@extend %button_basic.flat;
@extend %button_basic_flat;
@include _button_text_shadow;
@@ -4548,7 +4653,7 @@ button.titlebutton {
}
.selection-mode & {
@extend %button.flat.suggested-action;
@extend %selection_mode_button_flat;
@extend %nobg_selected_items;
}
@@ -4565,7 +4670,6 @@ headerbar.selection-mode button.titlebutton,
&:backdrop { -gtk-icon-shadow: none; }
}
// catch all extend :)
%selected_items {
@@ -4574,8 +4678,10 @@ headerbar.selection-mode button.titlebutton,
@at-root %nobg_selected_items, & {
color: $selected_fg_color;
@at-root %selected_items_disabled,
&:disabled { color: mix($selected_fg_color, $selected_bg_color, 50%); }
@at-root %selected_items_backdrop,
&:backdrop {
color: $backdrop_selected_fg_color;
@@ -4688,7 +4794,12 @@ stackswitcher button.text-button.circular { // FIXME aggregate with buttons
* Emoji *
********/
popover.emoji-picker { padding-left: 0; padding-right: 0; }
popover.emoji-picker {
padding-left: 0;
padding-right: 0;
entry.search { margin: 3px 5px 5px 5px; }
}
button.emoji-section {
border-color: transparent;
@@ -4708,8 +4819,11 @@ button.emoji-section {
outline-offset: -5px;
&:first-child { margin-left: 7px; }
&:last-child { margin-right: 7px; }
&:backdrop:not(:checked) { border-color: transparent; }
&:hover { border-color: $borders_color; }
&:hover { border-color: if($variant == 'light', $borders_color, transparentize($fg_color, .9)); }
&:checked { border-color: $selected_bg_color; }
label {
@@ -4725,10 +4839,10 @@ button.emoji-section {
popover.emoji-picker .emoji {
font-size: x-large;
padding: 6px;
border-radius: 6px;
:hover {
background: $selected_bg_color;
border-radius: 6px;
}
}
+56 -12
View File
@@ -285,8 +285,7 @@
//
$_bg: if($c != $bg_color, mix($c, $base_color, 85%), $insensitive_bg_color);
label, & { color: if($tc != $fg_color, mix($tc, $_bg, 50%), $insensitive_fg_color); }
color: if($tc != $fg_color, mix($tc, $_bg, 50%), $insensitive_fg_color);
border-color: if($c != $bg_color, _border_color($c), $insensitive_borders_color);
$button_fill: image($_bg) !global;
background-image: $button_fill;
@@ -304,8 +303,7 @@
$_bg: if($variant == 'light', darken(mix($c, $base_color, 85%), 8%), darken(mix($c, $base_color, 85%), 6%));
$_bc: if($c != $bg_color, _border_color($c), $insensitive_borders_color);
label, & { color: if($c != $bg_color, mix($tc, $_bg, 60%), $insensitive_fg_color); }
color: if($c != $bg_color, mix($tc, $_bg, 60%), $insensitive_fg_color);
border-color: $_bc;
$button_fill: image($_bg) !global;
background-image: $button_fill;
@@ -321,8 +319,7 @@
$_bg: if($c != $bg_color, $c, $backdrop_bg_color);
$_bc: if($variant == 'light', $c, _border_color($c));
label, & { color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color); }
color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
$button_fill: image($_bg) !global;
background-image: $button_fill;
@@ -338,8 +335,7 @@
$_bg: if($variant == 'light', darken(mix($c, $base_color, 85%), 8%), darken(mix($c, $base_color, 85%), 4%));
$_bc: if($variant == 'light', $_bg ,_border_color($c));
label, & { color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color); }
color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
$button_fill: image($_bg) !global;
background-image: $button_fill;
@@ -354,8 +350,7 @@
$_bg: if($c != $bg_color, mix($c, $base_color, 85%), $insensitive_bg_color);
$_bc: if($variant == 'light', $_bg,_border_color($c));
label, & { color: if($c != $bg_color, mix($tc, $_bg, 35%), $backdrop_insensitive_color); }
color: if($c != $bg_color, mix($tc, $_bg, 35%), $backdrop_insensitive_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
$button_fill: image($_bg) !global;
background-image: $button_fill;
@@ -374,8 +369,7 @@
$_bg: if($variant == 'light', darken(mix($c, $base_color, 85%), 8%), darken(mix($c, $base_color, 85%), 4%));
$_bc: if($variant == 'light', $_bg, _border_color($c));
label { color: if($c != $bg_color, mix($tc, $_bg, 35%), $backdrop_insensitive_color); }
color: if($c != $bg_color, mix($tc, $_bg, 35%), $backdrop_insensitive_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
$button_fill: image($_bg) !global;
background-image: $button_fill;
@@ -581,4 +575,54 @@
box-shadow: none; //
}
/***************************
* Check and Radio buttons *
***************************/
@mixin check($t, $c:$bg_color, $tc:$fg_color, $checked: false) {
// Check/Radio drawing function
//
// $t: check/radio type,
// $c: base button color for colored* types
// $tc: optional text color for colored* types
// $checked: bool to chose between checked/unchecked
//
// possible $t values:
// normal, hover, active, insensitive, backdrop, backdrop-insensitive
$_border_color: if($c==$checkradio_bg_color, $c, $alt_borders_color);
$_dim_border_color: transparentize($_border_color, if($variant == 'light', 0.3, 0.7));
@if $t==normal {
background-clip: if($checked, border-box, padding-box);
background-image: linear-gradient(to bottom, lighten($c, 5%) 20%, $c 90%);
border-color: $_border_color;
box-shadow: 0 1px transparentize(black, 0.95);
color: $tc;
}
@if $t==hover {
background-image: if($c == white, image(darken($c, 5%)), linear-gradient(to bottom, lighten($c, 9%) 10%, lighten($c, 4%) 90%));
}
@if $t==active {
box-shadow: inset 0 1px 1px 0px if($variant == 'light', rgba(0, 0, 0, 0.2), black);
}
@if $t==insensitive {
box-shadow: none;
color: transparentize($tc, 0.3);
}
@if $t==backdrop {
background-image: image($c);
box-shadow: none;
color: $tc;
}
@if $t==backdrop-insensitive {
box-shadow: none;
color: transparentize($tc, 0.3);
}
}
+13 -13
View File
@@ -17,7 +17,7 @@
height="14"
id="svg7384"
version="1.1"
inkscape:version="0.91 r13725"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
width="14">
<metadata
id="metadata90">
@@ -37,8 +37,8 @@
bordercolor="#666666"
borderopacity="1"
inkscape:current-layer="layer9"
inkscape:cx="9.6493349"
inkscape:cy="5.5864571"
inkscape:cx="6.1684486"
inkscape:cy="5.9327595"
gridtolerance="10"
inkscape:guide-bbox="true"
guidetolerance="10"
@@ -47,10 +47,10 @@
inkscape:object-paths="false"
objecttolerance="10"
pagecolor="#3a3b39"
inkscape:pageopacity="1"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
showborder="true"
showgrid="false"
showgrid="true"
showguides="true"
inkscape:snap-bbox="true"
inkscape:snap-bbox-midpoints="false"
@@ -59,12 +59,12 @@
inkscape:snap-nodes="false"
inkscape:snap-others="false"
inkscape:snap-to-guides="true"
inkscape:window-height="1016"
inkscape:window-height="1376"
inkscape:window-maximized="1"
inkscape:window-width="1920"
inkscape:window-width="3440"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:zoom="22.005438"
inkscape:window-y="639"
inkscape:zoom="62.240778"
inkscape:showpageshadow="false">
<inkscape:grid
dotted="false"
@@ -74,8 +74,8 @@
originx="-139.99995"
originy="120"
snapvisiblegridlinesonly="true"
spacingx="1px"
spacingy="1px"
spacingx="1"
spacingy="1"
type="xygrid"
visible="true" />
</sodipodi:namedview>
@@ -101,10 +101,10 @@
transform="translate(-381.00015,-339)">
<path
inkscape:connector-curvature="0"
d="m 388.00015,343.01754 c -1.64587,0 -2.98246,1.33658 -2.98246,2.98246 0,1.64587 1.33659,2.98246 2.98246,2.98246 1.64587,0 2.98246,-1.33659 2.98246,-2.98246 0,-1.64588 -1.33659,-2.98246 -2.98246,-2.98246 z"
d="m 388.00015,341.99995 c -2.20743,0 -4.00005,1.79261 -4.00005,4.00005 0,2.20743 1.79262,4.00005 4.00005,4.00005 2.20743,0 4.00005,-1.79262 4.00005,-4.00005 0,-2.20744 -1.79262,-4.00005 -4.00005,-4.00005 z"
id="path9555"
sodipodi:nodetypes="csssc"
style="color:#bebebe;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:'Andale Mono';text-indent:0pt;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78125;marker:none" />
style="color:#bebebe;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:'Andale Mono';text-indent:0pt;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.38899732;marker:none" />
</g>
<g
inkscape:groupmode="layer"

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 B

After

Width:  |  Height:  |  Size: 165 B

+20 -19
View File
@@ -11,13 +11,13 @@
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="check-symbolic.svg"
inkscape:export-filename="/home/sam/dev/RESOURCES/gnome-icon-theme-symbolic/src/gnome-stencils.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
inkscape:export-filename="/home/jimmac/Projects/gtk/gtk/theme/Adwaita/assets/check@2-symbolic.symbolic.png"
inkscape:export-xdpi="192"
inkscape:export-ydpi="192"
height="14"
id="svg7384"
version="1.1"
inkscape:version="0.91 r13725"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
width="14">
<metadata
id="metadata90">
@@ -37,8 +37,8 @@
bordercolor="#666666"
borderopacity="1"
inkscape:current-layer="layer9"
inkscape:cx="-15.966869"
inkscape:cy="8.8415069"
inkscape:cx="7.0525573"
inkscape:cy="8.5476141"
gridtolerance="10"
inkscape:guide-bbox="true"
guidetolerance="10"
@@ -47,10 +47,10 @@
inkscape:object-paths="false"
objecttolerance="10"
pagecolor="#3a3b39"
inkscape:pageopacity="1"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
showborder="true"
showgrid="false"
showgrid="true"
showguides="true"
inkscape:snap-bbox="true"
inkscape:snap-bbox-midpoints="false"
@@ -59,12 +59,12 @@
inkscape:snap-nodes="false"
inkscape:snap-others="false"
inkscape:snap-to-guides="true"
inkscape:window-height="1016"
inkscape:window-maximized="1"
inkscape:window-width="1920"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:zoom="15.238496"
inkscape:window-height="791"
inkscape:window-maximized="0"
inkscape:window-width="1611"
inkscape:window-x="1011"
inkscape:window-y="1032"
inkscape:zoom="1"
inkscape:showpageshadow="false">
<inkscape:grid
dotted="false"
@@ -74,8 +74,8 @@
originx="-159.99995"
originy="120"
snapvisiblegridlinesonly="true"
spacingx="1px"
spacingy="1px"
spacingx="1"
spacingy="1"
type="xygrid"
visible="true" />
</sodipodi:namedview>
@@ -100,10 +100,11 @@
style="display:inline;opacity:1"
transform="translate(-401.00015,-339)">
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:3;marker:none;enable-background:accumulate"
d="m 415.00015,339.98047 -6.5,6.39453 -2.9375,-2.9375 -2.125,2.125 5.0625,5.0625 6.5,-6.60547 0,-4.03906 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:3;marker:none;enable-background:accumulate"
d="m 411.89132,341.94772 -4.39702,4.34915 -3.3125,-3.1875 -2.39063,2.45313 5.21718,5.46025 6.77589,-7.31969 c 1.13568,-1.31246 -0.63533,-3.01292 -1.89292,-1.75534 z"
id="path8913-6-7-1-5-1"
inkscape:connector-curvature="0" />
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
</g>
<g
inkscape:groupmode="layer"

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 246 B

Some files were not shown because too many files have changed in this diff Show More