GMountOperation now supports options to unlock TCRYPT volumes. This
patch sets these options if they are returned by AskPassword() of a
GtkMountOperationHandlerProxy.
Otherwise we get errors on g_content_type_is_a(). This happens mostly on Windows
because it only knows a limited set of mime types and tries to convert
them to file extensions without any fallback.
open() in text mode should never be used without an encoding because it defaults
to the locale encoding which is rarely what is wanted.
This fixes the Windows build in some cases (depending on the locale/paths used)
When parsing a UI description for GtkFileFilter we should avoid passing
empty strings, to avoid issues when serialising the filter before
sending it over DBus.
Fixes: #1973
Be prepared for the eventuality that somebody
might reinsert the same action group without
holding any extra references on it.
This was observed as causing crashes in
gnome-builder.
Otherwise the native window gets created with GDK_TYPE_HINT_NORMAL
and in fullscreen appears on its own screen or tab instead of over
the combo like it's supposed to.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1737
Don't export any functions taking or returning MacOS types in
gdkquartz.h, gdkprivate-quartz.h, or any header that either includes.
The GdkQuartz internal functions are moved to a new header
gdkinternal-quartz.h, the functions used by quartz-specific
Gtk files are moved to another new header gdkquartz-gtk-only.h, and
the key and event enums to a new header gdkkeys-quartz.h.
We named the argument `position` in the code and doc arguments, but the
rest of the documentation referred to `index` instead. That was maybe
meant to hint at the child property named :index, but we can simply be
fully clear here. We can call the argument `index_`, replacing the local
variable with that name, thus avoiding any possible confusion with the
unrelated ::get-child-position, and refer users to :index for completion
`index_` is used instead of plain `index` in case anyone is #including
<strings.h> and getting the old index() function superseded by strchr();
see https://gitlab.gnome.org/GNOME/gtk/merge_requests/932#note_531149
Some users expect that the Overlay will automatically request enough
size for its overlay children as well as its main child. It doesn't,
because it's just a GtkBin. Add a short paragraph pointing that out.
Close https://gitlab.gnome.org/GNOME/gtk/issues/1939
The documentation for gtk_widget_get_action_group
and gtk_widget_list_prefixes states that both of
these operate on all the action groups that are
'available' to the widget.
Which means: they are meant to walk up the parent
muxer chain. So do that.
Add tests to verify the expected behavior.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1396
Currently, calling `gtk_entry_completion_complete()` does not adjust
the visbility of the popup used to show completion entries. This makes
it difficlt to dynamically populate the model based on what is being
entered into the completion's entry.
For example, if the model is being populated from a database, and no
matches have (yet) been added between typing a character and the 100ms
delay before completion is automatically triggered, the popup will not
be shown even after matches have been added.
This patch simply moves the related code from the private timeout method
to the public function and shuffles the position of some functions so as
to keep the compiler happy.
This is a backport of the GdkProfiler from master. It does not include
the pixel bandwidth numbers that come from gdkdrawcontext.c since there
does not seem to be an analog in 3.x.
Additionally, this implements the recent changes for SYsprof's D-Bus
profiler API which adds a Capabilities property and an options hash-table
to the D-Bus interface for forward portability.
We don't need to cover every case with a va_marshaller, but there are a
number of them that are useful because they will often only be connected
to by a single signal handler.
Generally speaking, if I opened into a file to add a va_marshaller, I just
set all of them.
This adds specific marshallers for all of the locations where a generic
marshaller is being used. It also provides va_marshallers to reduce the
chances that we get stack traces from perf going through ffi_call_unix64.
Similar to previous removals of g_cclosure_marshal_VOID__VOID we can remove
other marshallers for which are a simple G_TYPE_NONE with single parameter.
In those cases, GLib will setup both a c_marshaller and va_marshaller for
us. Before this commit, we would not get a va_marshaller because the
c_marshaller is set.
Related to GNOME/Initiatives#10
If we set c_marshaller manually, then g_signal_newv() will not setup a
va_marshaller for us. However, if we provide c_marshaller as NULL, it will
setup both the c_marshaller (to g_cclosure_marshal_VOID__VOID) and
va_marshaller (to g_cclosure_marshal_VOID__VOIDv) for us.
along with a new 'type-format' setting that allows
to choose the output format for the "Type" column.
The options implemented for this setting are:
'mime' : Output from g_content_type_get_mime_type().
'description' : Output from g_content_type_get_description().
'category' : It uses the corresponding generic icon
of the mime type to group by categories (aka basic types).
This produces a more compact output than previous options,
and allows for type families to be grouped together, so eg.
after sorting by "Type" column, jpeg and png images will
be placed together, or the various types of archiver files
will also be grouped together.
This format was copied from and currently used by Nautilus
list view, so we also improve consistency with Nautilus.
Bugzilla entry for Nautilus implementation is:
https://bugzilla.gnome.org/show_bug.cgi?id=683722
The list of type families or categories can be checked on:
https://developer.gnome.org/icon-naming-spec/#mimetypes
This 'category' format is set as default.
Issue #362
This has caused numerous issues for users, especially in the
filechooser, which have not been fixed in all the years since the pixel
cache has been introduced.
If anyone seriously has complaints about the treeview performance (and
those did not exist with the pixel cache), feel free to revert this
commit *and* fix the pixel cache issues.
Closes#503Closes#1691Closes#466
It takes half a second on my system to initially
populate the Emoji chooser. That is too long. Do
the work in 8 millisecond chunks to give GTK a
chance to get some frames done.
If the cursor coordinates are outside of the content (the GtkRBTree),
gtk_tree_view_bin_draw() will return and not draw the rubber band
rectangle.
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1859
This resulted in -DINCLUDE_IM_ti-et getting passed to gcc resulting in
lots of warnings. Use underscorify() so we get the correct -DINCLUDE_IM_ti_et instead.
We also need to ensure that we pass in -DINCLUDE_IM_xxxx when building
the GTK DLL/.so, in addition to building the respective (static)
immodules, so that we did really link in the immodules into the final
GTK DLL/.so.
Make it a yes/no/auto combo. "yes" means all modules are built into libgtk,
"no" that none are and "auto" uses the platform defaults, yes on win32,
no otherwise.
If we need more we can always extend it later.
Various adjustments to make the config.h output between autotools
and meson more similar by testing on Linux and Windows/MSYS2.
Setting things to 1 instead of true and shifting things around is motivated
by reducing the diff between the generated files.
This changes the configure option into two states:
auto: build all that can be build (default)
A list of backend names: build them and fail if we can't
"papi" is missing because it's not in Debian and I can't test it.
The autotools build uses relative filenames here while with meson
we get absolute paths. Switch to basename so we get the same result
for both and don't break reproducible builds with absolute paths
in public headers.
Build the input modules for GTK+, either as modules or built directly
into GTK. Also provide a configure option to build the specified
immodules, or all, or the backend immodule(s) or none of the immodules
into GTK. Note that for Visual Studio all immodules are built into
the GTK DLL by default, like what is done in the Visual Studio projects.
Note that building the backend immodules for Quartz, X11 and Wayland are
currently untested.
This will ensure that the version info is easily visible from the
GDK/GTK+ DLLs, and ensure that the print dialogs will have a more modern
look and feel.
Otherwise, it errors out on make distcleancheck in debian packaging
```
ERROR: files left in build directory after distclean:
./gtk/gtktypefuncs.c
make[1]: *** [Makefile:1005: distcleancheck] Error 1
```
Add private API to GDK to move these variables from the environment into
static scope. Also move the DESKTOP_STARTUP_ID validation here to reduce
code duplication.
Use constructors to read them as early as possible; however, do not
unset them until first requested. This avoids breaking gnome-shell and
gnome-settings-daemon, which want to use the DESKTOP_AUTOSTART_ID in
their own gnome-session clients.
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1761
Use existing create_page_setup() function to make a GtkPageSetup
object out of the GtkPrintSettings (which we shuttled out of W32
DEVMODE) and apply it to GtkPrintOperation is the default page
setup.
Applications (such as gedit) retrieve page setup from GtkPrintOperation
by calling gtk_print_operation_get_default_page_setup (). Therefore,
we have to set it, otherwise they will get the same page setup that
we had before the dialog was shown, and will later feed that page
setup to us again, which will cause paper size and orientation to
be always reset back to whatever the hardcoded default values were.
They're either wrong (when using FALSE because the widgets don't account
for changes to the CSS) or unnecessary (when using TRUE because it's the
default).
Fixes!1777
The above flags in combination with "-fvisibility=hidden" break the
g-i build because it results in the g-i generated dumper executable not
linking against the libraries because they are detected as unused and
thrown out.
Fix by only using -fvisibility=hidden for the library and not g-i.
Look for subdirectories named "gtk-3.x", where 'x' starts as current
minor version and counts down to 14, then drops to 0.
Only look for gtk.css in these directories though. If a theme only
provides gtk-dark.css, it won't be found.
- Rather than making labeled buttons inside lists toned down,
only tone down image buttons, so that we don't have to include
icon-only actions. Places like Software can continue using label
buttons with no change without having those less visible.
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1748
The problem here was that NSPasteboard would release the clipboard
owner if all data items were transferred. When trying to re-use this
owner at a later point, GTK+ would attempt a retain call on a released
object and crash.
Fix this by not immediately releasing the owner after declaring types,
so by keeping our own reference around.
Closes https://gitlab.gnome.org/GNOME/gtk/issues/529
It might be too late to do it at GtkApplication::add_platform_data time,
since the envvar may be consumed earlier on if gdk_display_open() happened
to be called before (eg. through gtk_get_option_group(TRUE)).
Stash the envvar in a constructor function, so its ensured to happen before
it can get consumed.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1754
This is named gdkconstructor.h to avoid any possible conflicts. This fixes
the current usages of G_HAS_CONSTRUCTORS, as that header is not installed
by glib.
CREATEPROCESS_MANIFEST_RESOURCE_ID is a macro defined in winbase.h,
so we need an include to resolve that macro to its value, 1.
Without that it stays as a literal CREATEPROCESS_MANIFEST_RESOURCE_ID,
and ends up in the .exe file as-is, and Windows can't find it by that name,
resulting in UAC manifest not working and gtk-update-icon-cache bringing
up UAC prompt.
Every time a new <INCLUDE> directive is used inside a gtk-doc
sections.txt file it overrides the current include header until the next
<INCLUDE> directive. This has the unfortunate effect of making every
single section following the print-related ones to generate
documentation that says to include gtkunixprint.h.
In order to avoid re-arranging the gtk3-sections.txt file, we can tell
gtk-doc what's the default header to include for GTK, and override it
using `@Include` directives directly into the gtk-doc stanzas of the
sections that require a different header.
Fixes: #1746
including when the control modifier is present, i.e. when one is typing
control-I for instance.
Orca would convert them back to the corresponding ASCII letter anyway, and
when pressing control-tab, we do want to pass "tab", not pass "\t" that Orca
would erroneously convert to "control-I".
Fixes#1743
If the query has a non-null location, set the scope to that directory,
otherwise set it to the local computer.
There is unfortunately no way to get Spotlight to search
non-recursively, nor does NSFileManager offer a convenient search of
the contents of a directory's regular files.
Copy documentation for gtk_clipboard_wait_for_targets from gtk/gtkclipboard.c
to quartz implementation. Primarily to add transfer container annotation as
otherwise pygobject tries to deallocate individual GdkAtoms.
Issue #1584.
In case the theme doesn't set a height/min-height for the treeview
separator the treeview drawing gets confused and draws rows on top of each
other depending on the redraw area.
This is due to gtk_tree_view_get_row_height() assuming that a node with a
height <= 0 is not set and not a separator and it will default to the
expander size.
Ideally gtk_tree_view_get_row_height() would know if it operates on a separator,
but there are too many calls/levels, so just make sure the separator height
is at least 1 (Adwaita already sets "min-height: 2px", so no change there)
GtkMenu's "accel-group" property setter, gtk_menu_set_accel_group(),
currently returns in failure if the caller passes it a NULL `accel_group`
argument. This argument is annotated with `(allow-none)`. This patch
add support for the NULL case.
When 0 or GDK_CURRENT_TIME is passed to gtk_window_present_with_time(),
print a warning so that the application developer knows that this isn't
a supported use of the function, but carry on working for now.
If the column used for the GtkTreeView:tooltip-column contains NULL
we're already skipping a tooltip; let's ignore empty strings as well,
as an empty tooltip is pretty much pointless.
Close#1681
We're using [a-z] ranges with sed and grep, and POSIX does not specify
their behaviour in non-ASCII locales:
In the POSIX locale, a range expression represents the set of
collating elements that fall between two elements in the collation
sequence, inclusive. In other locales, a range expression has
unspecified behavior
-- IEEE Std 1003.1-2017, § 9.3.5 (7)
This can lead to no results, or invalid replacements, which in turn can
lead to broken builds or broken build artifacts.
Fixes: #1662
When we receive a size from the move-to-rect implementation, force GTK
to continue using that size until reconfigured by move-to-rect, or
when remapped.
Fixes: #1651
On X11, the position of the menu is calculated synchronously by
gdk_window_move_to_rect(). This means that calculating the window size
when showing is too late, as that'd mean the size used when calculating
the position is out-of-date. The first time a menu is mapped, however,
the size is calculated during realization; but a window is only realized
once, so it doesn't work for subsequent maps.
Currently, this is harmless, as a GtkMenu can change its size however it
wants after it has been mapped. This, however, is problematic, as it
means the position calculated by gdk_window_move_to_rect() might no
longer be valid, or constraints made by the same function might no
longer be respected.
Thus, this is a preparation for making GtkMenu popups stay the same size
until they are remapped again at a later point.
Sometimes (read for GtkMenu on X11) it's not enough to resize on show,
and relying on the size to be calculated on realization only works the
first time a menu is popped up, so add an API that GtkMenu can use to
ensure the size of a menu is "refreshed" before passing anything along
to gdk_window_move_to_rect().
This causes window size guessing to always use the remembered size (the
size of the GdkWindow). This will be useful for menus which size is
managed by gdk_window_move_to_rect(), to avoid overriding the size
calculated by the move-to-rect implementation.
We don't need to do it, since g_clear_pointer() will do it for us, and
will also check if the function conforms to a GDestroyNotify. Using an
explicit cast will generate a compiler warning.
Now that we've switched the on and off states to gadgets, we need to
ensure that the widget's clip take into account the clip of every
gadget.
Fixes#1631
Improve overflow arrow buttons drawing on a scrollable dropdown menu:
reduce top button's margin-top to match size of a bottom button, add
margin-top for bottom button to compensate bottom margin (otherwise
button overlaps with menu content).
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1539
- it's less busy and still clearer without the label
- It may be right that color alone is a poor differentiator,
but labels do still exist for the accessible theme.
- create more contrast against the headerbar background without lowering
contrast with the label and border.
- top border shaded for extra aid of the state being pressed (in the two button scenatio)
Addesses issue #1588
- colorsheme based on the new icon HIG color palette
- new switches
- darker headerbar to contrast with unfocused windows
- raised buttons derived from the icon style
- create more contrast against the headerbar background without lowering
contrast with the label and border.
- top border shaded for extra aid of the state being pressed (in the two button scenatio)
Addesses issue #1588
- colorsheme based on the new icon HIG color palette
- new switches
- darker headerbar to contrast with unfocused windows
- raised buttons derived from the icon style
To avoid confusion, have the NMake Makefiles output the built introspection
files in the same location where the binaries are built for the project
files, according to the Visual Studio version, platform and configuration
where the build is carried out.
Also make generating the introspection NMake snippet portion more robust to
source additions and removals by checking on Makefile changes too.
When a popup is placed using move_to_rect(), it'll get feedback about
the position and size it got assigned. We use this feedback to update
the scroll offset, but while doing so, if the visibility of the arrow
changed, we didn't adapt the offset accordingly.
Fix this by offsetting the provided offset by the height of the arrow,
if it was made visible as a side effect of the scroll offset change
triggered by the feedback.
Related: mutter#105
Closes: #1463
A menu will be clamped to the work area as a side effect of the
move_to_rect() logic if the resize anchor flags was set. For it to work
a second time, the initial size needs to be the actual menu size before
being clamped again. Achieve this by forcing a size recalculation before
showing the menu.
Don't constrain the initial menu size by the work area of some monitor;
instead let the move_to_rect() logic in the backend do the constraining.
This fixes two things:
1) The anchor delta provided to the backend will not be invalid. The
delta is calculated by looking at the active menu item, calculating the
offset given that, but since we clamped the window size before showing
the window, the delta became invalid. This caused visible issues when
the delta was large enough to make the initially calculated popup window
geometry to be placed outside the geometry of the parent window, which
is a violation of the Wayland protocol.
2) The scroll offset to be correct when receiving the positioning
feedback. While the scroll offset was based on the pre-clamped window
size, the feedback, which was used to calculate the new offset, was not,
causing the scroll offset to be clamped as well.
We need to tell the portal what filter is supposed to be selected by
default, or it will just pick the first one, which could be wrong and
annoying.
This will require updated xdg-desktop-portal and xdg-desktop-portal-gtk
to work properly.
Fixes#1492
While the IEC power symbols have been part of Unicode since version 9.0,
released in 2016, not every font supports them.
We can use the old symbols as a fallback, as they seem to have the
better coverage, if not the best appearance.
gtk_file_chooser_set_filter() doesn't work for GtkFileChooserNative. The
code forwards added and removed filters to the delegate dialog, but
doesn't do anything to set the selected one, so the wrong one gets
chosen. So fix that.
This only fixes the fallback dialog. The portal will be fixed in a
subsequent commit.
Partial fix for #1492
When creating the motion controller, we know the widget that is of interest
based on gtk_event_controller_motion_new(). However, not all incoming
events are guaranteed to be of the GdkWindow associated to that widget.
They may also be for a descendant. Therefore, it is useful to translate
those coordinates into the target widget coordinate space as that is
likely what they care about.