forked from AuroraMiddleware/gtk
Compare commits
149 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
770e5460d2 | ||
|
2c5784977a | ||
|
6c88cc7215 | ||
|
ea1bb79566 | ||
|
d0e3dc7ce0 | ||
|
fec951c2b2 | ||
|
d84dab39b9 | ||
|
40ff1f442b | ||
|
c8b4f0c8e8 | ||
|
52f7afeecd | ||
|
370ab8aa52 | ||
|
08479ae4b2 | ||
|
45d6ffcce8 | ||
|
f3b09a8725 | ||
|
d6d5a22306 | ||
|
512dec54d3 | ||
|
5cf5b9c7f5 | ||
|
c4ddf47d8f | ||
|
fb36c167e1 | ||
|
d221d314b5 | ||
|
069fef6f99 | ||
|
5caecf16ac | ||
|
8203b69e74 | ||
|
189c1dd306 | ||
|
a4512a4c95 | ||
|
ce01d7d7a3 | ||
|
a4758db75e | ||
|
6a991cf05a | ||
|
0c83807a5a | ||
|
254eca269a | ||
|
a59bf6e3cc | ||
|
b06294d5d7 | ||
|
3f9b7dd863 | ||
|
3b36459630 | ||
|
5c4f3a1943 | ||
|
b53bd5b670 | ||
|
6257243574 | ||
|
e18e99209e | ||
|
8e9e32abaf | ||
|
f4768f16c8 | ||
|
790b9d59ad | ||
|
37843ec941 | ||
|
1ef03e6eb8 | ||
|
1ff3a26c96 | ||
|
92ebf8ab13 | ||
|
7169d346ec | ||
|
162b061ad2 | ||
|
83284e6a9d | ||
|
4a38d5d1d5 | ||
|
a87b3f63ec | ||
|
66091f8139 | ||
|
46eebcb2ac | ||
|
1e27563425 | ||
|
2aaefd9ff6 | ||
|
826030dcc2 | ||
|
748b68d58b | ||
|
74ed1b9e35 | ||
|
793831af8a | ||
|
d51734d83b | ||
|
40ed5ed494 | ||
|
9b75292a63 | ||
|
db5543e83b | ||
|
5844ecf381 | ||
|
afaeadcf67 | ||
|
14823c6bd6 | ||
|
a2d95db723 | ||
|
ecbfccfc55 | ||
|
ef6f9cd7c6 | ||
|
9df10fa96f | ||
|
779f8063d3 | ||
|
24508e07f0 | ||
|
dcc0da218a | ||
|
70cb06abcd | ||
|
1f40e88153 | ||
|
93df6447fa | ||
|
1e60aa122a | ||
|
cee282a282 | ||
|
19aa79d511 | ||
|
55d8469fde | ||
|
8d4a14e082 | ||
|
3ab28f8f8e | ||
|
55dd442955 | ||
|
9f4baac5a2 | ||
|
0dbf91123d | ||
|
4733352ce3 | ||
|
aabae92482 | ||
|
b2380a21ef | ||
|
573204987c | ||
|
2f84859847 | ||
|
f4abf696f2 | ||
|
dc59b1c588 | ||
|
88c6c55d3a | ||
|
c7185c65c9 | ||
|
d758ea2e5e | ||
|
4a04cf610e | ||
|
9252b88c23 | ||
|
b2356dbe7b | ||
|
5186430d9d | ||
|
272e354d57 | ||
|
b17ccd13e6 | ||
|
b061d413e4 | ||
|
3ec2526776 | ||
|
e50fbb6c86 | ||
|
753c6f2435 | ||
|
cc5ba83eba | ||
|
3b940b12f6 | ||
|
205783d9b0 | ||
|
873c304a94 | ||
|
e551a9d1c4 | ||
|
824ff01eee | ||
|
9b74027dea | ||
|
5b98e171b2 | ||
|
f7d4a52ec3 | ||
|
1e5b47c7ef | ||
|
953c2ec3ae | ||
|
ff8aadba7b | ||
|
381c056070 | ||
|
f70c3548e1 | ||
|
5863ddbfdd | ||
|
c1c1daba40 | ||
|
339b9eb1b9 | ||
|
f569318d6f | ||
|
c5beeddff0 | ||
|
81b8426360 | ||
|
bb61b5fb5b | ||
|
b760f57ae1 | ||
|
070926a4cc | ||
|
7a183681b1 | ||
|
14c7a001a6 | ||
|
bcad03da6c | ||
|
5d9576abb9 | ||
|
b86c91de1d | ||
|
a0d85f36ab | ||
|
8455b9ac74 | ||
|
e87801f7e6 | ||
|
a4df9f3d09 | ||
|
f2ccb4192e | ||
|
b71b7ea47f | ||
|
ec9f9d9e96 | ||
|
52dd917c6a | ||
|
8070cfd173 | ||
|
47b7988ccb | ||
|
79eab08797 | ||
|
2ca2a15637 | ||
|
82ca302ec4 | ||
|
6387863256 | ||
|
8c24e1467d | ||
|
e7984a84cb | ||
|
a66b3caa1a |
@ -26,7 +26,7 @@ variables:
|
||||
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
|
||||
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled"
|
||||
MESON_TEST_TIMEOUT_MULTIPLIER: 3
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v38"
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v39"
|
||||
FLATPAK_IMAGE: "quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master"
|
||||
|
||||
.only-default:
|
||||
@ -80,9 +80,12 @@ fedora-x86_64:
|
||||
needs: []
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
|
||||
before_script:
|
||||
- PATH="/home/user/.local/bin:$PATH"
|
||||
script:
|
||||
- .gitlab-ci/show-info-linux.sh
|
||||
- meson subprojects update
|
||||
- pip3 install --user meson~=0.64
|
||||
- meson subprojects update --reset
|
||||
- mkdir _install
|
||||
- meson --prefix=${CI_PROJECT_DIR}/_install
|
||||
${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
|
||||
@ -102,9 +105,14 @@ release-build:
|
||||
needs: []
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=release"
|
||||
before_script:
|
||||
- PATH="/home/user/.local/bin:$PATH"
|
||||
script:
|
||||
- .gitlab-ci/show-info-linux.sh
|
||||
- meson subprojects update
|
||||
- pip3 install --user meson~=0.64
|
||||
- rm -rf subprojects/glib
|
||||
- meson subprojects download glib
|
||||
- meson subprojects update --reset
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
|
||||
_build
|
||||
- ninja -C _build
|
||||
@ -126,9 +134,11 @@ fedora-mingw64:
|
||||
mingw64-libepoxy
|
||||
mingw64-pango
|
||||
# mingw64-graphene (rawhide)
|
||||
- PATH="/home/user/.local/bin:$PATH"
|
||||
script:
|
||||
- .gitlab-ci/show-info-linux.sh
|
||||
- meson subprojects update
|
||||
- pip3 install --user meson~=0.64
|
||||
- meson subprojects update --reset
|
||||
- mkdir _build && cd _build
|
||||
- mingw64-meson -Dintrospection=disabled -Dgraphene:introspection=disabled
|
||||
- ninja
|
||||
@ -140,9 +150,12 @@ installed-tests:
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--prefix=/usr --libdir=/usr/lib64 -Dinstall-tests=true"
|
||||
G_TEST_ACCESSIBLE: 1
|
||||
before_script:
|
||||
- PATH="/home/user/.local/bin:$PATH"
|
||||
script:
|
||||
- .gitlab-ci/show-info-linux.sh
|
||||
- meson subprojects update
|
||||
- pip3 install --user meson~=0.64
|
||||
- meson subprojects update --reset
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
|
||||
_build
|
||||
- ninja -C _build
|
||||
@ -197,7 +210,7 @@ macos:
|
||||
needs: []
|
||||
before_script:
|
||||
- bash .gitlab-ci/show-info-osx.sh
|
||||
- pip3 install --user meson==0.60.3
|
||||
- pip3 install --user meson~=0.64
|
||||
- pip3 install --user ninja
|
||||
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
|
||||
- export MESON_FORCE_BACKTRACE=1
|
||||
@ -334,6 +347,8 @@ static-scan:
|
||||
needs: []
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=debug"
|
||||
before_script:
|
||||
- PATH="/home/user/.local/bin:$PATH"
|
||||
script:
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _scan_build
|
||||
- ninja -C _scan_build scan-build
|
||||
@ -350,6 +365,8 @@ asan-build:
|
||||
stage: analysis
|
||||
needs: []
|
||||
variables:
|
||||
before_script:
|
||||
- PATH="/home/user/.local/bin:$PATH"
|
||||
script:
|
||||
- CC=clang meson --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=disabled _build
|
||||
- ninja -C _build
|
||||
@ -365,7 +382,10 @@ reference:
|
||||
needs: []
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=release --force-fallback-for=gdk-pixbuf,pango"
|
||||
before_script:
|
||||
- PATH="/home/user/.local/bin:$PATH"
|
||||
script:
|
||||
- pip3 install --user meson~=0.64
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} -Dgtk_doc=true -Dgdk-pixbuf:gtk_doc=true -Dpango:gtk_doc=true _build
|
||||
- meson compile -C _build
|
||||
- mkdir -p _reference/
|
||||
|
106
NEWS
106
NEWS
@ -1,3 +1,109 @@
|
||||
Overview of Changes in 4.8.4, xx-xx-xxxx
|
||||
========================================
|
||||
|
||||
Overview of Changes in 4.8.3, 22-12-2022
|
||||
========================================
|
||||
|
||||
* GtkText:
|
||||
- Claim gestures more selectively
|
||||
- Prevent unexpected notify::direction emissions
|
||||
|
||||
* Accessibility:
|
||||
- Remember if we don't find the a11y bus
|
||||
|
||||
* DND:
|
||||
- Prefer file:// urls over other protocols
|
||||
|
||||
* GtkMountOperation:
|
||||
- Work on Wayland
|
||||
|
||||
* GtkListView:
|
||||
- Cancel rubberband if not handling drag
|
||||
|
||||
* Wayland:
|
||||
- Fix button masks
|
||||
|
||||
* Windows:
|
||||
- Fix resizes with native decorations
|
||||
|
||||
* X11:
|
||||
- Fix some ordering problems with surface destruction
|
||||
|
||||
* Translation updates
|
||||
Abkhazian
|
||||
Basque
|
||||
Dutch
|
||||
Hungarian
|
||||
Interlingue
|
||||
Georgian
|
||||
Persian
|
||||
Russian
|
||||
Spanish
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in 4.8.2, 24-10-2022
|
||||
========================================
|
||||
|
||||
* Input:
|
||||
- Give input methods more control over resets and allow
|
||||
them to preserve state
|
||||
- Align interpretation of modifiers in key events
|
||||
in X11 and Wayland
|
||||
|
||||
* GtkColumnView:
|
||||
- Fixes to focus handling
|
||||
|
||||
* GtkPopover:
|
||||
- Fix problems with focus when dismissing popovers
|
||||
- Fix problems with focusing editable labels in popovers
|
||||
|
||||
* Build:
|
||||
- Fix build problems with resources and non-gnu linkers
|
||||
- Fix gi-docgen detection in cross builds
|
||||
- Require meson 0.60
|
||||
|
||||
* Debugging:
|
||||
- Make more debug options available in no-debug builds
|
||||
- Improve consistency of debug logging
|
||||
- Give names to all sources
|
||||
|
||||
* Accessibility:
|
||||
- Introduce GtkAccessibleRange
|
||||
|
||||
* Wayland:
|
||||
- Make monitor bounds handling more robust
|
||||
- Prevent shrinking clients due to wrong toplevel bounds
|
||||
|
||||
* Broadway:
|
||||
- Return correct pointer coordinates from device queries
|
||||
|
||||
* Windows:
|
||||
- Use native API to translate key events
|
||||
|
||||
* Translation updates:
|
||||
Brazilian Portuguese
|
||||
British English
|
||||
Bulgarian
|
||||
Catalan
|
||||
Croatian
|
||||
Czech
|
||||
Friulian
|
||||
Galician
|
||||
Georgian
|
||||
German
|
||||
Indonesian
|
||||
Lithuanian
|
||||
Polish
|
||||
Portuguese
|
||||
Russian
|
||||
Serbian
|
||||
Slovenian
|
||||
Swedish
|
||||
Turkish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in 4.8.1, 16-09-2022
|
||||
========================================
|
||||
|
||||
|
@ -362,7 +362,7 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
G_CALLBACK (scribble_resize), NULL);
|
||||
|
||||
drag = gtk_gesture_drag_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (drag), GDK_BUTTON_PRIMARY);
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (drag), 0);
|
||||
gtk_widget_add_controller (da, GTK_EVENT_CONTROLLER (drag));
|
||||
|
||||
g_signal_connect (drag, "drag-begin", G_CALLBACK (drag_begin), da);
|
||||
|
@ -262,7 +262,8 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
message->key.state,
|
||||
FALSE,
|
||||
&translated,
|
||||
&translated);
|
||||
&translated,
|
||||
NULL);
|
||||
|
||||
node = _gdk_event_queue_append (display, event);
|
||||
_gdk_windowing_got_event (display, node, event, message->base.serial);
|
||||
|
@ -795,6 +795,22 @@ file_serializer_finish (GObject *source,
|
||||
gdk_content_serializer_return_success (serializer);
|
||||
}
|
||||
|
||||
static char *
|
||||
file_get_native_uri (GFile *file)
|
||||
{
|
||||
char *path;
|
||||
|
||||
path = g_file_get_path (file);
|
||||
if (path != NULL)
|
||||
{
|
||||
char *uri = g_filename_to_uri (path, NULL, NULL);
|
||||
g_free (path);
|
||||
return uri;
|
||||
}
|
||||
|
||||
return g_file_get_uri (file);
|
||||
}
|
||||
|
||||
static void
|
||||
file_uri_serializer (GdkContentSerializer *serializer)
|
||||
{
|
||||
@ -811,7 +827,7 @@ file_uri_serializer (GdkContentSerializer *serializer)
|
||||
file = g_value_get_object (gdk_content_serializer_get_value (serializer));
|
||||
if (file)
|
||||
{
|
||||
uri = g_file_get_uri (file);
|
||||
uri = file_get_native_uri (file);
|
||||
g_string_append (str, uri);
|
||||
g_free (uri);
|
||||
}
|
||||
@ -827,7 +843,7 @@ file_uri_serializer (GdkContentSerializer *serializer)
|
||||
|
||||
for (l = g_value_get_boxed (value); l; l = l->next)
|
||||
{
|
||||
uri = g_file_get_uri (l->data);
|
||||
uri = file_get_native_uri (l->data);
|
||||
g_string_append (str, uri);
|
||||
g_free (uri);
|
||||
g_string_append (str, "\r\n");
|
||||
|
@ -1517,6 +1517,16 @@ gdk_button_event_get_button (GdkEvent *event)
|
||||
* An event related to a key-based device.
|
||||
*/
|
||||
|
||||
static void
|
||||
gdk_key_event_finalize (GdkEvent *event)
|
||||
{
|
||||
GdkKeyEvent *self = (GdkKeyEvent *) event;
|
||||
|
||||
g_free (self->compose_sequence);
|
||||
|
||||
GDK_EVENT_SUPER (event)->finalize (event);
|
||||
}
|
||||
|
||||
static GdkModifierType
|
||||
gdk_key_event_get_state (GdkEvent *event)
|
||||
{
|
||||
@ -1528,7 +1538,7 @@ gdk_key_event_get_state (GdkEvent *event)
|
||||
static const GdkEventTypeInfo gdk_key_event_info = {
|
||||
sizeof (GdkKeyEvent),
|
||||
NULL,
|
||||
NULL,
|
||||
gdk_key_event_finalize,
|
||||
gdk_key_event_get_state,
|
||||
NULL,
|
||||
NULL,
|
||||
@ -1552,6 +1562,10 @@ GDK_DEFINE_EVENT_TYPE (GdkKeyEvent, gdk_key_event,
|
||||
* @is_modifier: whether the event is a modifiers only event
|
||||
* @translated: the translated key data for the given @state
|
||||
* @no_lock: the translated key data without the given @state
|
||||
* @compose_sequence: (transfer none) (nullable):
|
||||
* The compose sequence string, either partial or only the
|
||||
* final composed string, if that can be determined at event
|
||||
* creation time. Used by selected IM modules.
|
||||
*
|
||||
* Creates a new `GdkKeyEvent`.
|
||||
*
|
||||
@ -1566,7 +1580,8 @@ gdk_key_event_new (GdkEventType type,
|
||||
GdkModifierType state,
|
||||
gboolean is_modifier,
|
||||
GdkTranslatedKey *translated,
|
||||
GdkTranslatedKey *no_lock)
|
||||
GdkTranslatedKey *no_lock,
|
||||
char *compose_sequence)
|
||||
{
|
||||
g_return_val_if_fail (type == GDK_KEY_PRESS ||
|
||||
type == GDK_KEY_RELEASE, NULL);
|
||||
@ -1579,6 +1594,7 @@ gdk_key_event_new (GdkEventType type,
|
||||
self->key_is_modifier = is_modifier;
|
||||
self->translated[0] = *translated;
|
||||
self->translated[1] = *no_lock;
|
||||
self->compose_sequence = g_strdup (compose_sequence);
|
||||
|
||||
return event;
|
||||
}
|
||||
@ -1609,6 +1625,26 @@ gdk_key_event_get_translated_key (GdkEvent *event,
|
||||
return &(self->translated[0]);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gdk_key_event_get_compose_sequence:
|
||||
* @event: (type GdkKeyEvent): a key event
|
||||
*
|
||||
* Extracts the compose sequence string from a key event.
|
||||
*
|
||||
* Returns: (transfer none): the compose sequence string
|
||||
*/
|
||||
char *
|
||||
gdk_key_event_get_compose_sequence (GdkEvent *event)
|
||||
{
|
||||
GdkKeyEvent *self = (GdkKeyEvent *) event;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_EVENT (event), 0);
|
||||
g_return_val_if_fail (GDK_IS_EVENT_TYPE (event, GDK_KEY_PRESS) ||
|
||||
GDK_IS_EVENT_TYPE (event, GDK_KEY_RELEASE), FALSE);
|
||||
|
||||
return self->compose_sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_key_event_get_keyval:
|
||||
* @event: (type GdkKeyEvent): a key event
|
||||
|
@ -259,6 +259,9 @@ typedef struct {
|
||||
* @keycode: the raw code of the key that was pressed or released.
|
||||
* @translated: the result of translating @keycode. First with the full
|
||||
* @state, then while ignoring Caps Lock.
|
||||
* @compose_sequence: optional string for use by selected IM modules.
|
||||
* Contains either partial compose sequences or the final composed
|
||||
* string of the keystroke sequence.
|
||||
*
|
||||
* Describes a key press or key release event.
|
||||
*/
|
||||
@ -270,6 +273,7 @@ struct _GdkKeyEvent
|
||||
guint32 keycode;
|
||||
gboolean key_is_modifier;
|
||||
GdkTranslatedKey translated[2];
|
||||
char *compose_sequence;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -470,7 +474,8 @@ GdkEvent * gdk_key_event_new (GdkEventType type,
|
||||
GdkModifierType modifiers,
|
||||
gboolean is_modifier,
|
||||
GdkTranslatedKey *translated,
|
||||
GdkTranslatedKey *no_lock);
|
||||
GdkTranslatedKey *no_lock,
|
||||
char *compose_sequence);
|
||||
|
||||
GdkEvent * gdk_focus_event_new (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
@ -597,6 +602,8 @@ GdkEvent * gdk_grab_broken_event_new (GdkSurface *surface,
|
||||
GdkTranslatedKey * gdk_key_event_get_translated_key (GdkEvent *event,
|
||||
gboolean no_lock);
|
||||
|
||||
char * gdk_key_event_get_compose_sequence (GdkEvent *event);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/* Following flag is set for events on the event queue during
|
||||
@ -626,7 +633,6 @@ void _gdk_event_queue_flush (GdkDisplay *display);
|
||||
|
||||
double * gdk_event_dup_axes (GdkEvent *event);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_EVENTS_PRIVATE_H__ */
|
||||
|
@ -2789,9 +2789,10 @@ check_autohide (GdkEvent *event)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkDevice *device;
|
||||
GdkSurface *grab_surface;
|
||||
GdkSurface *grab_surface, *event_surface;
|
||||
GdkEventType evtype = gdk_event_get_event_type (event);
|
||||
|
||||
switch ((guint) gdk_event_get_event_type (event))
|
||||
switch ((guint) evtype)
|
||||
{
|
||||
case GDK_BUTTON_PRESS:
|
||||
#if 0
|
||||
@ -2800,23 +2801,25 @@ check_autohide (GdkEvent *event)
|
||||
// grabs, it will be delivered to the same place as the
|
||||
// press, and will cause the auto dismissal to be triggered.
|
||||
case GDK_BUTTON_RELEASE:
|
||||
#endif
|
||||
case GDK_TOUCH_BEGIN:
|
||||
case GDK_TOUCH_END:
|
||||
case GDK_TOUCH_CANCEL:
|
||||
#endif
|
||||
case GDK_TOUCH_BEGIN:
|
||||
case GDK_TOUCHPAD_SWIPE:
|
||||
case GDK_TOUCHPAD_PINCH:
|
||||
display = gdk_event_get_display (event);
|
||||
device = gdk_event_get_device (event);
|
||||
if (gdk_device_grab_info (display, device, &grab_surface, NULL))
|
||||
{
|
||||
GdkSurface *event_surface;
|
||||
|
||||
event_surface = gdk_event_get_surface (event);
|
||||
if (event_surface->autohide &&
|
||||
!event_surface->has_pointer)
|
||||
event_surface = NULL;
|
||||
|
||||
if (grab_surface != event_surface &&
|
||||
grab_surface != event_surface->parent &&
|
||||
grab_surface->autohide)
|
||||
if (grab_surface->autohide &&
|
||||
(!event_surface ||
|
||||
(grab_surface != event_surface &&
|
||||
grab_surface != event_surface->parent)))
|
||||
{
|
||||
GdkSurface *surface = grab_surface;
|
||||
|
||||
@ -2831,6 +2834,13 @@ check_autohide (GdkEvent *event)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GDK_ENTER_NOTIFY:
|
||||
case GDK_LEAVE_NOTIFY:
|
||||
event_surface = gdk_event_get_surface (event);
|
||||
if (event_surface->autohide &&
|
||||
gdk_crossing_event_get_mode (event) == GDK_CROSSING_NORMAL)
|
||||
event_surface->has_pointer = evtype == GDK_ENTER_NOTIFY;
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
|
||||
|
@ -77,6 +77,7 @@ struct _GdkSurface
|
||||
guint autohide : 1;
|
||||
guint shortcuts_inhibited : 1;
|
||||
guint request_motion : 1;
|
||||
guint has_pointer : 1;
|
||||
|
||||
guint request_motion_id;
|
||||
|
||||
|
@ -32,6 +32,9 @@ G_DEFINE_POINTER_TYPE (GdkToplevelSize, gdk_toplevel_size)
|
||||
#define UNCONFIGURED_WIDTH 400
|
||||
#define UNCONFIGURED_HEIGHT 300
|
||||
|
||||
#define DEFAULT_BOUNDS_WIDTH INT_MAX
|
||||
#define DEFAULT_BOUNDS_HEIGHT INT_MAX
|
||||
|
||||
void
|
||||
gdk_toplevel_size_init (GdkToplevelSize *size,
|
||||
int bounds_width,
|
||||
@ -68,8 +71,15 @@ gdk_toplevel_size_get_bounds (GdkToplevelSize *size,
|
||||
g_return_if_fail (bounds_width);
|
||||
g_return_if_fail (bounds_height);
|
||||
|
||||
*bounds_width = size->bounds_width;
|
||||
*bounds_height = size->bounds_height;
|
||||
if (size->bounds_width > 0)
|
||||
*bounds_width = size->bounds_width;
|
||||
else
|
||||
*bounds_width = DEFAULT_BOUNDS_WIDTH;
|
||||
|
||||
if (size->bounds_height > 0)
|
||||
*bounds_height = size->bounds_height;
|
||||
else
|
||||
*bounds_height = DEFAULT_BOUNDS_HEIGHT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -94,7 +94,7 @@ gdk_vulkan_strerror (VkResult result)
|
||||
* Because the Vulkan people don't make adding this too easy, here's
|
||||
* the process to manage it:
|
||||
* 1. go to
|
||||
* https://github.com/KhronosGroup/Vulkan-Headers/blob/master/include/vulkan/vulkan_core.h
|
||||
* https://github.com/KhronosGroup/Vulkan-Headers/blob/main/include/vulkan/vulkan_core.h
|
||||
* 2. Find the line where this enum value was added.
|
||||
* 3. Click the commit that added this line.
|
||||
* 4. The commit you're looking at now should also change
|
||||
@ -215,6 +215,10 @@ gdk_vulkan_strerror (VkResult result)
|
||||
case VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT:
|
||||
return "A requested pipeline creation would have required compilation, but the application requested compilation to not be performed. (VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT)";
|
||||
#endif
|
||||
#if VK_HEADER_VERSION >= 213
|
||||
case VK_ERROR_COMPRESSION_EXHAUSTED_EXT:
|
||||
return "An image creation failed because internal resources required for compression are exhausted. (VK_ERROR_COMPRESSION_EXHAUSTED_EXT)";
|
||||
#endif
|
||||
#if VK_HEADER_VERSION < 140
|
||||
case VK_RESULT_RANGE_SIZE:
|
||||
#endif
|
||||
@ -488,7 +492,7 @@ gdk_vulkan_context_end_frame (GdkDrawContext *draw_context,
|
||||
priv->draw_semaphore
|
||||
},
|
||||
.swapchainCount = 1,
|
||||
.pSwapchains = (VkSwapchainKHR[]) {
|
||||
.pSwapchains = (VkSwapchainKHR[]) {
|
||||
priv->swapchain
|
||||
},
|
||||
.pImageIndices = (uint32_t[]) {
|
||||
@ -608,7 +612,7 @@ gdk_vulkan_context_real_init (GInitable *initable,
|
||||
{
|
||||
g_set_error_literal (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
|
||||
"No supported image format found.");
|
||||
goto out_surface;
|
||||
goto out_surface;
|
||||
}
|
||||
priv->image_format = formats[i];
|
||||
priv->has_present_region = device_supports_incremental_present (display->vk_physical_device);
|
||||
@ -1037,8 +1041,8 @@ gdk_display_create_vulkan_instance (GdkDisplay *display,
|
||||
GDK_VK_CHECK (vkEnumerateInstanceExtensionProperties, NULL, &n_extensions, extensions);
|
||||
|
||||
used_extensions = g_ptr_array_new ();
|
||||
g_ptr_array_add (used_extensions, (gpointer) VK_KHR_SURFACE_EXTENSION_NAME);
|
||||
g_ptr_array_add (used_extensions, (gpointer) GDK_DISPLAY_GET_CLASS (display)->vk_extension_name);
|
||||
g_ptr_array_add (used_extensions, (gpointer) VK_KHR_SURFACE_EXTENSION_NAME);
|
||||
g_ptr_array_add (used_extensions, (gpointer) GDK_DISPLAY_GET_CLASS (display)->vk_extension_name);
|
||||
|
||||
for (i = 0; i < n_extensions; i++)
|
||||
{
|
||||
@ -1118,7 +1122,7 @@ gdk_display_create_vulkan_instance (GdkDisplay *display,
|
||||
if (have_debug_report)
|
||||
{
|
||||
PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT;
|
||||
|
||||
|
||||
vkCreateDebugReportCallbackEXT = (PFN_vkCreateDebugReportCallbackEXT) vkGetInstanceProcAddr (display->vk_instance, "vkCreateDebugReportCallbackEXT" );
|
||||
GDK_VK_CHECK (vkCreateDebugReportCallbackEXT, display->vk_instance,
|
||||
&(VkDebugReportCallbackCreateInfoEXT) {
|
||||
@ -1167,7 +1171,7 @@ gdk_display_ref_vulkan (GdkDisplay *display,
|
||||
}
|
||||
|
||||
display->vulkan_refcount++;
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1180,7 +1184,7 @@ gdk_display_unref_vulkan (GdkDisplay *display)
|
||||
display->vulkan_refcount--;
|
||||
if (display->vulkan_refcount > 0)
|
||||
return;
|
||||
|
||||
|
||||
vkDestroyDevice (display->vk_device, NULL);
|
||||
display->vk_device = VK_NULL_HANDLE;
|
||||
if (display->vk_debug_callback != VK_NULL_HANDLE)
|
||||
|
@ -431,7 +431,8 @@ fill_key_event (GdkMacosDisplay *display,
|
||||
state,
|
||||
is_modifier,
|
||||
&translated,
|
||||
&no_lock);
|
||||
&no_lock,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static GdkEvent *
|
||||
|
@ -944,7 +944,8 @@ _gdk_macos_surface_synthesize_null_key (GdkMacosSurface *self)
|
||||
0,
|
||||
FALSE,
|
||||
&translated,
|
||||
&no_lock);
|
||||
&no_lock,
|
||||
NULL);
|
||||
_gdk_event_queue_append (display, event);
|
||||
}
|
||||
|
||||
|
@ -83,6 +83,10 @@
|
||||
#define BTN_STYLUS3 0x149 /* Linux 4.15 */
|
||||
#endif
|
||||
|
||||
#define ALL_BUTTONS_MASK (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | \
|
||||
GDK_BUTTON3_MASK | GDK_BUTTON4_MASK | \
|
||||
GDK_BUTTON5_MASK)
|
||||
|
||||
#define GDK_SEAT_DEBUG(seat,type,...) GDK_DISPLAY_DEBUG(gdk_seat_get_display (GDK_SEAT (seat)),type,__VA_ARGS__)
|
||||
|
||||
typedef struct _GdkWaylandDevicePad GdkWaylandDevicePad;
|
||||
@ -1716,7 +1720,19 @@ pointer_handle_button (void *data,
|
||||
|
||||
gdk_wayland_seat_set_frame_event (seat, event);
|
||||
|
||||
modifier = 1 << (8 + gdk_button - 1);
|
||||
switch (button)
|
||||
{
|
||||
case BTN_RIGHT:
|
||||
modifier = GDK_BUTTON3_MASK;
|
||||
break;
|
||||
case BTN_MIDDLE:
|
||||
modifier = GDK_BUTTON2_MASK;
|
||||
break;
|
||||
default:
|
||||
modifier = (GDK_BUTTON1_MASK << (button - BUTTON_BASE - 1)) & ALL_BUTTONS_MASK;
|
||||
break;
|
||||
}
|
||||
|
||||
if (state)
|
||||
seat->pointer_info.button_modifiers |= modifier;
|
||||
else
|
||||
@ -2205,7 +2221,8 @@ deliver_key_event (GdkWaylandSeat *seat,
|
||||
device_get_modifiers (seat->logical_pointer),
|
||||
_gdk_wayland_keymap_key_is_modifier (keymap, key),
|
||||
&translated,
|
||||
&no_lock);
|
||||
&no_lock,
|
||||
NULL);
|
||||
|
||||
_gdk_wayland_display_deliver_event (seat->display, event);
|
||||
|
||||
@ -5322,7 +5339,7 @@ gdk_wayland_device_set_selection (GdkDevice *gdk_device,
|
||||
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
|
||||
|
||||
seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (gdk_device));
|
||||
serial = _gdk_wayland_seat_get_implicit_grab_serial (GDK_SEAT (seat), NULL);
|
||||
serial = _gdk_wayland_seat_get_last_implicit_grab_serial (seat, NULL);
|
||||
wl_data_device_set_selection (seat->data_device, source, serial);
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ gdk_wayland_keymap_get_entries_for_keycode (GdkKeymap *keymap,
|
||||
{
|
||||
const xkb_keysym_t *syms;
|
||||
int num_syms;
|
||||
num_syms = xkb_keymap_key_get_syms_by_level (xkb_keymap, hardware_keycode, layout, 0, &syms);
|
||||
num_syms = xkb_keymap_key_get_syms_by_level (xkb_keymap, hardware_keycode, layout, level, &syms);
|
||||
if (keys)
|
||||
{
|
||||
(*keys)[i].keycode = hardware_keycode;
|
||||
|
@ -292,7 +292,8 @@ gdk_wayland_primary_claim (GdkClipboard *clipboard,
|
||||
}
|
||||
|
||||
seat = gdk_display_get_default_seat (GDK_DISPLAY (wdisplay));
|
||||
serial = _gdk_wayland_seat_get_implicit_grab_serial (seat, NULL);
|
||||
serial = _gdk_wayland_seat_get_last_implicit_grab_serial (GDK_WAYLAND_SEAT (seat),
|
||||
NULL);
|
||||
zwp_primary_selection_device_v1_set_selection (cb->primary_data_device,
|
||||
cb->source,
|
||||
serial);
|
||||
|
@ -1416,13 +1416,22 @@ configure_toplevel_geometry (GdkSurface *surface)
|
||||
else
|
||||
{
|
||||
GdkMonitor *monitor;
|
||||
GdkRectangle monitor_geometry;
|
||||
GListModel *monitors;
|
||||
GdkRectangle monitor_geometry, display_geometry = { 0 };
|
||||
guint i;
|
||||
|
||||
monitor = g_list_model_get_item (gdk_display_get_monitors (display), 0);
|
||||
gdk_monitor_get_geometry (monitor, &monitor_geometry);
|
||||
bounds_width = monitor_geometry.width;
|
||||
bounds_height = monitor_geometry.height;
|
||||
g_object_unref (monitor);
|
||||
monitors = gdk_display_get_monitors (display);
|
||||
|
||||
for (i = 0; i < g_list_model_get_n_items (monitors); i++)
|
||||
{
|
||||
monitor = g_list_model_get_item (monitors, i);
|
||||
gdk_monitor_get_geometry (monitor, &monitor_geometry);
|
||||
gdk_rectangle_union (&display_geometry, &monitor_geometry, &display_geometry);
|
||||
g_object_unref (monitor);
|
||||
}
|
||||
|
||||
bounds_width = display_geometry.width;
|
||||
bounds_height = display_geometry.height;
|
||||
}
|
||||
|
||||
gdk_toplevel_size_init (&size, bounds_width, bounds_height);
|
||||
|
@ -1857,7 +1857,8 @@ gdk_event_translate (MSG *msg,
|
||||
0,
|
||||
FALSE,
|
||||
&translated,
|
||||
&translated);
|
||||
&translated,
|
||||
NULL);
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
break;
|
||||
@ -1906,8 +1907,12 @@ gdk_event_translate (MSG *msg,
|
||||
GdkTranslatedKey translated;
|
||||
GdkTranslatedKey no_lock;
|
||||
BYTE key_state[256];
|
||||
wchar_t wbuf[100];
|
||||
int ccount = 0;
|
||||
GArray *translation;
|
||||
MSG msg2;
|
||||
int level = 0;
|
||||
int effective_group = 0;
|
||||
GdkModifierType consumed = 0;
|
||||
char *composed = NULL;
|
||||
|
||||
/* Ignore key messages intended for the IME */
|
||||
if (msg->wParam == VK_PROCESSKEY || in_ime_composition)
|
||||
@ -1929,34 +1934,41 @@ gdk_event_translate (MSG *msg,
|
||||
|
||||
API_CALL (GetKeyboardState, (key_state));
|
||||
|
||||
ccount = 0;
|
||||
|
||||
if (msg->wParam == VK_PACKET)
|
||||
{
|
||||
ccount = ToUnicode (VK_PACKET, HIWORD (msg->lParam), key_state, wbuf, 1, 0);
|
||||
if (ccount == 1)
|
||||
{
|
||||
if (wbuf[0] >= 0xD800 && wbuf[0] < 0xDC00)
|
||||
{
|
||||
if (msg->message == WM_KEYDOWN)
|
||||
impl->leading_surrogate_keydown = wbuf[0];
|
||||
else
|
||||
impl->leading_surrogate_keyup = wbuf[0];
|
||||
|
||||
/* don't emit an event */
|
||||
return_val = TRUE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* wait until an event is created */;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
keyval = GDK_KEY_VoidSymbol;
|
||||
keycode = msg->wParam;
|
||||
|
||||
/* Get the WinAPI translation of the WM_KEY messages to characters.
|
||||
|
||||
The WM_CHAR messages are generated by a previous call to TranslateMessage() and always
|
||||
follow directly after the corresponding WM_KEY* messages.
|
||||
There could be 0 or more WM_CHAR messages following (for example dead keys don't generate
|
||||
WM_CHAR messages - they generate WM_DEAD_CHAR instead, but we are not interested in those
|
||||
messages). */
|
||||
|
||||
translation = g_array_sized_new (FALSE, FALSE, sizeof (gunichar2), 2);
|
||||
while (PeekMessageW (&msg2, msg->hwnd, 0, 0, 0) && (msg2.message == WM_CHAR || msg2.message == WM_SYSCHAR))
|
||||
{
|
||||
/* The character is encoded in WPARAM as UTF-16. */
|
||||
gunichar2 c = msg2.wParam;
|
||||
|
||||
/* Append character to translation string. */
|
||||
g_array_append_val (translation, c);
|
||||
|
||||
/* Remove message from queue */
|
||||
GetMessageW (&msg2, msg->hwnd, 0, 0);
|
||||
}
|
||||
|
||||
if (translation->len > 0)
|
||||
composed = g_utf16_to_utf8 ((gunichar2*)translation->data,
|
||||
translation->len, NULL, NULL, NULL);
|
||||
|
||||
g_array_unref (translation);
|
||||
translation = NULL;
|
||||
|
||||
/* Ignore control sequences like Backspace */
|
||||
if (composed && g_unichar_iscntrl (g_utf8_get_char (composed)))
|
||||
g_clear_pointer (&composed, g_free);
|
||||
|
||||
if (HIWORD (msg->lParam) & KF_EXTENDED)
|
||||
{
|
||||
switch (msg->wParam)
|
||||
@ -1985,61 +1997,20 @@ gdk_event_translate (MSG *msg,
|
||||
state = build_key_event_state (key_state);
|
||||
group = get_active_group ();
|
||||
|
||||
if (msg->wParam == VK_PACKET && ccount == 1)
|
||||
{
|
||||
if (wbuf[0] >= 0xD800 && wbuf[0] < 0xDC00)
|
||||
{
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
else if (wbuf[0] >= 0xDC00 && wbuf[0] < 0xE000)
|
||||
{
|
||||
wchar_t leading;
|
||||
gdk_keymap_translate_keyboard_state ((GdkKeymap*) win32_keymap, keycode, state, group,
|
||||
&keyval, &effective_group, &level, &consumed);
|
||||
translated.keyval = keyval;
|
||||
translated.consumed = consumed;
|
||||
translated.layout = effective_group;
|
||||
translated.level = level;
|
||||
|
||||
if (msg->message == WM_KEYDOWN)
|
||||
leading = impl->leading_surrogate_keydown;
|
||||
else
|
||||
leading = impl->leading_surrogate_keyup;
|
||||
|
||||
keyval = gdk_unicode_to_keyval ((leading - 0xD800) * 0x400 + wbuf[0] - 0xDC00 + 0x10000);
|
||||
}
|
||||
else
|
||||
{
|
||||
keyval = gdk_unicode_to_keyval (wbuf[0]);
|
||||
}
|
||||
|
||||
translated.keyval = keyval;
|
||||
translated.consumed = 0;
|
||||
translated.layout = 0;
|
||||
translated.level = 0;
|
||||
|
||||
no_lock = translated;
|
||||
}
|
||||
else
|
||||
{
|
||||
int level = 0;
|
||||
int effective_group = 0;
|
||||
GdkModifierType consumed = 0;
|
||||
|
||||
gdk_keymap_translate_keyboard_state ((GdkKeymap*) win32_keymap, keycode, state, group,
|
||||
&keyval, &effective_group, &level, &consumed);
|
||||
translated.keyval = keyval;
|
||||
translated.consumed = consumed;
|
||||
translated.layout = effective_group;
|
||||
translated.level = level;
|
||||
|
||||
gdk_keymap_translate_keyboard_state ((GdkKeymap*) win32_keymap, keycode,
|
||||
state & ~GDK_LOCK_MASK, group, &keyval,
|
||||
&effective_group, &level, &consumed);
|
||||
no_lock.keyval = keyval;
|
||||
no_lock.consumed = consumed;
|
||||
no_lock.layout = effective_group;
|
||||
no_lock.level = level;
|
||||
}
|
||||
|
||||
if (msg->message == WM_KEYDOWN)
|
||||
impl->leading_surrogate_keydown = 0;
|
||||
else
|
||||
impl->leading_surrogate_keyup = 0;
|
||||
gdk_keymap_translate_keyboard_state ((GdkKeymap*) win32_keymap, keycode,
|
||||
state & ~GDK_LOCK_MASK, group, &keyval,
|
||||
&effective_group, &level, &consumed);
|
||||
no_lock.keyval = keyval;
|
||||
no_lock.consumed = consumed;
|
||||
no_lock.layout = effective_group;
|
||||
no_lock.level = level;
|
||||
|
||||
/* Only one release key event is fired when both shift keys are pressed together
|
||||
and then released. In order to send the missing event, press events for shift
|
||||
@ -2087,10 +2058,12 @@ gdk_event_translate (MSG *msg,
|
||||
state,
|
||||
is_modifier,
|
||||
&translated,
|
||||
&no_lock);
|
||||
&no_lock,
|
||||
composed);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
g_free (composed);
|
||||
return_val = TRUE;
|
||||
}
|
||||
break;
|
||||
@ -2169,7 +2142,8 @@ gdk_event_translate (MSG *msg,
|
||||
build_key_event_state (key_state),
|
||||
FALSE,
|
||||
&translated,
|
||||
&translated);
|
||||
&translated,
|
||||
NULL);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
@ -2182,7 +2156,8 @@ gdk_event_translate (MSG *msg,
|
||||
build_key_event_state (key_state),
|
||||
FALSE,
|
||||
&translated,
|
||||
&translated);
|
||||
&translated,
|
||||
NULL);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
@ -2754,22 +2729,15 @@ gdk_event_translate (MSG *msg,
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_MOUSEACTIVATE:
|
||||
{
|
||||
if (GDK_IS_DRAG_SURFACE (window))
|
||||
{
|
||||
*ret_valp = MA_NOACTIVATE;
|
||||
return_val = TRUE;
|
||||
}
|
||||
case WM_MOUSEACTIVATE:
|
||||
if (GDK_IS_DRAG_SURFACE (window) ||
|
||||
_gdk_modal_blocked (window))
|
||||
{
|
||||
*ret_valp = MA_NOACTIVATE;
|
||||
return_val = TRUE;
|
||||
}
|
||||
|
||||
if (_gdk_modal_blocked (window))
|
||||
{
|
||||
*ret_valp = MA_NOACTIVATEANDEAT;
|
||||
return_val = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case WM_POINTERACTIVATE:
|
||||
if (GDK_IS_DRAG_SURFACE (window) ||
|
||||
@ -3013,6 +2981,8 @@ gdk_event_translate (MSG *msg,
|
||||
}
|
||||
#endif
|
||||
|
||||
impl = GDK_WIN32_SURFACE (window);
|
||||
|
||||
/* Break grabs on unmap or minimize */
|
||||
if (windowpos->flags & SWP_HIDEWINDOW ||
|
||||
((windowpos->flags & SWP_STATECHANGED) && IsIconic (msg->hwnd)))
|
||||
@ -3073,9 +3043,18 @@ gdk_event_translate (MSG *msg,
|
||||
!(windowpos->flags & SWP_NOCLIENTSIZE) ||
|
||||
(windowpos->flags & SWP_SHOWWINDOW))
|
||||
{
|
||||
if (!IsIconic (msg->hwnd) &&
|
||||
!GDK_SURFACE_DESTROYED (window))
|
||||
gdk_surface_request_layout (window);
|
||||
if (!IsIconic (msg->hwnd) && !GDK_SURFACE_DESTROYED (window))
|
||||
{
|
||||
if (!_gdk_win32_surface_lacks_wm_decorations (window) &&
|
||||
!(windowpos->flags & SWP_NOCLIENTSIZE) &&
|
||||
window->width == impl->next_layout.configured_width &&
|
||||
window->height == impl->next_layout.configured_height)
|
||||
{
|
||||
impl->inhibit_configure = TRUE;
|
||||
}
|
||||
|
||||
gdk_surface_request_layout (window);
|
||||
}
|
||||
}
|
||||
|
||||
if ((windowpos->flags & SWP_HIDEWINDOW) &&
|
||||
|
@ -235,14 +235,6 @@ struct _GdkWin32Surface
|
||||
/* The cursor that GDK set for this window via GdkDevice */
|
||||
GdkWin32HCursor *cursor;
|
||||
|
||||
/* When VK_PACKET sends us a leading surrogate, it's stashed here.
|
||||
* Later, when another VK_PACKET sends a tailing surrogate, we make up
|
||||
* a full unicode character from them, or discard the leading surrogate,
|
||||
* if the next key is not a tailing surrogate.
|
||||
*/
|
||||
wchar_t leading_surrogate_keydown;
|
||||
wchar_t leading_surrogate_keyup;
|
||||
|
||||
/* Window size hints */
|
||||
int hint_flags;
|
||||
GdkGeometry hints;
|
||||
|
@ -1595,7 +1595,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
state,
|
||||
gdk_x11_keymap_key_is_modifier (keymap, xev->detail),
|
||||
&translated,
|
||||
&no_lock);
|
||||
&no_lock,
|
||||
NULL);
|
||||
|
||||
if (ev->evtype == XI_KeyPress)
|
||||
set_user_time (event);
|
||||
@ -2063,19 +2064,10 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
xev->detail != XINotifyInferior && xev->mode != XINotifyPassiveUngrab &&
|
||||
GDK_IS_TOPLEVEL (surface))
|
||||
{
|
||||
if (gdk_x11_device_xi2_get_device_type ((GdkX11DeviceXI2 *) device) != GDK_X11_DEVICE_TYPE_LOGICAL)
|
||||
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device));
|
||||
else
|
||||
{
|
||||
GList *physical_devices, *l;
|
||||
GList *l;
|
||||
|
||||
physical_devices = gdk_device_list_physical_devices (source_device);
|
||||
|
||||
for (l = physical_devices; l; l = l->next)
|
||||
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (l->data));
|
||||
|
||||
g_list_free (physical_devices);
|
||||
}
|
||||
for (l = device_manager->devices; l; l = l->next)
|
||||
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (l->data));
|
||||
}
|
||||
|
||||
event = gdk_crossing_event_new (ev->evtype == XI_Enter
|
||||
|
@ -1912,7 +1912,7 @@ drag_grab (GdkDrag *drag)
|
||||
root = GDK_DISPLAY_XROOTWIN (display);
|
||||
seat = gdk_device_get_seat (gdk_drag_get_device (drag));
|
||||
|
||||
capabilities = GDK_SEAT_CAPABILITY_ALL_POINTING;
|
||||
capabilities = GDK_SEAT_CAPABILITY_ALL_POINTING | GDK_SEAT_CAPABILITY_KEYBOARD;
|
||||
|
||||
cursor = gdk_drag_get_cursor (drag, x11_drag->current_action);
|
||||
g_set_object (&x11_drag->cursor, cursor);
|
||||
|
@ -232,6 +232,12 @@ gdk_x11_gl_context_glx_make_current (GdkGLContext *context,
|
||||
"Making GLX context %p current to drawable %lu",
|
||||
context, (unsigned long) drawable);
|
||||
|
||||
/* Work around a glitch, see
|
||||
* https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5281
|
||||
*/
|
||||
if (glXGetCurrentContext () != self->glx_context)
|
||||
glXMakeContextCurrent (dpy, None, None, NULL);
|
||||
|
||||
if (!glXMakeContextCurrent (dpy, drawable, drawable, self->glx_context))
|
||||
return FALSE;
|
||||
|
||||
|
@ -603,7 +603,7 @@ update_direction (GdkX11Keymap *keymap_x11,
|
||||
keymap_x11->have_direction = TRUE;
|
||||
}
|
||||
|
||||
if (!had_direction || old_direction != keymap_x11->current_direction)
|
||||
if (had_direction && old_direction != keymap_x11->current_direction)
|
||||
{
|
||||
g_object_notify (G_OBJECT (keyboard), "direction");
|
||||
return TRUE;
|
||||
|
@ -759,6 +759,8 @@ gdk_x11_surface_finalize (GObject *object)
|
||||
}
|
||||
|
||||
g_clear_pointer (&impl->surface_is_on_monitor, g_list_free);
|
||||
g_clear_handle_id (&impl->compute_size_source_id, g_source_remove);
|
||||
g_clear_pointer (&impl->toplevel_layout, gdk_toplevel_layout_unref);
|
||||
|
||||
g_free (impl->toplevel);
|
||||
|
||||
|
@ -444,6 +444,9 @@ gtk_at_spi_cache_remove_context (GtkAtSpiCache *self,
|
||||
g_return_if_fail (GTK_IS_AT_SPI_CONTEXT (context));
|
||||
|
||||
const char *path = gtk_at_spi_context_get_context_path (context);
|
||||
if (path == NULL)
|
||||
return;
|
||||
|
||||
if (!g_hash_table_contains (self->contexts_by_path, path))
|
||||
return;
|
||||
|
||||
|
@ -1631,7 +1631,7 @@ get_bus_address_dbus (GdkDisplay *display)
|
||||
|
||||
if (error != NULL)
|
||||
{
|
||||
GTK_DEBUG (A11Y, "Unable to acquire session bus: %s", error->message);
|
||||
g_warning ("Unable to acquire session bus: %s", error->message);
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
}
|
||||
@ -1648,8 +1648,10 @@ get_bus_address_dbus (GdkDisplay *display)
|
||||
&error);
|
||||
if (error != NULL)
|
||||
{
|
||||
GTK_DEBUG (A11Y, "Unable to acquire the address of the accessibility bus: %s",
|
||||
error->message);
|
||||
g_warning ("Unable to acquire the address of the accessibility bus: %s. "
|
||||
"If you are attempting to run GTK without a11y support, "
|
||||
"GTK_A11Y should be set to 'none'.",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
@ -1732,6 +1734,12 @@ get_bus_address (GdkDisplay *display)
|
||||
#endif
|
||||
|
||||
out:
|
||||
|
||||
if (bus_address == NULL)
|
||||
g_object_set_data_full (G_OBJECT (display), "-gtk-atspi-bus-address",
|
||||
g_strdup (""),
|
||||
g_free);
|
||||
|
||||
return bus_address;
|
||||
}
|
||||
|
||||
|
@ -690,7 +690,8 @@ gtk_at_spi_root_constructed (GObject *gobject)
|
||||
/* No need to validate the path */
|
||||
self->base_path = g_strconcat (app_path, "/a11y", NULL);
|
||||
}
|
||||
else
|
||||
|
||||
if (self->base_path == NULL)
|
||||
{
|
||||
const char *program_name = g_get_prgname ();
|
||||
|
||||
|
@ -70,6 +70,10 @@ for f in get_files('ui', '.ui'):
|
||||
|
||||
xml += '\n'
|
||||
|
||||
xml += '''
|
||||
<file compressed="true">icons/hicolor.index.theme</file>
|
||||
'''
|
||||
|
||||
for s in ['16x16', '32x32', '64x64', 'scalable']:
|
||||
for c in ['actions', 'categories', 'emblems', 'emotes', 'devices', 'mimetypes', 'places', 'status']:
|
||||
icons_dir = 'icons/{0}/{1}'.format(s,c)
|
||||
|
@ -902,31 +902,6 @@ gtk_at_context_get_accessible_relation (GtkATContext *self,
|
||||
return gtk_accessible_attribute_set_get_value (self->relations, relation);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_structural_role (GtkAccessibleRole role)
|
||||
{
|
||||
/* Keep the switch small while avoiding the compiler warning for
|
||||
* unhandled enumeration values
|
||||
*/
|
||||
switch ((int) role)
|
||||
{
|
||||
case GTK_ACCESSIBLE_ROLE_FORM:
|
||||
case GTK_ACCESSIBLE_ROLE_GROUP:
|
||||
case GTK_ACCESSIBLE_ROLE_GENERIC:
|
||||
case GTK_ACCESSIBLE_ROLE_LANDMARK:
|
||||
case GTK_ACCESSIBLE_ROLE_LIST_ITEM:
|
||||
case GTK_ACCESSIBLE_ROLE_REGION:
|
||||
case GTK_ACCESSIBLE_ROLE_SEARCH:
|
||||
case GTK_ACCESSIBLE_ROLE_SEPARATOR:
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* See the WAI-ARIA § 4.3, "Accessible Name and Description Computation" */
|
||||
static void
|
||||
gtk_at_context_get_name_accumulate (GtkATContext *self,
|
||||
@ -998,13 +973,6 @@ gtk_at_context_get_name_accumulate (GtkATContext *self,
|
||||
return;
|
||||
}
|
||||
|
||||
/* This fallback is in place only for unlabelled elements */
|
||||
if (names->len != 0)
|
||||
return;
|
||||
|
||||
/* Ignore structural elements, namely: generic containers */
|
||||
if (self->accessible != NULL && !is_structural_role (role))
|
||||
g_ptr_array_add (names, (char *)G_OBJECT_TYPE_NAME (self->accessible));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1608,6 +1608,7 @@ create_subparser (GObject *object,
|
||||
subparser->object = object;
|
||||
subparser->child = child;
|
||||
subparser->tagname = g_strdup (element_name);
|
||||
subparser->level = 1;
|
||||
subparser->start = element_name;
|
||||
subparser->parser = g_memdup2 (parser, sizeof (GtkBuildableParser));
|
||||
subparser->data = user_data;
|
||||
@ -1638,6 +1639,8 @@ subparser_start (GtkBuildableParseContext *context,
|
||||
|
||||
if (subparser->start)
|
||||
{
|
||||
subparser->level++;
|
||||
|
||||
if (subparser->parser->start_element)
|
||||
subparser->parser->start_element (context,
|
||||
element_name, names, values,
|
||||
@ -1653,6 +1656,8 @@ subparser_end (GtkBuildableParseContext *context,
|
||||
ParserData *data,
|
||||
GError **error)
|
||||
{
|
||||
data->subparser->level--;
|
||||
|
||||
if (data->subparser->parser->end_element)
|
||||
data->subparser->parser->end_element (context, element_name,
|
||||
data->subparser->data, error);
|
||||
@ -1660,9 +1665,11 @@ subparser_end (GtkBuildableParseContext *context,
|
||||
if (*error)
|
||||
return;
|
||||
|
||||
if (strcmp (data->subparser->start, element_name) != 0)
|
||||
if (data->subparser->level > 0)
|
||||
return;
|
||||
|
||||
g_assert (strcmp (data->subparser->start, element_name) == 0);
|
||||
|
||||
gtk_buildable_custom_tag_end (GTK_BUILDABLE (data->subparser->object),
|
||||
data->builder,
|
||||
data->subparser->child,
|
||||
|
@ -165,6 +165,7 @@ struct _GtkBuildableParseContext {
|
||||
typedef struct {
|
||||
GtkBuildableParser *parser;
|
||||
char *tagname;
|
||||
int level;
|
||||
const char *start;
|
||||
gpointer data;
|
||||
GObject *object;
|
||||
|
@ -969,10 +969,6 @@ gtk_button_set_icon_name (GtkButton *button,
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (priv->child), icon_name);
|
||||
}
|
||||
|
||||
gtk_accessible_update_relation (GTK_ACCESSIBLE (button),
|
||||
GTK_ACCESSIBLE_RELATION_LABELLED_BY, priv->child, NULL,
|
||||
-1);
|
||||
|
||||
gtk_button_set_child_type (button, ICON_CHILD);
|
||||
g_object_notify_by_pspec (G_OBJECT (button), props[PROP_ICON_NAME]);
|
||||
}
|
||||
|
@ -1438,7 +1438,8 @@ gtk_calendar_select_day (GtkCalendar *calendar,
|
||||
else
|
||||
gtk_widget_remove_css_class (label, "other-month");
|
||||
|
||||
if (calendar->marked_date[day-1])
|
||||
if (calendar->marked_date[day-1] &&
|
||||
calendar->day_month[y][x] == MONTH_CURRENT)
|
||||
gtk_widget_set_state_flags (label, GTK_STATE_FLAG_CHECKED, FALSE);
|
||||
else
|
||||
gtk_widget_unset_state_flags (label, GTK_STATE_FLAG_CHECKED);
|
||||
@ -1524,6 +1525,14 @@ gtk_calendar_clear_marks (GtkCalendar *calendar)
|
||||
|
||||
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
||||
|
||||
for (int y = 0; y < 6; y ++)
|
||||
for (int x = 0; x < 7; x ++)
|
||||
{
|
||||
GtkWidget *label = calendar->day_number_labels[y][x];
|
||||
|
||||
gtk_widget_unset_state_flags (label, GTK_STATE_FLAG_CHECKED);
|
||||
}
|
||||
|
||||
for (day = 0; day < 31; day++)
|
||||
{
|
||||
calendar->marked_date[day] = FALSE;
|
||||
@ -1533,12 +1542,33 @@ gtk_calendar_clear_marks (GtkCalendar *calendar)
|
||||
calendar_queue_refresh (calendar);
|
||||
}
|
||||
|
||||
static void
|
||||
update_mark_state (GtkCalendar *calendar,
|
||||
guint day,
|
||||
gboolean mark)
|
||||
{
|
||||
for (int y = 0; y < 6; y ++)
|
||||
for (int x = 0; x < 7; x ++)
|
||||
{
|
||||
GtkWidget *label = calendar->day_number_labels[y][x];
|
||||
|
||||
if (day != calendar->day[y][x])
|
||||
continue;
|
||||
|
||||
if (mark && calendar->marked_date[day-1] &&
|
||||
calendar->day_month[y][x] == MONTH_CURRENT)
|
||||
gtk_widget_set_state_flags (label, GTK_STATE_FLAG_CHECKED, FALSE);
|
||||
else
|
||||
gtk_widget_unset_state_flags (label, GTK_STATE_FLAG_CHECKED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_calendar_mark_day:
|
||||
* @calendar: a `GtkCalendar`
|
||||
* @day: the day number to mark between 1 and 31.
|
||||
*
|
||||
* Places a visual marker on a particular day.
|
||||
* Places a visual marker on a particular day of the current month.
|
||||
*/
|
||||
void
|
||||
gtk_calendar_mark_day (GtkCalendar *calendar,
|
||||
@ -1550,6 +1580,7 @@ gtk_calendar_mark_day (GtkCalendar *calendar,
|
||||
{
|
||||
calendar->marked_date[day - 1] = TRUE;
|
||||
calendar->num_marked_dates++;
|
||||
update_mark_state (calendar, day, TRUE);
|
||||
calendar_invalidate_day_num (calendar, day);
|
||||
}
|
||||
}
|
||||
@ -1592,6 +1623,7 @@ gtk_calendar_unmark_day (GtkCalendar *calendar,
|
||||
{
|
||||
calendar->marked_date[day - 1] = FALSE;
|
||||
calendar->num_marked_dates--;
|
||||
update_mark_state (calendar, day, FALSE);
|
||||
calendar_invalidate_day_num (calendar, day);
|
||||
}
|
||||
}
|
||||
|
@ -65,10 +65,11 @@ gtk_column_list_item_factory_setup (GtkListItemFactory *factory,
|
||||
{
|
||||
GtkColumnViewColumn *column = g_list_model_get_item (columns, i);
|
||||
|
||||
gtk_column_list_item_factory_add_column (self,
|
||||
widget,
|
||||
column,
|
||||
FALSE);
|
||||
if (gtk_column_view_column_get_visible (column))
|
||||
gtk_column_list_item_factory_add_column (self,
|
||||
widget,
|
||||
column,
|
||||
FALSE);
|
||||
|
||||
g_object_unref (column);
|
||||
}
|
||||
|
@ -659,6 +659,8 @@ gtk_column_view_class_init (GtkColumnViewClass *klass)
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
gpointer iface;
|
||||
|
||||
widget_class->focus = gtk_widget_focus_child;
|
||||
widget_class->grab_focus = gtk_widget_grab_focus_child;
|
||||
widget_class->measure = gtk_column_view_measure;
|
||||
widget_class->size_allocate = gtk_column_view_allocate;
|
||||
|
||||
@ -1314,7 +1316,6 @@ gtk_column_view_init (GtkColumnView *self)
|
||||
g_quark_from_static_string (I_("view")));
|
||||
|
||||
gtk_widget_set_overflow (GTK_WIDGET (self), GTK_OVERFLOW_HIDDEN);
|
||||
gtk_widget_set_focusable (GTK_WIDGET (self), TRUE);
|
||||
|
||||
self->reorderable = TRUE;
|
||||
}
|
||||
|
@ -551,7 +551,8 @@ gtk_column_view_column_remove_header (GtkColumnViewColumn *self)
|
||||
static void
|
||||
gtk_column_view_column_ensure_cells (GtkColumnViewColumn *self)
|
||||
{
|
||||
if (self->view && gtk_widget_get_root (GTK_WIDGET (self->view)))
|
||||
if (self->view && gtk_widget_get_root (GTK_WIDGET (self->view)) &&
|
||||
gtk_column_view_column_get_visible (self))
|
||||
gtk_column_view_column_create_cells (self);
|
||||
else
|
||||
gtk_column_view_column_remove_cells (self);
|
||||
@ -787,8 +788,6 @@ void
|
||||
gtk_column_view_column_set_visible (GtkColumnViewColumn *self,
|
||||
gboolean visible)
|
||||
{
|
||||
GtkColumnViewCell *cell;
|
||||
|
||||
g_return_if_fail (GTK_IS_COLUMN_VIEW_COLUMN (self));
|
||||
|
||||
if (self->visible == visible)
|
||||
@ -802,10 +801,7 @@ gtk_column_view_column_set_visible (GtkColumnViewColumn *self,
|
||||
if (self->header)
|
||||
gtk_widget_set_visible (GTK_WIDGET (self->header), visible);
|
||||
|
||||
for (cell = self->first_cell; cell; cell = gtk_column_view_cell_get_next (cell))
|
||||
{
|
||||
gtk_widget_set_visible (GTK_WIDGET (cell), visible);
|
||||
}
|
||||
gtk_column_view_column_ensure_cells (self);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_VISIBLE]);
|
||||
}
|
||||
|
@ -250,6 +250,18 @@ click_released_cb (GtkGestureClick *gesture,
|
||||
show_menu (self, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
click_pressed_cb (GtkGestureClick *gesture,
|
||||
int n_press,
|
||||
double x,
|
||||
double y,
|
||||
GtkColumnView *self)
|
||||
{
|
||||
/* Claim the state here to prevent propagation, the event controllers in
|
||||
* GtkColumView have already been handled in the CAPTURE phase */
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_column_view_title_init (GtkColumnViewTitle *self)
|
||||
{
|
||||
@ -272,6 +284,7 @@ gtk_column_view_title_init (GtkColumnViewTitle *self)
|
||||
gesture = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
|
||||
g_signal_connect (gesture, "released", G_CALLBACK (click_released_cb), self);
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (click_pressed_cb), self);
|
||||
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (gesture));
|
||||
}
|
||||
|
||||
|
@ -937,9 +937,12 @@ gtk_css_animated_style_new_advance (GtkCssAnimatedStyle *source,
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_ANIMATED_STYLE (source), NULL);
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (base_style), NULL);
|
||||
|
||||
if (timestamp == 0 || timestamp == source->current_time)
|
||||
if (timestamp == 0)
|
||||
return g_object_ref (source->style);
|
||||
|
||||
if (timestamp == source->current_time)
|
||||
return g_object_ref (GTK_CSS_STYLE (source));
|
||||
|
||||
gtk_internal_return_val_if_fail (timestamp > source->current_time, NULL);
|
||||
|
||||
animations = NULL;
|
||||
|
@ -292,9 +292,13 @@ gtk_drop_target_load_local (GtkDropTarget *self,
|
||||
if (gdk_content_provider_get_value (gdk_drag_get_content (drag),
|
||||
&self->value,
|
||||
NULL))
|
||||
return TRUE;
|
||||
{
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_VALUE]);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
g_value_unset (&self->value);
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_VALUE]);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,8 @@ struct _GtkEditableLabel
|
||||
GtkWidget *stack;
|
||||
GtkWidget *label;
|
||||
GtkWidget *entry;
|
||||
|
||||
guint stop_editing_soon_id;
|
||||
};
|
||||
|
||||
struct _GtkEditableLabelClass
|
||||
@ -192,11 +194,26 @@ gtk_editable_label_prepare_drag (GtkDragSource *source,
|
||||
gtk_label_get_label (GTK_LABEL (self->label)));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
stop_editing_soon (gpointer data)
|
||||
{
|
||||
GtkEventController *controller = data;
|
||||
GtkEditableLabel *self = GTK_EDITABLE_LABEL (gtk_event_controller_get_widget (controller));
|
||||
|
||||
if (!gtk_event_controller_focus_contains_focus (GTK_EVENT_CONTROLLER_FOCUS (controller)))
|
||||
gtk_editable_label_stop_editing (self, TRUE);
|
||||
|
||||
self->stop_editing_soon_id = 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_editable_label_focus_out (GtkEventController *controller,
|
||||
GtkEditableLabel *self)
|
||||
{
|
||||
gtk_editable_label_stop_editing (self, TRUE);
|
||||
if (self->stop_editing_soon_id == 0)
|
||||
self->stop_editing_soon_id = g_timeout_add (100, stop_editing_soon, controller);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -349,6 +366,8 @@ gtk_editable_label_dispose (GObject *object)
|
||||
self->entry = NULL;
|
||||
self->label = NULL;
|
||||
|
||||
g_clear_handle_id (&self->stop_editing_soon_id, g_source_remove);
|
||||
|
||||
G_OBJECT_CLASS (gtk_editable_label_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
@ -600,6 +600,10 @@ filechooser_win32_thread (gpointer _data)
|
||||
if (FAILED (hr))
|
||||
g_warning_hr ("Can't set file types", hr);
|
||||
|
||||
hr = IFileDialog_SetDefaultExtension (pfd, L"");
|
||||
if (FAILED (hr))
|
||||
g_warning_hr ("Can't set default extension", hr);
|
||||
|
||||
if (data->self->current_filter)
|
||||
{
|
||||
GListModel *filters;
|
||||
|
@ -1704,49 +1704,6 @@ gtk_icon_theme_get_theme_name (GtkIconTheme *self)
|
||||
return theme_name;
|
||||
}
|
||||
|
||||
static const char builtin_hicolor_index[] =
|
||||
"[Icon Theme]\n"
|
||||
"Name=Hicolor\n"
|
||||
"Hidden=True\n"
|
||||
"Directories=16x16/actions,16x16/status,22x22/actions,24x24/actions,24x24/status,32x32/actions,32x32/status,48x48/status,64x64/actions,scalable/status,scalable/actions\n"
|
||||
"[16x16/actions]\n"
|
||||
"Size=16\n"
|
||||
"Type=Threshold\n"
|
||||
"[16x16/status]\n"
|
||||
"Size=16\n"
|
||||
"Type=Threshold\n"
|
||||
"[22x22/actions]\n"
|
||||
"Size=22\n"
|
||||
"Type=Threshold\n"
|
||||
"[24x24/actions]\n"
|
||||
"Size=24\n"
|
||||
"Type=Threshold\n"
|
||||
"[24x24/status]\n"
|
||||
"Size=24\n"
|
||||
"Type=Threshold\n"
|
||||
"[32x32/actions]\n"
|
||||
"Size=32\n"
|
||||
"Type=Threshold\n"
|
||||
"[32x32/status]\n"
|
||||
"Size=32\n"
|
||||
"Type=Threshold\n"
|
||||
"[48x48/status]\n"
|
||||
"Size=48\n"
|
||||
"Type=Threshold\n"
|
||||
"[64x64/actions]\n"
|
||||
"Size=64\n"
|
||||
"Type=Threshold\n"
|
||||
"[scalable/status]\n"
|
||||
"MinSize=1\n"
|
||||
"Size=128\n"
|
||||
"MaxSize=256\n"
|
||||
"Type=Scalable\n"
|
||||
"[scalable/actions]\n"
|
||||
"MinSize=1\n"
|
||||
"Size=128\n"
|
||||
"MaxSize=256\n"
|
||||
"Type=Scalable\n";
|
||||
|
||||
static void
|
||||
insert_theme (GtkIconTheme *self,
|
||||
const char *theme_name)
|
||||
@ -1813,9 +1770,20 @@ insert_theme (GtkIconTheme *self,
|
||||
{
|
||||
if (strcmp (theme_name, FALLBACK_ICON_THEME) == 0)
|
||||
{
|
||||
const char *resource_path = "/org/gtk/libgtk/icons/hicolor.index.theme";
|
||||
GBytes *index;
|
||||
|
||||
index = g_resources_lookup_data (resource_path,
|
||||
G_RESOURCE_LOOKUP_FLAGS_NONE,
|
||||
NULL);
|
||||
if (!index)
|
||||
g_error ("Cannot find resource %s", resource_path);
|
||||
|
||||
theme_file = g_key_file_new ();
|
||||
g_key_file_set_list_separator (theme_file, ',');
|
||||
g_key_file_load_from_data (theme_file, builtin_hicolor_index, -1, 0, NULL);
|
||||
g_key_file_load_from_bytes (theme_file, index, G_KEY_FILE_NONE, NULL);
|
||||
|
||||
g_bytes_unref (index);
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
@ -607,7 +607,8 @@ gtk_im_context_filter_key (GtkIMContext *context,
|
||||
state,
|
||||
FALSE, /* FIXME */
|
||||
&translated,
|
||||
&no_lock);
|
||||
&no_lock,
|
||||
NULL);
|
||||
|
||||
ret = GTK_IM_CONTEXT_GET_CLASS (context)->filter_keypress (context, key);
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "imm-extra.h"
|
||||
|
||||
#include "gdk/gdkkeysyms.h"
|
||||
#include "gdk/gdkeventsprivate.h"
|
||||
#include "gdk/win32/gdkwin32.h"
|
||||
#include "gtk/gtkimmodule.h"
|
||||
#include "gtk/gtkstylecontextprivate.h"
|
||||
@ -61,9 +62,6 @@ typedef enum {
|
||||
GTK_WIN32_IME_FOCUS_BEHAVIOR_FOLLOW,
|
||||
} GtkWin32IMEFocusBehavior;
|
||||
|
||||
#define IS_DEAD_KEY(k) \
|
||||
((k) >= GDK_KEY_dead_grave && (k) <= (GDK_KEY_dead_dasia+1))
|
||||
|
||||
struct _GtkIMContextIMEPrivate
|
||||
{
|
||||
/* When pretend_empty_preedit is set to TRUE,
|
||||
@ -81,7 +79,6 @@ struct _GtkIMContextIMEPrivate
|
||||
* https://gitlab.gnome.org/GNOME/gtk/commit/c255ba68fc2c918dd84da48a472e7973d3c00b03
|
||||
*/
|
||||
gboolean pretend_empty_preedit;
|
||||
guint32 dead_key_keyval;
|
||||
GtkWin32IMEFocusBehavior focus_behavior;
|
||||
};
|
||||
|
||||
@ -277,134 +274,26 @@ gtk_im_context_ime_set_client_widget (GtkIMContext *context,
|
||||
context_ime->client_surface = surface;
|
||||
}
|
||||
|
||||
static gunichar
|
||||
_gtk_im_context_ime_dead_key_unichar (guint keyval,
|
||||
gboolean spacing)
|
||||
{
|
||||
switch (keyval)
|
||||
{
|
||||
#define CASE(keysym, unicode, spacing_unicode) \
|
||||
case GDK_KEY_dead_##keysym: return (spacing) ? spacing_unicode : unicode;
|
||||
|
||||
CASE (grave, 0x0300, 0x0060);
|
||||
CASE (acute, 0x0301, 0x00b4);
|
||||
CASE (circumflex, 0x0302, 0x005e);
|
||||
CASE (tilde, 0x0303, 0x007e); /* Also used with perispomeni, 0x342. */
|
||||
CASE (macron, 0x0304, 0x00af);
|
||||
CASE (breve, 0x0306, 0x02d8);
|
||||
CASE (abovedot, 0x0307, 0x02d9);
|
||||
CASE (diaeresis, 0x0308, 0x00a8);
|
||||
CASE (hook, 0x0309, 0);
|
||||
CASE (abovering, 0x030A, 0x02da);
|
||||
CASE (doubleacute, 0x030B, 0x2dd);
|
||||
CASE (caron, 0x030C, 0x02c7);
|
||||
CASE (abovecomma, 0x0313, 0); /* Equivalent to psili */
|
||||
CASE (abovereversedcomma, 0x0314, 0); /* Equivalent to dasia */
|
||||
CASE (horn, 0x031B, 0); /* Legacy use for psili, 0x313 (or 0x343). */
|
||||
CASE (belowdot, 0x0323, 0);
|
||||
CASE (cedilla, 0x0327, 0x00b8);
|
||||
CASE (ogonek, 0x0328, 0); /* Legacy use for dasia, 0x314.*/
|
||||
CASE (iota, 0x0345, 0);
|
||||
|
||||
#undef CASE
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_im_context_ime_commit_unichar (GtkIMContextIME *context_ime,
|
||||
gunichar c)
|
||||
{
|
||||
char utf8[10];
|
||||
int len;
|
||||
|
||||
if (context_ime->priv->dead_key_keyval != 0)
|
||||
{
|
||||
gunichar combining;
|
||||
|
||||
combining =
|
||||
_gtk_im_context_ime_dead_key_unichar (context_ime->priv->dead_key_keyval,
|
||||
FALSE);
|
||||
g_unichar_compose (c, combining, &c);
|
||||
}
|
||||
|
||||
len = g_unichar_to_utf8 (c, utf8);
|
||||
utf8[len] = 0;
|
||||
|
||||
g_signal_emit_by_name (context_ime, "commit", utf8);
|
||||
context_ime->priv->dead_key_keyval = 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_im_context_ime_filter_keypress (GtkIMContext *context,
|
||||
GdkEvent *event)
|
||||
{
|
||||
GtkIMContextIME *context_ime;
|
||||
gboolean retval = FALSE;
|
||||
guint32 c;
|
||||
GdkModifierType state, consumed_modifiers, no_text_input_mask;
|
||||
guint keyval;
|
||||
char *compose_sequence = NULL;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_IM_CONTEXT_IME (context), FALSE);
|
||||
g_return_val_if_fail (event, FALSE);
|
||||
|
||||
if (gdk_event_get_event_type ((GdkEvent *) event) == GDK_KEY_RELEASE)
|
||||
return FALSE;
|
||||
|
||||
no_text_input_mask = GDK_ALT_MASK|GDK_CONTROL_MASK;
|
||||
|
||||
state = gdk_event_get_modifier_state ((GdkEvent *) event);
|
||||
consumed_modifiers = gdk_key_event_get_consumed_modifiers (event);
|
||||
|
||||
if (state & no_text_input_mask & ~consumed_modifiers)
|
||||
return FALSE;
|
||||
|
||||
context_ime = GTK_IM_CONTEXT_IME (context);
|
||||
|
||||
if (!context_ime->focus)
|
||||
return FALSE;
|
||||
|
||||
if (!GDK_IS_SURFACE (context_ime->client_surface))
|
||||
return FALSE;
|
||||
|
||||
keyval = gdk_key_event_get_keyval ((GdkEvent *) event);
|
||||
|
||||
if (keyval == GDK_KEY_space &&
|
||||
context_ime->priv->dead_key_keyval != 0)
|
||||
compose_sequence = gdk_key_event_get_compose_sequence (event);
|
||||
if (compose_sequence)
|
||||
{
|
||||
c = _gtk_im_context_ime_dead_key_unichar (context_ime->priv->dead_key_keyval, TRUE);
|
||||
context_ime->priv->dead_key_keyval = 0;
|
||||
_gtk_im_context_ime_commit_unichar (context_ime, c);
|
||||
g_signal_emit_by_name (context_ime, "commit", compose_sequence);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
c = gdk_keyval_to_unicode (keyval);
|
||||
|
||||
if (c && !g_unichar_iscntrl(c))
|
||||
{
|
||||
_gtk_im_context_ime_commit_unichar (context_ime, c);
|
||||
retval = TRUE;
|
||||
}
|
||||
else if (IS_DEAD_KEY (keyval))
|
||||
{
|
||||
gunichar dead_key;
|
||||
|
||||
dead_key = _gtk_im_context_ime_dead_key_unichar (keyval, FALSE);
|
||||
|
||||
/* Emulate double input of dead keys */
|
||||
if (dead_key && keyval == context_ime->priv->dead_key_keyval)
|
||||
{
|
||||
c = _gtk_im_context_ime_dead_key_unichar (context_ime->priv->dead_key_keyval, TRUE);
|
||||
context_ime->priv->dead_key_keyval = 0;
|
||||
_gtk_im_context_ime_commit_unichar (context_ime, c);
|
||||
_gtk_im_context_ime_commit_unichar (context_ime, c);
|
||||
}
|
||||
else
|
||||
context_ime->priv->dead_key_keyval = keyval;
|
||||
}
|
||||
|
||||
return retval;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -663,7 +663,8 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
|
||||
gdk_event_get_modifier_state (event),
|
||||
FALSE,
|
||||
&translated,
|
||||
&translated);
|
||||
&translated,
|
||||
NULL);
|
||||
|
||||
gtk_im_context_filter_keypress (context, tmp_event);
|
||||
gdk_event_unref (tmp_event);
|
||||
|
@ -133,7 +133,7 @@ istring_prepend (IString *str,
|
||||
if (!istring_is_inline (str))
|
||||
old = str->u.str;
|
||||
|
||||
str->u.str = g_strconcat (istring_str (str), istring_str (other), NULL);
|
||||
str->u.str = g_strconcat (istring_str (other), istring_str (str), NULL);
|
||||
str->n_bytes += other->n_bytes;
|
||||
str->n_chars += other->n_chars;
|
||||
|
||||
|
@ -569,6 +569,20 @@ gtk_list_base_focus (GtkWidget *widget,
|
||||
return gtk_widget_child_focus (item->widget, direction);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_list_base_grab_focus (GtkWidget *widget)
|
||||
{
|
||||
GtkListBase *self = GTK_LIST_BASE (widget);
|
||||
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
|
||||
guint pos;
|
||||
|
||||
pos = gtk_list_item_tracker_get_position (priv->item_manager, priv->focus);
|
||||
if (gtk_list_base_grab_focus_on_item (self, pos, FALSE, FALSE, FALSE))
|
||||
return TRUE;
|
||||
|
||||
return GTK_WIDGET_CLASS (gtk_list_base_parent_class)->grab_focus (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_list_base_dispose (GObject *object)
|
||||
{
|
||||
@ -789,43 +803,13 @@ gtk_list_base_compute_scroll_align (GtkListBase *self,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_list_base_update_focus_tracker (GtkListBase *self)
|
||||
gtk_list_base_scroll_to_item (GtkListBase *self,
|
||||
guint pos)
|
||||
{
|
||||
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
|
||||
GtkWidget *focus_child;
|
||||
guint pos;
|
||||
|
||||
focus_child = gtk_widget_get_focus_child (GTK_WIDGET (self));
|
||||
if (!GTK_IS_LIST_ITEM_WIDGET (focus_child))
|
||||
return;
|
||||
|
||||
pos = gtk_list_item_widget_get_position (GTK_LIST_ITEM_WIDGET (focus_child));
|
||||
if (pos != gtk_list_item_tracker_get_position (priv->item_manager, priv->focus))
|
||||
{
|
||||
gtk_list_item_tracker_set_position (priv->item_manager,
|
||||
priv->focus,
|
||||
pos,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_list_base_scroll_to_item (GtkWidget *widget,
|
||||
const char *action_name,
|
||||
GVariant *parameter)
|
||||
{
|
||||
GtkListBase *self = GTK_LIST_BASE (widget);
|
||||
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
|
||||
int start, end;
|
||||
double align_along, align_across;
|
||||
GtkPackType side_along, side_across;
|
||||
guint pos;
|
||||
|
||||
if (!g_variant_check_format_string (parameter, "u", FALSE))
|
||||
return;
|
||||
|
||||
g_variant_get (parameter, "u", &pos);
|
||||
|
||||
/* figure out primary orientation and if position is valid */
|
||||
if (!gtk_list_base_get_allocation_along (GTK_LIST_BASE (self), pos, &start, &end))
|
||||
@ -853,14 +837,48 @@ gtk_list_base_scroll_to_item (GtkWidget *widget,
|
||||
pos,
|
||||
align_across, side_across,
|
||||
align_along, side_along);
|
||||
}
|
||||
|
||||
/* HACK HACK HACK
|
||||
*
|
||||
* GTK has no way to track the focused child. But we now that when a listitem
|
||||
* gets focus, it calls this action. So we update our focus tracker from here
|
||||
* because it's the closest we can get to accurate tracking.
|
||||
*/
|
||||
gtk_list_base_update_focus_tracker (self);
|
||||
static void
|
||||
gtk_list_base_scroll_to_item_action (GtkWidget *widget,
|
||||
const char *action_name,
|
||||
GVariant *parameter)
|
||||
{
|
||||
GtkListBase *self = GTK_LIST_BASE (widget);
|
||||
guint pos;
|
||||
|
||||
if (!g_variant_check_format_string (parameter, "u", FALSE))
|
||||
return;
|
||||
|
||||
g_variant_get (parameter, "u", &pos);
|
||||
|
||||
gtk_list_base_scroll_to_item (self, pos);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_list_base_set_focus_child (GtkWidget *widget,
|
||||
GtkWidget *child)
|
||||
{
|
||||
GtkListBase *self = GTK_LIST_BASE (widget);
|
||||
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
|
||||
guint pos;
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_list_base_parent_class)->set_focus_child (widget, child);
|
||||
|
||||
if (!GTK_IS_LIST_ITEM_WIDGET (child))
|
||||
return;
|
||||
|
||||
pos = gtk_list_item_widget_get_position (GTK_LIST_ITEM_WIDGET (child));
|
||||
|
||||
if (pos != gtk_list_item_tracker_get_position (priv->item_manager, priv->focus))
|
||||
{
|
||||
gtk_list_base_scroll_to_item (self, pos);
|
||||
gtk_list_item_tracker_set_position (priv->item_manager,
|
||||
priv->focus,
|
||||
pos,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1120,6 +1138,8 @@ gtk_list_base_class_init (GtkListBaseClass *klass)
|
||||
gpointer iface;
|
||||
|
||||
widget_class->focus = gtk_list_base_focus;
|
||||
widget_class->grab_focus = gtk_list_base_grab_focus;
|
||||
widget_class->set_focus_child = gtk_list_base_set_focus_child;
|
||||
|
||||
gobject_class->dispose = gtk_list_base_dispose;
|
||||
gobject_class->get_property = gtk_list_base_get_property;
|
||||
@ -1164,7 +1184,7 @@ gtk_list_base_class_init (GtkListBaseClass *klass)
|
||||
gtk_widget_class_install_action (widget_class,
|
||||
"list.scroll-to-item",
|
||||
"u",
|
||||
gtk_list_base_scroll_to_item);
|
||||
gtk_list_base_scroll_to_item_action);
|
||||
|
||||
/**
|
||||
* GtkListBase|list.select-item:
|
||||
@ -1552,25 +1572,16 @@ gtk_list_base_start_rubberband (GtkListBase *self,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_list_base_stop_rubberband (GtkListBase *self,
|
||||
gboolean modify,
|
||||
gboolean extend)
|
||||
gtk_list_base_apply_rubberband_selection (GtkListBase *self,
|
||||
gboolean modify,
|
||||
gboolean extend)
|
||||
{
|
||||
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
|
||||
GtkListItemManagerItem *item;
|
||||
GtkSelectionModel *model;
|
||||
|
||||
if (!priv->rubberband)
|
||||
return;
|
||||
|
||||
for (item = gtk_list_item_manager_get_first (priv->item_manager);
|
||||
item != NULL;
|
||||
item = gtk_rb_tree_node_get_next (item))
|
||||
{
|
||||
if (item->widget)
|
||||
gtk_widget_unset_state_flags (item->widget, GTK_STATE_FLAG_ACTIVE);
|
||||
}
|
||||
|
||||
model = gtk_list_item_manager_get_model (priv->item_manager);
|
||||
if (model != NULL)
|
||||
{
|
||||
@ -1631,6 +1642,24 @@ gtk_list_base_stop_rubberband (GtkListBase *self,
|
||||
gtk_bitset_unref (mask);
|
||||
gtk_bitset_unref (rubberband_selection);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_list_base_stop_rubberband (GtkListBase *self)
|
||||
{
|
||||
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
|
||||
GtkListItemManagerItem *item;
|
||||
|
||||
if (!priv->rubberband)
|
||||
return;
|
||||
|
||||
for (item = gtk_list_item_manager_get_first (priv->item_manager);
|
||||
item != NULL;
|
||||
item = gtk_rb_tree_node_get_next (item))
|
||||
{
|
||||
if (item->widget)
|
||||
gtk_widget_unset_state_flags (item->widget, GTK_STATE_FLAG_ACTIVE);
|
||||
}
|
||||
|
||||
gtk_list_item_tracker_free (priv->item_manager, priv->rubberband->start_tracker);
|
||||
g_clear_pointer (&priv->rubberband->widget, gtk_widget_unparent);
|
||||
@ -1743,14 +1772,23 @@ gtk_list_base_drag_end (GtkGestureDrag *gesture,
|
||||
GtkListBase *self)
|
||||
{
|
||||
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
|
||||
GdkEventSequence *sequence;
|
||||
gboolean modify, extend;
|
||||
|
||||
if (!priv->rubberband)
|
||||
return;
|
||||
|
||||
sequence = gtk_gesture_get_last_updated_sequence (GTK_GESTURE (gesture));
|
||||
if (!gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
|
||||
{
|
||||
gtk_list_base_stop_rubberband (self);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_list_base_drag_update (gesture, offset_x, offset_y, self);
|
||||
get_selection_modifiers (GTK_GESTURE (gesture), &modify, &extend);
|
||||
gtk_list_base_stop_rubberband (self, modify, extend);
|
||||
gtk_list_base_apply_rubberband_selection (self, modify, extend);
|
||||
gtk_list_base_stop_rubberband (self);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "gtklistitemwidgetprivate.h"
|
||||
|
||||
#include "gtkbinlayout.h"
|
||||
#include "gtkeventcontrollerfocus.h"
|
||||
#include "gtkeventcontrollermotion.h"
|
||||
#include "gtkgestureclick.h"
|
||||
#include "gtklistitemfactoryprivate.h"
|
||||
@ -467,19 +466,6 @@ gtk_list_item_widget_click_gesture_released (GtkGestureClick *gesture,
|
||||
gtk_widget_unset_state_flags (GTK_WIDGET (self), GTK_STATE_FLAG_ACTIVE);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_list_item_widget_enter_cb (GtkEventControllerFocus *controller,
|
||||
GtkListItemWidget *self)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (self);
|
||||
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
|
||||
|
||||
gtk_widget_activate_action (widget,
|
||||
"list.scroll-to-item",
|
||||
"u",
|
||||
priv->position);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_list_item_widget_hover_cb (GtkEventControllerMotion *controller,
|
||||
double x,
|
||||
@ -531,10 +517,6 @@ gtk_list_item_widget_init (GtkListItemWidget *self)
|
||||
G_CALLBACK (gtk_list_item_widget_click_gesture_canceled), self);
|
||||
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
controller = gtk_event_controller_focus_new ();
|
||||
g_signal_connect (controller, "enter", G_CALLBACK (gtk_list_item_widget_enter_cb), self);
|
||||
gtk_widget_add_controller (GTK_WIDGET (self), controller);
|
||||
|
||||
controller = gtk_event_controller_motion_new ();
|
||||
g_signal_connect (controller, "enter", G_CALLBACK (gtk_list_item_widget_hover_cb), self);
|
||||
gtk_widget_add_controller (GTK_WIDGET (self), controller);
|
||||
|
@ -1084,7 +1084,8 @@ rewrite_event_for_toplevel (GdkEvent *event)
|
||||
gdk_key_event_get_keycode (event),
|
||||
gdk_event_get_modifier_state (event),
|
||||
gdk_key_event_is_modifier (event),
|
||||
key, key_no_lock);
|
||||
key, key_no_lock,
|
||||
gdk_key_event_get_compose_sequence (event));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -812,6 +812,8 @@ update_accel (GtkModelButton *self,
|
||||
"css-name", "accelerator",
|
||||
NULL);
|
||||
gtk_widget_insert_before (self->accel_label, GTK_WIDGET (self), NULL);
|
||||
gtk_widget_set_hexpand (self->accel_label, TRUE),
|
||||
gtk_widget_set_halign (self->accel_label, GTK_ALIGN_END);
|
||||
}
|
||||
|
||||
gtk_accelerator_parse (accel, &key, &mods);
|
||||
|
@ -543,32 +543,35 @@ _gtk_mount_operation_lookup_context_get (GdkDisplay *display)
|
||||
context->pid_to_window = g_hash_table_new (g_direct_hash, g_direct_equal);
|
||||
context->display = display;
|
||||
|
||||
mapping = NULL;
|
||||
mapping_length = 0;
|
||||
get_window_list (context->display,
|
||||
gdk_x11_display_get_xdisplay (context->display),
|
||||
gdk_x11_display_get_xrootwindow (context->display),
|
||||
gdk_x11_get_xatom_by_name_for_display (context->display,
|
||||
"_NET_CLIENT_LIST"),
|
||||
&mapping,
|
||||
&mapping_length);
|
||||
for (n = 0; n < mapping_length; n++)
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
{
|
||||
int pid;
|
||||
mapping = NULL;
|
||||
mapping_length = 0;
|
||||
get_window_list (context->display,
|
||||
gdk_x11_display_get_xdisplay (context->display),
|
||||
gdk_x11_display_get_xrootwindow (context->display),
|
||||
gdk_x11_get_xatom_by_name_for_display (context->display,
|
||||
"_NET_CLIENT_LIST"),
|
||||
&mapping,
|
||||
&mapping_length);
|
||||
for (n = 0; n < mapping_length; n++)
|
||||
{
|
||||
int pid;
|
||||
|
||||
if (!get_cardinal (context->display,
|
||||
GDK_DISPLAY_XDISPLAY (context->display),
|
||||
mapping[n],
|
||||
gdk_x11_get_xatom_by_name_for_display (context->display,
|
||||
"_NET_WM_PID"),
|
||||
&pid))
|
||||
continue;
|
||||
if (!get_cardinal (context->display,
|
||||
GDK_DISPLAY_XDISPLAY (context->display),
|
||||
mapping[n],
|
||||
gdk_x11_get_xatom_by_name_for_display (context->display,
|
||||
"_NET_WM_PID"),
|
||||
&pid))
|
||||
continue;
|
||||
|
||||
g_hash_table_insert (context->pid_to_window,
|
||||
GINT_TO_POINTER (pid),
|
||||
GINT_TO_POINTER ((int) mapping[n]));
|
||||
g_hash_table_insert (context->pid_to_window,
|
||||
GINT_TO_POINTER (pid),
|
||||
GINT_TO_POINTER ((int) mapping[n]));
|
||||
}
|
||||
g_free (mapping);
|
||||
}
|
||||
g_free (mapping);
|
||||
|
||||
return context;
|
||||
}
|
||||
@ -1001,6 +1004,9 @@ _gtk_mount_operation_lookup_info (GtkMountOperationLookupContext *context,
|
||||
g_return_val_if_fail (out_command_line != NULL && *out_command_line == NULL, FALSE);
|
||||
g_return_val_if_fail (out_texture != NULL && *out_texture == NULL, FALSE);
|
||||
|
||||
if (!GDK_IS_X11_DISPLAY (context->display))
|
||||
return FALSE;
|
||||
|
||||
/* We perform two different lookups for name and icon size.. this is
|
||||
* because we want the name from the window with WINDOWID and this
|
||||
* normally does not give you an icon
|
||||
|
@ -41,26 +41,22 @@
|
||||
#include "gtkcheckbutton.h"
|
||||
#include "gtkgrid.h"
|
||||
#include "gtkwindow.h"
|
||||
#include "gtktreeview.h"
|
||||
#include "gtktreeselection.h"
|
||||
#include "gtkcellrenderertext.h"
|
||||
#include "gtkcellrendererpixbuf.h"
|
||||
#include "gtkscrolledwindow.h"
|
||||
#include "gtkicontheme.h"
|
||||
#include "gtkmain.h"
|
||||
#include "gtksettings.h"
|
||||
#include "gtkdialogprivate.h"
|
||||
#include "gtkgestureclick.h"
|
||||
#include "gtkmodelbuttonprivate.h"
|
||||
#include "gtkpopover.h"
|
||||
#include "gtksnapshot.h"
|
||||
#include "gdktextureprivate.h"
|
||||
#include "gtkshortcutcontroller.h"
|
||||
#include "gtkshortcuttrigger.h"
|
||||
#include "gtkshortcutaction.h"
|
||||
#include "gtkshortcut.h"
|
||||
#include "gtkliststore.h"
|
||||
#include <glib/gprintf.h>
|
||||
#include "gtklistview.h"
|
||||
#include "gtksignallistitemfactory.h"
|
||||
#include "gtklistitem.h"
|
||||
#include "gtksingleselection.h"
|
||||
#include "gtkpicture.h"
|
||||
|
||||
|
||||
/**
|
||||
* GtkMountOperation:
|
||||
@ -133,8 +129,8 @@ struct _GtkMountOperationPrivate {
|
||||
gboolean anonymous;
|
||||
|
||||
/* for the show-processes dialog */
|
||||
GtkWidget *process_tree_view;
|
||||
GtkListStore *process_list_store;
|
||||
GtkWidget *process_list_view;
|
||||
GListStore *process_list_store;
|
||||
};
|
||||
|
||||
enum {
|
||||
@ -1064,12 +1060,17 @@ gtk_mount_operation_ask_question (GMountOperation *op,
|
||||
}
|
||||
|
||||
static void
|
||||
show_processes_button_clicked (GtkDialog *dialog,
|
||||
int button_number,
|
||||
show_processes_button_clicked (GtkWidget *button,
|
||||
GMountOperation *op)
|
||||
{
|
||||
GtkMountOperationPrivate *priv;
|
||||
GtkMountOperation *operation;
|
||||
int button_number;
|
||||
GtkDialog *dialog;
|
||||
|
||||
button_number = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "choice"));
|
||||
dialog = GTK_DIALOG (gtk_widget_get_ancestor (button, GTK_TYPE_DIALOG));
|
||||
|
||||
|
||||
operation = GTK_MOUNT_OPERATION (op);
|
||||
priv = operation->priv;
|
||||
@ -1180,17 +1181,70 @@ render_paintable_to_texture (GdkPaintable *paintable)
|
||||
return texture;
|
||||
}
|
||||
|
||||
typedef struct _ProcessData ProcessData;
|
||||
|
||||
G_DECLARE_FINAL_TYPE (ProcessData, process_data, PROCESS, DATA, GObject);
|
||||
|
||||
struct _ProcessData
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
GdkTexture *texture;
|
||||
char *name;
|
||||
GPid pid;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (ProcessData, process_data, G_TYPE_OBJECT);
|
||||
|
||||
static void
|
||||
process_data_init (ProcessData *self)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
process_data_finalize (GObject *object)
|
||||
{
|
||||
ProcessData *pd = PROCESS_DATA (object);
|
||||
|
||||
g_free (pd->name);
|
||||
g_object_unref (pd->texture);
|
||||
|
||||
G_OBJECT_CLASS (process_data_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
process_data_class_init (ProcessDataClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->finalize = process_data_finalize;
|
||||
}
|
||||
|
||||
static ProcessData *
|
||||
process_data_new (const char *name,
|
||||
GPid pid,
|
||||
GdkTexture *texture)
|
||||
{
|
||||
ProcessData *self;
|
||||
|
||||
self = g_object_new (process_data_get_type (), NULL);
|
||||
self->name = g_strdup (name);
|
||||
self->pid = pid;
|
||||
g_set_object (&self->texture, texture);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static void
|
||||
add_pid_to_process_list_store (GtkMountOperation *mount_operation,
|
||||
GtkMountOperationLookupContext *lookup_context,
|
||||
GtkListStore *list_store,
|
||||
GListStore *list_store,
|
||||
GPid pid)
|
||||
{
|
||||
char *command_line;
|
||||
char *name;
|
||||
GdkTexture *texture;
|
||||
char *markup;
|
||||
GtkTreeIter iter;
|
||||
|
||||
name = NULL;
|
||||
texture = NULL;
|
||||
@ -1229,12 +1283,7 @@ add_pid_to_process_list_store (GtkMountOperation *mount_operation,
|
||||
name,
|
||||
command_line);
|
||||
|
||||
gtk_list_store_append (list_store, &iter);
|
||||
gtk_list_store_set (list_store, &iter,
|
||||
0, texture,
|
||||
1, markup,
|
||||
2, pid,
|
||||
-1);
|
||||
g_list_store_append (list_store, process_data_new (markup, pid, texture));
|
||||
|
||||
if (texture != NULL)
|
||||
g_object_unref (texture);
|
||||
@ -1245,35 +1294,27 @@ add_pid_to_process_list_store (GtkMountOperation *mount_operation,
|
||||
|
||||
static void
|
||||
remove_pid_from_process_list_store (GtkMountOperation *mount_operation,
|
||||
GtkListStore *list_store,
|
||||
GListStore *list_store,
|
||||
GPid pid)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GPid pid_of_item;
|
||||
|
||||
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list_store), &iter))
|
||||
for (guint i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (list_store)); i++)
|
||||
{
|
||||
do
|
||||
{
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (list_store),
|
||||
&iter,
|
||||
2, &pid_of_item,
|
||||
-1);
|
||||
ProcessData *data = g_list_model_get_item (G_LIST_MODEL (list_store), i);
|
||||
|
||||
if (pid_of_item == pid)
|
||||
{
|
||||
gtk_list_store_remove (list_store, &iter);
|
||||
break;
|
||||
}
|
||||
g_object_unref (data);
|
||||
|
||||
if (data->pid == pid)
|
||||
{
|
||||
g_list_store_remove (list_store, i);
|
||||
break;
|
||||
}
|
||||
while (gtk_tree_model_iter_next (GTK_TREE_MODEL (list_store), &iter));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
update_process_list_store (GtkMountOperation *mount_operation,
|
||||
GtkListStore *list_store,
|
||||
GListStore *list_store,
|
||||
GArray *processes)
|
||||
{
|
||||
guint n;
|
||||
@ -1281,7 +1322,6 @@ update_process_list_store (GtkMountOperation *mount_operation,
|
||||
GArray *current_pids;
|
||||
GArray *pid_indices_to_add;
|
||||
GArray *pid_indices_to_remove;
|
||||
GtkTreeIter iter;
|
||||
GPid pid;
|
||||
|
||||
/* Just removing all items and adding new ones will screw up the
|
||||
@ -1292,18 +1332,13 @@ update_process_list_store (GtkMountOperation *mount_operation,
|
||||
pid_indices_to_add = g_array_new (FALSE, FALSE, sizeof (int));
|
||||
pid_indices_to_remove = g_array_new (FALSE, FALSE, sizeof (int));
|
||||
|
||||
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list_store), &iter))
|
||||
for (guint i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (list_store)); i++)
|
||||
{
|
||||
do
|
||||
{
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (list_store),
|
||||
&iter,
|
||||
2, &pid,
|
||||
-1);
|
||||
ProcessData *data = g_list_model_get_item (G_LIST_MODEL (list_store), i);
|
||||
|
||||
g_array_append_val (current_pids, pid);
|
||||
}
|
||||
while (gtk_tree_model_iter_next (GTK_TREE_MODEL (list_store), &iter));
|
||||
g_array_append_val (current_pids, data->pid);
|
||||
|
||||
g_object_unref (data);
|
||||
}
|
||||
|
||||
g_array_sort (current_pids, pid_equal);
|
||||
@ -1319,7 +1354,7 @@ update_process_list_store (GtkMountOperation *mount_operation,
|
||||
|
||||
if (pid_indices_to_add->len > 0)
|
||||
{
|
||||
lookup_context = _gtk_mount_operation_lookup_context_get (gtk_widget_get_display (mount_operation->priv->process_tree_view));
|
||||
lookup_context = _gtk_mount_operation_lookup_context_get (gtk_widget_get_display (mount_operation->priv->process_list_view));
|
||||
for (n = 0; n < pid_indices_to_add->len; n++)
|
||||
{
|
||||
pid = g_array_index (processes, GPid, n);
|
||||
@ -1328,17 +1363,6 @@ update_process_list_store (GtkMountOperation *mount_operation,
|
||||
_gtk_mount_operation_lookup_context_free (lookup_context);
|
||||
}
|
||||
|
||||
/* select the first item, if we went from a zero to a non-zero amount of processes */
|
||||
if (current_pids->len == 0 && pid_indices_to_add->len > 0)
|
||||
{
|
||||
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list_store), &iter))
|
||||
{
|
||||
GtkTreeSelection *tree_selection;
|
||||
tree_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (mount_operation->priv->process_tree_view));
|
||||
gtk_tree_selection_select_iter (tree_selection, &iter);
|
||||
}
|
||||
}
|
||||
|
||||
g_array_unref (current_pids);
|
||||
g_array_unref (pid_indices_to_add);
|
||||
g_array_unref (pid_indices_to_remove);
|
||||
@ -1357,26 +1381,18 @@ on_dialog_response (GtkDialog *dialog,
|
||||
}
|
||||
|
||||
static void
|
||||
on_end_process_activated (GtkModelButton *button,
|
||||
gpointer user_data)
|
||||
on_end_process_activated (GtkButton *button,
|
||||
GtkMountOperation *op)
|
||||
{
|
||||
GtkMountOperation *op = GTK_MOUNT_OPERATION (user_data);
|
||||
GtkTreeSelection *selection;
|
||||
GtkTreeIter iter;
|
||||
GPid pid_to_kill;
|
||||
GtkSelectionModel *selection;
|
||||
ProcessData *data;
|
||||
GError *error;
|
||||
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (op->priv->process_tree_view));
|
||||
|
||||
if (!gtk_tree_selection_get_selected (selection,
|
||||
NULL,
|
||||
&iter))
|
||||
selection = gtk_list_view_get_model (GTK_LIST_VIEW (op->priv->process_list_view));
|
||||
if (gtk_single_selection_get_selected (GTK_SINGLE_SELECTION (selection)) == GTK_INVALID_LIST_POSITION)
|
||||
goto out;
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (op->priv->process_list_store),
|
||||
&iter,
|
||||
2, &pid_to_kill,
|
||||
-1);
|
||||
data = gtk_single_selection_get_selected_item (GTK_SINGLE_SELECTION (selection));
|
||||
|
||||
/* TODO: We might want to either
|
||||
*
|
||||
@ -1389,7 +1405,7 @@ on_end_process_activated (GtkModelButton *button,
|
||||
* But that's not how things work right now....
|
||||
*/
|
||||
error = NULL;
|
||||
if (!_gtk_mount_operation_kill_process (pid_to_kill, &error))
|
||||
if (!_gtk_mount_operation_kill_process (data->pid, &error))
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
@ -1418,82 +1434,38 @@ on_end_process_activated (GtkModelButton *button,
|
||||
;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
do_popup_menu_for_process_tree_view (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
GtkMountOperation *op)
|
||||
static void
|
||||
setup_process_row (GtkListItemFactory *factory,
|
||||
GtkListItem *item)
|
||||
{
|
||||
GtkWidget *menu;
|
||||
GtkWidget *item;
|
||||
double x, y;
|
||||
GtkWidget *box, *picture, *label;
|
||||
|
||||
menu = gtk_popover_new ();
|
||||
gtk_widget_set_parent (menu, widget);
|
||||
gtk_widget_add_css_class (menu, "context-menu");
|
||||
picture = gtk_picture_new ();
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_MIDDLE);
|
||||
|
||||
item = gtk_model_button_new ();
|
||||
g_object_set (item, "text", _("_End Process"), NULL);
|
||||
g_signal_connect (item, "clicked",
|
||||
G_CALLBACK (on_end_process_activated),
|
||||
op);
|
||||
gtk_box_append (GTK_BOX (menu), item);
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
||||
gtk_box_append (GTK_BOX (box), picture);
|
||||
gtk_box_append (GTK_BOX (box), label);
|
||||
|
||||
if (event && gdk_event_triggers_context_menu (event))
|
||||
{
|
||||
GtkTreePath *path;
|
||||
GtkTreeSelection *selection;
|
||||
|
||||
gdk_event_get_position (event, &x, &y);
|
||||
if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (op->priv->process_tree_view),
|
||||
(int) x,
|
||||
(int) y,
|
||||
&path,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL))
|
||||
{
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (op->priv->process_tree_view));
|
||||
gtk_tree_selection_select_path (selection, path);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* don't popup a menu if the user right-clicked in an area with no rows */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gtk_popover_set_pointing_to (GTK_POPOVER (menu), &(GdkRectangle){ x, y, 1, 1});
|
||||
}
|
||||
|
||||
gtk_popover_popup (GTK_POPOVER (menu));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_popup_menu_for_process_tree_view (GtkWidget *widget,
|
||||
GVariant *args,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkMountOperation *op = GTK_MOUNT_OPERATION (user_data);
|
||||
return do_popup_menu_for_process_tree_view (widget, NULL, op);
|
||||
gtk_list_item_set_child (item, box);
|
||||
}
|
||||
|
||||
static void
|
||||
click_cb (GtkGesture *gesture,
|
||||
int n_press,
|
||||
double x,
|
||||
double y,
|
||||
gpointer user_data)
|
||||
bind_process_row (GtkListItemFactory *factory,
|
||||
GtkListItem *item)
|
||||
{
|
||||
GtkMountOperation *op = GTK_MOUNT_OPERATION (user_data);
|
||||
GdkEvent *event;
|
||||
GdkEventSequence *sequence;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *box, *picture, *label;
|
||||
ProcessData *data;
|
||||
|
||||
sequence = gtk_gesture_get_last_updated_sequence (gesture);
|
||||
event = gtk_gesture_get_last_event (gesture, sequence);
|
||||
widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture));
|
||||
do_popup_menu_for_process_tree_view (widget, event, op);
|
||||
data = gtk_list_item_get_item (item);
|
||||
|
||||
box = gtk_list_item_get_child (item);
|
||||
picture = gtk_widget_get_first_child (box);
|
||||
label = gtk_widget_get_next_sibling (picture);
|
||||
|
||||
gtk_picture_set_paintable (GTK_PICTURE (picture), GDK_PAINTABLE (data->texture));
|
||||
gtk_label_set_markup (GTK_LABEL (label), data->name);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
@ -1507,20 +1479,15 @@ create_show_processes_dialog (GtkMountOperation *op,
|
||||
char *primary;
|
||||
int count, len = 0;
|
||||
GtkWidget *label;
|
||||
GtkWidget *tree_view;
|
||||
GtkWidget *list_view;
|
||||
GtkWidget *scrolled_window;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *content_area;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkCellRenderer *renderer;
|
||||
GtkListStore *list_store;
|
||||
char *s;
|
||||
gboolean use_header;
|
||||
GtkGesture *gesture;
|
||||
GtkEventController *controller;
|
||||
GtkShortcutTrigger *trigger;
|
||||
GtkShortcutAction *action;
|
||||
GtkShortcut *shortcut;
|
||||
GListStore *store;
|
||||
GtkListItemFactory *factory;
|
||||
GtkWidget *button;
|
||||
|
||||
priv = op->priv;
|
||||
|
||||
@ -1531,12 +1498,7 @@ create_show_processes_dialog (GtkMountOperation *op,
|
||||
primary = g_strndup (message, primary - message);
|
||||
}
|
||||
|
||||
g_object_get (gtk_settings_get_default (),
|
||||
"gtk-dialogs-use-header", &use_header,
|
||||
NULL);
|
||||
dialog = g_object_new (GTK_TYPE_DIALOG,
|
||||
"use-header-bar", use_header,
|
||||
NULL);
|
||||
dialog = gtk_dialog_new ();
|
||||
|
||||
if (priv->parent_window != NULL)
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), priv->parent_window);
|
||||
@ -1544,6 +1506,10 @@ create_show_processes_dialog (GtkMountOperation *op,
|
||||
|
||||
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
||||
gtk_widget_set_margin_top (vbox, 12);
|
||||
gtk_widget_set_margin_bottom (vbox, 12);
|
||||
gtk_widget_set_margin_start (vbox, 12);
|
||||
gtk_widget_set_margin_end (vbox, 12);
|
||||
gtk_box_append (GTK_BOX (content_area), vbox);
|
||||
|
||||
if (secondary != NULL)
|
||||
@ -1564,11 +1530,16 @@ create_show_processes_dialog (GtkMountOperation *op,
|
||||
while (choices[len] != NULL)
|
||||
len++;
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
|
||||
for (count = len - 1; count >= 0; count--)
|
||||
gtk_dialog_add_button (GTK_DIALOG (dialog), choices[count], count);
|
||||
|
||||
g_signal_connect (G_OBJECT (dialog), "response",
|
||||
G_CALLBACK (show_processes_button_clicked), op);
|
||||
{
|
||||
button = gtk_button_new_with_label (choices[count]);
|
||||
g_object_set_data (G_OBJECT (button), "choice", GINT_TO_POINTER (count));
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (show_processes_button_clicked), op);
|
||||
gtk_box_append (GTK_BOX (hbox), button);
|
||||
}
|
||||
gtk_widget_set_halign (hbox, GTK_ALIGN_END);
|
||||
gtk_box_append (GTK_BOX (vbox), hbox);
|
||||
|
||||
priv->dialog = GTK_DIALOG (dialog);
|
||||
g_object_notify (G_OBJECT (op), "is-showing");
|
||||
@ -1576,67 +1547,38 @@ create_show_processes_dialog (GtkMountOperation *op,
|
||||
if (priv->parent_window == NULL && priv->display)
|
||||
gtk_window_set_display (GTK_WINDOW (dialog), priv->display);
|
||||
|
||||
tree_view = gtk_tree_view_new ();
|
||||
gtk_widget_set_size_request (tree_view, 300, 120);
|
||||
store = g_list_store_new (process_data_get_type ());
|
||||
factory = gtk_signal_list_item_factory_new ();
|
||||
|
||||
column = gtk_tree_view_column_new ();
|
||||
renderer = gtk_cell_renderer_pixbuf_new ();
|
||||
gtk_tree_view_column_pack_start (column, renderer, FALSE);
|
||||
gtk_tree_view_column_set_attributes (column, renderer,
|
||||
"texture", 0,
|
||||
NULL);
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
g_object_set (renderer,
|
||||
"ellipsize", PANGO_ELLIPSIZE_MIDDLE,
|
||||
"ellipsize-set", TRUE,
|
||||
NULL);
|
||||
gtk_tree_view_column_pack_start (column, renderer, TRUE);
|
||||
gtk_tree_view_column_set_attributes (column, renderer,
|
||||
"markup", 1,
|
||||
NULL);
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
|
||||
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), FALSE);
|
||||
g_signal_connect (factory, "setup", G_CALLBACK (setup_process_row), op);
|
||||
g_signal_connect (factory, "bind", G_CALLBACK (bind_process_row), op);
|
||||
|
||||
list_view = gtk_list_view_new (GTK_SELECTION_MODEL (gtk_single_selection_new (G_LIST_MODEL (store))), factory);
|
||||
|
||||
gtk_widget_set_size_request (list_view, 300, 120);
|
||||
|
||||
scrolled_window = gtk_scrolled_window_new ();
|
||||
gtk_widget_set_vexpand (scrolled_window, TRUE);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_POLICY_NEVER,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_propagate_natural_height (GTK_SCROLLED_WINDOW (scrolled_window), TRUE);
|
||||
gtk_scrolled_window_set_has_frame (GTK_SCROLLED_WINDOW (scrolled_window), TRUE);
|
||||
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), tree_view);
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), list_view);
|
||||
gtk_box_append (GTK_BOX (vbox), scrolled_window);
|
||||
|
||||
controller = gtk_shortcut_controller_new ();
|
||||
trigger = gtk_alternative_trigger_new (gtk_keyval_trigger_new (GDK_KEY_F10, GDK_SHIFT_MASK),
|
||||
gtk_keyval_trigger_new (GDK_KEY_Menu, 0));
|
||||
action = gtk_callback_action_new (on_popup_menu_for_process_tree_view,
|
||||
op,
|
||||
NULL);
|
||||
shortcut = gtk_shortcut_new_with_arguments (trigger, action, "s", "sv");
|
||||
gtk_shortcut_controller_add_shortcut (GTK_SHORTCUT_CONTROLLER (controller), shortcut);
|
||||
gtk_widget_add_controller (GTK_WIDGET (tree_view), controller);
|
||||
button = gtk_button_new_with_mnemonic (_("_End Process"));
|
||||
gtk_widget_set_halign (button, GTK_ALIGN_END);
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (on_end_process_activated), op);
|
||||
gtk_box_append (GTK_BOX (vbox), button);
|
||||
|
||||
gesture = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
|
||||
g_signal_connect (gesture, "pressed",
|
||||
G_CALLBACK (click_cb), op);
|
||||
gtk_widget_add_controller (tree_view, GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
list_store = gtk_list_store_new (3,
|
||||
GDK_TYPE_TEXTURE,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_INT);
|
||||
|
||||
gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (list_store));
|
||||
|
||||
priv->process_list_store = list_store;
|
||||
priv->process_tree_view = tree_view;
|
||||
priv->process_list_store = store;
|
||||
priv->process_list_view = list_view;
|
||||
/* set pointers to NULL when dialog goes away */
|
||||
g_object_add_weak_pointer (G_OBJECT (priv->process_list_store), (gpointer *) &priv->process_list_store);
|
||||
g_object_add_weak_pointer (G_OBJECT (priv->process_tree_view), (gpointer *) &priv->process_tree_view);
|
||||
g_object_add_weak_pointer (G_OBJECT (priv->process_list_view), (gpointer *) &priv->process_list_view);
|
||||
|
||||
g_object_unref (list_store);
|
||||
g_object_ref (op);
|
||||
|
||||
return dialog;
|
||||
|
@ -4034,9 +4034,6 @@ gtk_notebook_insert_notebook_page (GtkNotebook *notebook,
|
||||
g_signal_connect (controller, "enter", G_CALLBACK (gtk_notebook_tab_drop_enter), page);
|
||||
g_signal_connect (controller, "leave", G_CALLBACK (gtk_notebook_tab_drop_leave), page);
|
||||
gtk_widget_add_controller (page->tab_widget, controller);
|
||||
gtk_accessible_update_property (GTK_ACCESSIBLE (page->tab_widget),
|
||||
GTK_ACCESSIBLE_PROPERTY_LABEL, _("Tab"),
|
||||
-1);
|
||||
|
||||
page->expand = FALSE;
|
||||
page->fill = TRUE;
|
||||
@ -4338,6 +4335,11 @@ gtk_notebook_update_labels (GtkNotebook *notebook)
|
||||
text = page->tab_text;
|
||||
else
|
||||
text = string;
|
||||
|
||||
gtk_accessible_update_property (GTK_ACCESSIBLE (page->tab_widget),
|
||||
GTK_ACCESSIBLE_PROPERTY_LABEL, text,
|
||||
-1);
|
||||
|
||||
if (notebook->show_tabs)
|
||||
{
|
||||
if (page->default_tab)
|
||||
|
@ -253,14 +253,25 @@ gtk_password_entry_realize (GtkWidget *widget)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_password_entry_unrealize (GtkWidget *widget)
|
||||
{
|
||||
GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (widget);
|
||||
|
||||
if (entry->keyboard)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (entry->keyboard, caps_lock_state_changed, entry);
|
||||
entry->keyboard = NULL;
|
||||
}
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_password_entry_parent_class)->unrealize (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_password_entry_dispose (GObject *object)
|
||||
{
|
||||
GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (object);
|
||||
|
||||
if (entry->keyboard)
|
||||
g_signal_handlers_disconnect_by_func (entry->keyboard, caps_lock_state_changed, entry);
|
||||
|
||||
if (entry->entry)
|
||||
gtk_editable_finish_delegate (GTK_EDITABLE (entry));
|
||||
|
||||
@ -451,6 +462,7 @@ gtk_password_entry_class_init (GtkPasswordEntryClass *klass)
|
||||
object_class->set_property = gtk_password_entry_set_property;
|
||||
|
||||
widget_class->realize = gtk_password_entry_realize;
|
||||
widget_class->unrealize = gtk_password_entry_unrealize;
|
||||
widget_class->measure = gtk_password_entry_measure;
|
||||
widget_class->size_allocate = gtk_password_entry_size_allocate;
|
||||
widget_class->mnemonic_activate = gtk_password_entry_mnemonic_activate;
|
||||
|
@ -1239,6 +1239,10 @@ captured_scroll_cb (GtkEventControllerScroll *scroll,
|
||||
|
||||
gtk_scrolled_window_cancel_deceleration (scrolled_window);
|
||||
|
||||
if (!may_hscroll (scrolled_window) &&
|
||||
!may_vscroll (scrolled_window))
|
||||
return GDK_EVENT_PROPAGATE;
|
||||
|
||||
if (priv->smooth_scroll)
|
||||
{
|
||||
scrolled_window_scroll (scrolled_window, delta_x, delta_y, scroll);
|
||||
@ -1429,6 +1433,10 @@ scroll_controller_scroll (GtkEventControllerScroll *scroll,
|
||||
GtkScrolledWindowPrivate *priv =
|
||||
gtk_scrolled_window_get_instance_private (scrolled_window);
|
||||
|
||||
if (!may_hscroll (scrolled_window) &&
|
||||
!may_vscroll (scrolled_window))
|
||||
return GDK_EVENT_PROPAGATE;
|
||||
|
||||
if (!priv->smooth_scroll)
|
||||
scrolled_window_scroll (scrolled_window, delta_x, delta_y, scroll);
|
||||
|
||||
|
@ -144,7 +144,11 @@ get_labels (guint key, GdkModifierType modifier, guint *n_mods)
|
||||
if (modifier & GDK_HYPER_MASK)
|
||||
labels[i++] = C_("keyboard label", "Hyper");
|
||||
if (modifier & GDK_META_MASK)
|
||||
#ifndef GDK_WINDOWING_MACOS
|
||||
labels[i++] = C_("keyboard label", "Meta");
|
||||
#else
|
||||
labels[i++] = "⌘";
|
||||
#endif
|
||||
|
||||
*n_mods = i;
|
||||
|
||||
|
@ -278,11 +278,6 @@ gtk_sidebar_row_set_property (GObject *object,
|
||||
|
||||
case PROP_SECTION_TYPE:
|
||||
self->section_type = g_value_get_enum (value);
|
||||
if (self->section_type == GTK_PLACES_SECTION_COMPUTER ||
|
||||
self->section_type == GTK_PLACES_SECTION_OTHER_LOCATIONS)
|
||||
gtk_label_set_ellipsize (GTK_LABEL (self->label_widget), PANGO_ELLIPSIZE_NONE);
|
||||
else
|
||||
gtk_label_set_ellipsize (GTK_LABEL (self->label_widget), PANGO_ELLIPSIZE_END);
|
||||
break;
|
||||
|
||||
case PROP_PLACE_TYPE:
|
||||
|
@ -2753,8 +2753,6 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
|
||||
GdkDevice *source;
|
||||
guint state;
|
||||
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
|
||||
sel_start = priv->selection_bound;
|
||||
sel_end = priv->current_pos;
|
||||
have_selection = sel_start != sel_end;
|
||||
@ -2789,6 +2787,8 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
|
||||
gtk_text_selection_bubble_popup_unset (self);
|
||||
else
|
||||
gtk_text_selection_bubble_popup_set (self);
|
||||
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
}
|
||||
else if (extend_selection)
|
||||
{
|
||||
@ -2800,6 +2800,8 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
|
||||
|
||||
/* all done, so skip the extend_to_left stuff later */
|
||||
extend_selection = FALSE;
|
||||
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2807,6 +2809,7 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
|
||||
priv->in_drag = TRUE;
|
||||
priv->drag_start_x = x;
|
||||
priv->drag_start_y = y;
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2815,7 +2818,13 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
|
||||
|
||||
if (!extend_selection)
|
||||
{
|
||||
gtk_text_set_selection_bounds (self, tmp_pos, tmp_pos);
|
||||
if (priv->current_pos != tmp_pos ||
|
||||
priv->selection_bound != tmp_pos)
|
||||
{
|
||||
gtk_text_set_selection_bounds (self, tmp_pos, tmp_pos);
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
}
|
||||
|
||||
priv->handle_place_time = g_get_monotonic_time ();
|
||||
}
|
||||
else
|
||||
@ -2825,6 +2834,7 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
|
||||
sel_start = sel_end = priv->current_pos;
|
||||
|
||||
gtk_text_set_positions (self, tmp_pos, tmp_pos);
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2833,11 +2843,13 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
|
||||
case 2:
|
||||
priv->select_words = TRUE;
|
||||
gtk_text_select_word (self);
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
priv->select_lines = TRUE;
|
||||
gtk_text_select_line (self);
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -3222,8 +3234,12 @@ gtk_text_focus_changed (GtkEventControllerFocus *controller,
|
||||
if (gtk_event_controller_focus_is_focus (controller))
|
||||
{
|
||||
if (keyboard)
|
||||
g_signal_connect (keyboard, "notify::direction",
|
||||
G_CALLBACK (direction_changed), self);
|
||||
{
|
||||
/* Work around unexpected notify::direction emissions */
|
||||
gdk_device_get_direction (keyboard);
|
||||
g_signal_connect (keyboard, "notify::direction",
|
||||
G_CALLBACK (direction_changed), self);
|
||||
}
|
||||
|
||||
gtk_text_im_set_focus_in (self);
|
||||
gtk_text_reset_blink_time (self);
|
||||
|
@ -5332,7 +5332,7 @@ gtk_text_buffer_get_run_attributes (GtkTextBuffer *buffer,
|
||||
GdkRGBA *rgba;
|
||||
char *value;
|
||||
|
||||
g_object_get (tag, "foreground", &rgba, NULL);
|
||||
g_object_get (tag, "foreground-rgba", &rgba, NULL);
|
||||
value = g_strdup_printf ("%u,%u,%u",
|
||||
(guint) rgba->red * 65535,
|
||||
(guint) rgba->green * 65535,
|
||||
|
@ -401,27 +401,6 @@ gtk_tooltip_window_new (void)
|
||||
return g_object_new (GTK_TYPE_TOOLTIP_WINDOW, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
update_label_width (GtkLabel *label)
|
||||
{
|
||||
const char *text;
|
||||
|
||||
text = gtk_label_get_text (label);
|
||||
if (strchr (text, '\n'))
|
||||
{
|
||||
gtk_label_set_wrap (label, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
int len;
|
||||
|
||||
len = g_utf8_strlen (text, -1);
|
||||
|
||||
gtk_label_set_max_width_chars (label, MIN (len, 50));
|
||||
gtk_label_set_wrap (label, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_tooltip_window_set_label_markup (GtkTooltipWindow *window,
|
||||
const char *markup)
|
||||
@ -429,7 +408,6 @@ gtk_tooltip_window_set_label_markup (GtkTooltipWindow *window,
|
||||
if (markup != NULL)
|
||||
{
|
||||
gtk_label_set_markup (GTK_LABEL (window->label), markup);
|
||||
update_label_width (GTK_LABEL (window->label));
|
||||
gtk_widget_show (window->label);
|
||||
}
|
||||
else
|
||||
@ -445,7 +423,6 @@ gtk_tooltip_window_set_label_text (GtkTooltipWindow *window,
|
||||
if (text != NULL)
|
||||
{
|
||||
gtk_label_set_text (GTK_LABEL (window->label), text);
|
||||
update_label_width (GTK_LABEL (window->label));
|
||||
gtk_widget_show (window->label);
|
||||
}
|
||||
else
|
||||
|
@ -266,6 +266,7 @@ gtk_tree_popover_init (GtkTreePopover *popover)
|
||||
|
||||
sw = gtk_scrolled_window_new ();
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_propagate_natural_width (GTK_SCROLLED_WINDOW (sw), TRUE);
|
||||
gtk_scrolled_window_set_propagate_natural_height (GTK_SCROLLED_WINDOW (sw), TRUE);
|
||||
gtk_popover_set_child (GTK_POPOVER (popover), sw);
|
||||
|
||||
|
@ -4026,6 +4026,8 @@ gtk_widget_allocate (GtkWidget *widget,
|
||||
priv->height = adjusted.height;
|
||||
priv->baseline = baseline;
|
||||
|
||||
priv->alloc_needed_on_child = FALSE;
|
||||
|
||||
if (priv->layout_manager != NULL)
|
||||
{
|
||||
gtk_layout_manager_allocate (priv->layout_manager, widget,
|
||||
@ -4053,7 +4055,6 @@ gtk_widget_allocate (GtkWidget *widget,
|
||||
|
||||
gtk_widget_ensure_resize (widget);
|
||||
priv->alloc_needed = FALSE;
|
||||
priv->alloc_needed_on_child = FALSE;
|
||||
|
||||
gtk_widget_update_paintables (widget);
|
||||
|
||||
|
@ -184,6 +184,7 @@ typedef struct
|
||||
|
||||
GtkWidget *default_widget;
|
||||
GtkWidget *focus_widget;
|
||||
GtkWidget *move_focus_widget;
|
||||
GtkWindow *transient_parent;
|
||||
GtkWindowGeometryInfo *geometry_info;
|
||||
GtkWindowGroup *group;
|
||||
@ -2003,7 +2004,12 @@ gtk_window_root_set_focus (GtkRoot *root,
|
||||
|
||||
if (focus == priv->focus_widget)
|
||||
{
|
||||
priv->move_focus = FALSE;
|
||||
if (priv->move_focus &&
|
||||
focus && gtk_widget_is_visible (focus))
|
||||
{
|
||||
priv->move_focus = FALSE;
|
||||
g_clear_object (&priv->move_focus_widget);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2023,7 +2029,12 @@ gtk_window_root_set_focus (GtkRoot *root,
|
||||
|
||||
g_clear_object (&old_focus);
|
||||
|
||||
priv->move_focus = FALSE;
|
||||
if (priv->move_focus &&
|
||||
focus && gtk_widget_is_visible (focus))
|
||||
{
|
||||
priv->move_focus = FALSE;
|
||||
g_clear_object (&priv->move_focus_widget);
|
||||
}
|
||||
|
||||
g_object_notify (G_OBJECT (self), "focus-widget");
|
||||
}
|
||||
@ -2547,6 +2558,7 @@ gtk_window_dispose (GObject *object)
|
||||
g_list_free_full (priv->foci, (GDestroyNotify) gtk_pointer_focus_unref);
|
||||
priv->foci = NULL;
|
||||
|
||||
g_clear_object (&priv->move_focus_widget);
|
||||
gtk_window_set_focus (window, NULL);
|
||||
gtk_window_set_default_widget (window, NULL);
|
||||
|
||||
@ -4675,7 +4687,28 @@ maybe_unset_focus_and_default (GtkWindow *window)
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
if (priv->move_focus)
|
||||
gtk_widget_child_focus (GTK_WIDGET (window), GTK_DIR_TAB_FORWARD);
|
||||
{
|
||||
GtkWidget *parent;
|
||||
|
||||
parent = _gtk_widget_get_parent (priv->move_focus_widget);
|
||||
|
||||
while (parent)
|
||||
{
|
||||
if (_gtk_widget_get_visible (parent))
|
||||
{
|
||||
if (gtk_widget_grab_focus (parent))
|
||||
break;
|
||||
}
|
||||
|
||||
parent = _gtk_widget_get_parent (parent);
|
||||
}
|
||||
|
||||
if (!parent)
|
||||
gtk_widget_child_focus (GTK_WIDGET (window), GTK_DIR_TAB_FORWARD);
|
||||
|
||||
priv->move_focus = FALSE;
|
||||
g_clear_object (&priv->move_focus_widget);
|
||||
}
|
||||
|
||||
if (priv->unset_default)
|
||||
gtk_window_set_default_widget (window, NULL);
|
||||
@ -5134,7 +5167,10 @@ _gtk_window_unset_focus_and_default (GtkWindow *window,
|
||||
|
||||
child = priv->focus_widget;
|
||||
if (child && (child == widget || gtk_widget_is_ancestor (child, widget)))
|
||||
priv->move_focus = TRUE;
|
||||
{
|
||||
priv->move_focus_widget = g_object_ref (widget);
|
||||
priv->move_focus = TRUE;
|
||||
}
|
||||
|
||||
child = priv->default_widget;
|
||||
if (child && (child == widget || gtk_widget_is_ancestor (child, widget)))
|
||||
|
3805
gtk/icons/hicolor.index.theme
Normal file
3805
gtk/icons/hicolor.index.theme
Normal file
File diff suppressed because one or more lines are too long
@ -3478,6 +3478,10 @@ calendar {
|
||||
@extend %selected_items;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
&:checked {
|
||||
background-color: gtkalpha($selected_bg_color, 0.3);
|
||||
}
|
||||
}
|
||||
|
||||
> label.day-number.other-month {
|
||||
|
@ -14,7 +14,7 @@
|
||||
<property name="shrink-start-child">0</property>
|
||||
<property name="resize-start-child">0</property>
|
||||
<property name="vexpand">1</property>
|
||||
<child>
|
||||
<property name="start-child">
|
||||
<object class="GtkPlacesSidebar" id="places_sidebar">
|
||||
<property name="show-other-locations">1</property>
|
||||
<property name="show-trash">0</property>
|
||||
@ -25,8 +25,8 @@
|
||||
<signal name="show-error-message" handler="places_sidebar_show_error_message_cb" swapped="no"/>
|
||||
<signal name="show-other-locations-with-flags" handler="places_sidebar_show_other_locations_with_flags_cb" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
</property>
|
||||
<property name="end-child">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">1</property>
|
||||
<child>
|
||||
@ -326,7 +326,7 @@
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -188,7 +188,7 @@
|
||||
<property name="tooltip-text" translatable="yes">Preview Font</property>
|
||||
<child>
|
||||
<object class="GtkEventControllerScroll">
|
||||
<property name="flags" translatable="yes">horizontal</property>
|
||||
<property name="flags">horizontal</property>
|
||||
<signal name="scroll" handler="resize_by_scroll_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
@ -217,7 +217,7 @@
|
||||
<property name="round-digits">0</property>
|
||||
<child>
|
||||
<object class="GtkEventControllerScroll">
|
||||
<property name="flags" translatable="yes">horizontal</property>
|
||||
<property name="flags">horizontal</property>
|
||||
<signal name="scroll" handler="resize_by_scroll_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
|
@ -25,6 +25,7 @@
|
||||
<object class="GtkLabel" id="label_widget">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="ellipsize">end</property>
|
||||
<style>
|
||||
<class name="sidebar-label"/>
|
||||
</style>
|
||||
|
@ -13,7 +13,9 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -1,5 +1,5 @@
|
||||
project('gtk', 'c',
|
||||
version: '4.8.1',
|
||||
version: '4.8.4',
|
||||
default_options: [
|
||||
'buildtype=debugoptimized',
|
||||
'warning_level=1',
|
||||
|
@ -54,6 +54,7 @@ hu
|
||||
hy
|
||||
ia
|
||||
id
|
||||
ie
|
||||
io
|
||||
is
|
||||
it
|
||||
|
46
po/hr.po
46
po/hr.po
@ -5,8 +5,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gtk+ 0\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
|
||||
"POT-Creation-Date: 2022-09-26 16:01+0000\n"
|
||||
"PO-Revision-Date: 2022-09-26 21:29+0200\n"
|
||||
"POT-Creation-Date: 2022-10-01 12:58+0000\n"
|
||||
"PO-Revision-Date: 2022-10-02 16:02+0200\n"
|
||||
"Last-Translator: gogo <trebelnik2@gmail.com>\n"
|
||||
"Language-Team: Croatian <lokalizacija@linux.hr>\n"
|
||||
"Language: hr\n"
|
||||
@ -1035,7 +1035,7 @@ msgstr "Mozilla javna licenca 2.0"
|
||||
|
||||
#: gtk/gtkaboutdialog.c:937
|
||||
msgid "Website"
|
||||
msgstr "Web stranica"
|
||||
msgstr "Web naslovnica"
|
||||
|
||||
#: gtk/gtkaboutdialog.c:973 gtk/ui/gtkapplication-quartz.ui:6
|
||||
#, c-format
|
||||
@ -1044,11 +1044,11 @@ msgstr "O %s"
|
||||
|
||||
#: gtk/gtkaboutdialog.c:2074
|
||||
msgid "Created by"
|
||||
msgstr "Stvorio"
|
||||
msgstr "Stvorili"
|
||||
|
||||
#: gtk/gtkaboutdialog.c:2077
|
||||
msgid "Documented by"
|
||||
msgstr "Dokumentirao"
|
||||
msgstr "Dokumentirali"
|
||||
|
||||
#: gtk/gtkaboutdialog.c:2087
|
||||
msgid "Translated by"
|
||||
@ -1056,7 +1056,7 @@ msgstr "Preveli"
|
||||
|
||||
#: gtk/gtkaboutdialog.c:2092
|
||||
msgid "Design by"
|
||||
msgstr "Dizajnirao"
|
||||
msgstr "Dizajnirali"
|
||||
|
||||
#. Translators: this is the license preamble; the string at the end
|
||||
#. * contains the name of the license as link text.
|
||||
@ -2125,7 +2125,7 @@ msgstr "Datoteka s tim nazivom već postoji"
|
||||
#: gtk/gtkmountoperation.c:608 gtk/gtkpagesetupunixdialog.c:283
|
||||
#: gtk/gtkprintbackend.c:637 gtk/gtkprinteroptionwidget.c:721
|
||||
#: gtk/gtkprintunixdialog.c:651 gtk/gtkprintunixdialog.c:807
|
||||
#: gtk/gtkwindow.c:6113 gtk/inspector/css-editor.c:248
|
||||
#: gtk/gtkwindow.c:6116 gtk/inspector/css-editor.c:248
|
||||
#: gtk/inspector/recorder.c:1723 gtk/ui/gtkappchooserdialog.ui:45
|
||||
#: gtk/ui/gtkassistant.ui:52 gtk/ui/gtkcolorchooserdialog.ui:33
|
||||
#: gtk/ui/gtkfontchooserdialog.ui:24
|
||||
@ -2216,7 +2216,7 @@ msgid "If you delete an item, it will be permanently lost."
|
||||
msgstr "Ako obrišete stavku, biti će trajno izgubljena."
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:1211 gtk/gtkfilechooserwidget.c:1827
|
||||
#: gtk/gtklabel.c:5652 gtk/gtktext.c:6051 gtk/gtktextview.c:8968
|
||||
#: gtk/gtklabel.c:5652 gtk/gtktext.c:6049 gtk/gtktextview.c:8966
|
||||
msgid "_Delete"
|
||||
msgstr "_Obriši"
|
||||
|
||||
@ -2416,7 +2416,7 @@ msgstr "Ne možete pristupiti određenoj mapi."
|
||||
msgid "Could not send the search request"
|
||||
msgstr "Nemoguće slanje zahtjeva pretrage"
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:6876
|
||||
#: gtk/gtkfilechooserwidget.c:6877
|
||||
msgid "Accessed"
|
||||
msgstr "Pristupljeno"
|
||||
|
||||
@ -2508,19 +2508,19 @@ msgstr "Varijacije znaka"
|
||||
msgid "OpenGL context creation failed"
|
||||
msgstr "Neuspjelo stvaranje OpenGL sadržaja"
|
||||
|
||||
#: gtk/gtklabel.c:5649 gtk/gtktext.c:6039 gtk/gtktextview.c:8956
|
||||
#: gtk/gtklabel.c:5649 gtk/gtktext.c:6037 gtk/gtktextview.c:8954
|
||||
msgid "Cu_t"
|
||||
msgstr "Iz_reži"
|
||||
|
||||
#: gtk/gtklabel.c:5650 gtk/gtktext.c:6043 gtk/gtktextview.c:8960
|
||||
#: gtk/gtklabel.c:5650 gtk/gtktext.c:6041 gtk/gtktextview.c:8958
|
||||
msgid "_Copy"
|
||||
msgstr "_Kopiraj"
|
||||
|
||||
#: gtk/gtklabel.c:5651 gtk/gtktext.c:6047 gtk/gtktextview.c:8964
|
||||
#: gtk/gtklabel.c:5651 gtk/gtktext.c:6045 gtk/gtktextview.c:8962
|
||||
msgid "_Paste"
|
||||
msgstr "_Zalijepi"
|
||||
|
||||
#: gtk/gtklabel.c:5657 gtk/gtktext.c:6060 gtk/gtktextview.c:8989
|
||||
#: gtk/gtklabel.c:5657 gtk/gtktext.c:6058 gtk/gtktextview.c:8987
|
||||
msgid "Select _All"
|
||||
msgstr "Odaberi _sve"
|
||||
|
||||
@ -2630,7 +2630,7 @@ msgid "%d:%02d"
|
||||
msgstr "%d:%02d"
|
||||
|
||||
#: gtk/gtkmessagedialog.c:158 gtk/gtkmessagedialog.c:176
|
||||
#: gtk/gtkprintbackend.c:638 gtk/gtkwindow.c:6114
|
||||
#: gtk/gtkprintbackend.c:638 gtk/gtkwindow.c:6117
|
||||
msgid "_OK"
|
||||
msgstr "_U redu"
|
||||
|
||||
@ -3507,15 +3507,15 @@ msgctxt "accessibility"
|
||||
msgid "Sidebar"
|
||||
msgstr "Bočna traka"
|
||||
|
||||
#: gtk/gtktext.c:6065 gtk/gtktextview.c:8994
|
||||
#: gtk/gtktext.c:6063 gtk/gtktextview.c:8992
|
||||
msgid "Insert _Emoji"
|
||||
msgstr "Umetni _emotikoin"
|
||||
|
||||
#: gtk/gtktextview.c:8976
|
||||
#: gtk/gtktextview.c:8974
|
||||
msgid "_Undo"
|
||||
msgstr "_Vrati"
|
||||
|
||||
#: gtk/gtktextview.c:8980
|
||||
#: gtk/gtktextview.c:8978
|
||||
msgid "_Redo"
|
||||
msgstr "_Ponovi"
|
||||
|
||||
@ -3542,12 +3542,12 @@ msgctxt "volume percentage"
|
||||
msgid "%d %%"
|
||||
msgstr "%d %%"
|
||||
|
||||
#: gtk/gtkwindow.c:6101
|
||||
#: gtk/gtkwindow.c:6104
|
||||
#, c-format
|
||||
msgid "Do you want to use GTK Inspector?"
|
||||
msgstr "Želite li koristiti GTK Inspektora?"
|
||||
|
||||
#: gtk/gtkwindow.c:6103
|
||||
#: gtk/gtkwindow.c:6106
|
||||
#, c-format
|
||||
msgid ""
|
||||
"GTK Inspector is an interactive debugger that lets you explore and modify "
|
||||
@ -3558,7 +3558,7 @@ msgstr ""
|
||||
"otkrivanje i promjenu unutrašnjosti bilo koje GTK aplikacije. Njegovo "
|
||||
"korištenje može uzrokovati rušenje ili prekid u radu aplikacije."
|
||||
|
||||
#: gtk/gtkwindow.c:6108
|
||||
#: gtk/gtkwindow.c:6111
|
||||
msgid "Don’t show this message again"
|
||||
msgstr "Ne prikazuj više ovu poruku"
|
||||
|
||||
@ -6973,15 +6973,15 @@ msgstr "Datoteka"
|
||||
msgid "_Output format"
|
||||
msgstr "_Izlazni format"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendlpr.c:371
|
||||
#: modules/printbackends/gtkprintbackendlpr.c:372
|
||||
msgid "Print to LPR"
|
||||
msgstr "Ispiši do LPR"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendlpr.c:400
|
||||
#: modules/printbackends/gtkprintbackendlpr.c:401
|
||||
msgid "Pages Per Sheet"
|
||||
msgstr "Stranica po listu"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendlpr.c:406
|
||||
#: modules/printbackends/gtkprintbackendlpr.c:407
|
||||
msgid "Command Line"
|
||||
msgstr "Naredbeni redak"
|
||||
|
||||
|
@ -2,5 +2,5 @@
|
||||
directory=glib
|
||||
url=https://gitlab.gnome.org/GNOME/glib.git
|
||||
push-url=ssh://git@gitlab.gnome.org:GNOME/glib.git
|
||||
revision=main
|
||||
revision=glib-2-74
|
||||
depth=1
|
||||
|
@ -2,5 +2,5 @@
|
||||
directory=harfbuzz
|
||||
url=https://github.com/harfbuzz/harfbuzz.git
|
||||
push-url=git@github.com:harfbuzz/harfbuzz.git
|
||||
revision=main
|
||||
revision=4.0.0
|
||||
depth=1
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static gboolean ask_question = FALSE;
|
||||
static gboolean show_processes = FALSE;
|
||||
static gboolean anonymous = FALSE;
|
||||
static gboolean dont_ask_username = FALSE;
|
||||
static gboolean dont_ask_domain = FALSE;
|
||||
@ -100,6 +101,7 @@ main (int argc, char *argv[])
|
||||
GError *error = NULL;
|
||||
GOptionEntry options[] = {
|
||||
{ "ask-question", 'q', 0, G_OPTION_ARG_NONE, &ask_question, "Ask a question not a password.", NULL },
|
||||
{ "show-processes", 0, 0, G_OPTION_ARG_NONE, &show_processes, "Show (pretend) processes.", NULL },
|
||||
{ "right-to-left", 'r', 0, G_OPTION_ARG_NONE, &force_rtl, "Force right-to-left layout.", NULL },
|
||||
{ "anonymous", 'a', 0, G_OPTION_ARG_NONE, &anonymous, "Anonymous login allowed.", NULL },
|
||||
{ "no-username", 'u', 0, G_OPTION_ARG_NONE, &dont_ask_username, "Don't ask for the username.", NULL },
|
||||
@ -137,6 +139,26 @@ main (int argc, char *argv[])
|
||||
|
||||
g_signal_emit_by_name (op, "ask_question", "Foo\nbar", choices);
|
||||
}
|
||||
else if (show_processes)
|
||||
{
|
||||
static const char *choices[] = {
|
||||
"Yes", "No", "Sauerkraut", NULL
|
||||
};
|
||||
GArray *pids;
|
||||
GPid pid;
|
||||
|
||||
pids = g_array_new (TRUE, FALSE, sizeof (GPid));
|
||||
pid = (GPid)1000;
|
||||
g_array_append_val (pids, pid);
|
||||
pid = (GPid)2000;
|
||||
g_array_append_val (pids, pid);
|
||||
pid = (GPid)3000;
|
||||
g_array_append_val (pids, pid);
|
||||
|
||||
g_signal_emit_by_name (op, "show-processes", "Foo\nbar", pids, choices);
|
||||
|
||||
g_array_unref (pids);
|
||||
}
|
||||
else
|
||||
{
|
||||
GAskPasswordFlags flags;
|
||||
|
@ -14,7 +14,10 @@ if hasattr(os, 'add_dll_directory'):
|
||||
if path != '' and os.path.isdir(path):
|
||||
os.add_dll_directory(path)
|
||||
|
||||
import gi
|
||||
try:
|
||||
import gi
|
||||
except ImportError:
|
||||
sys.exit(77) # skip this test, gi module is not available
|
||||
|
||||
gi.require_version('Gtk', '4.0')
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
py = import('python').find_installation('python3', modules: ['gi'])
|
||||
|
||||
env = environment()
|
||||
env.prepend('GI_TYPELIB_PATH',
|
||||
project_build_root / 'gtk',
|
||||
|
Loading…
Reference in New Issue
Block a user