Compare commits

...

477 Commits

Author SHA1 Message Date
Matthias Clasen
35b0974000 Add GtkFileDialog
Add an async API for picking a file, together with
a builder object for it. This is meant to replace direct
use of GtkFileChooserDialog.
2022-10-26 07:59:39 -04:00
Matthias Clasen
4c18b1f345 Add GtkChoice
This is an auxiliary object for use with
file chooser choices.
2022-10-26 07:54:23 -04:00
Matthias Clasen
48aa551a72 Add GtkInfoDialog
This is replacing GtkMessageDialog with an
async API for showing informational messages.
2022-10-26 07:54:23 -04:00
Matthias Clasen
c20749e2d8 wip: builder: Accept string lists for strvs
Accept
  <property name="my-strv>
    <object class="GtkStringList">
      <items>
        <item translatable="yes">One</item>
        <item translatable="yes">Two</item>
        ...
      </items>
    </object>
  </property>

Ideally, we would want to parse this without the
<object> tag, but that is much more annoying to
implement.
2022-10-26 07:54:23 -04:00
Matthias Clasen
3e8a5bbb92 Add GtkFontDialogButton
This is like GtkColorDialogButton, but for fonts.
2022-10-26 07:54:23 -04:00
Matthias Clasen
056022a54b Add GtkFontDialog
This is similar to GtkColorDialog, but for fonts.
2022-10-26 07:54:23 -04:00
Matthias Clasen
1765bdc590 Add GtkColorDialogButton
This is a new color button implementation
built around GtkColorDialog.
2022-10-26 07:54:23 -04:00
Matthias Clasen
bcd9130548 Add GtkColorDialog
Add an async API for picking a color, together with
a builder object for it. This is meant to replace direct
use of GtkColorChooserDialog.
2022-10-26 07:54:22 -04:00
Мирослав Николић
a95cfb1c45 Update Serbian translation
(cherry picked from commit b760f57ae1)
2022-10-23 09:21:37 +00:00
Matthias Clasen
799fb41937 Merge branch 'deprecation-cleanups' into 'main'
gtk-demo: Replace combo boxes in font features

See merge request GNOME/gtk!5164
2022-10-22 19:23:45 +00:00
Matthias Clasen
e6f4c596fa gtk-demo: Use global style in font_features 2022-10-22 11:38:46 -04:00
Matthias Clasen
3d7fb26588 gtk-demo: Replace combo boxes in font features
This is a slightly more complicated combo box,
so we need an auxiliary object.
2022-10-22 11:35:35 -04:00
Matthias Clasen
93f9b2d519 Merge branch 'deprecation-cleanups' into 'main'
gtk-demo: Remove deprecations from dnd

See merge request GNOME/gtk!5160
2022-10-22 02:32:23 +00:00
Matthias Clasen
6f3613a06f bloatpad: Stop using a combobox
Replace GtkComboBoxText with GtkDropDown+GtkStringList.
2022-10-21 22:03:17 -04:00
Matthias Clasen
3723778f42 fontchooser: Stop using deprecated harfbuzz api
The replacement is very straightforward.
2022-10-21 21:54:38 -04:00
Matthias Clasen
3fc3f8d2ff gtk-demo: Replace combobox in font rendering
Out with the combobox, in with the dropdown.
2022-10-21 21:48:39 -04:00
Matthias Clasen
2868f1b509 placesview: Drop deprecation guards
We got rid of all deprecated api here.
2022-10-21 21:48:39 -04:00
Matthias Clasen
f44570e71a filechooserwidget: Drop deprecation guards
We got rid of all deprecated api here.
2022-10-21 21:48:39 -04:00
Matthias Clasen
15d39dddc5 filesystemmodel: Drop outdated comments
Drop a long comment describing an implementation
that no longer exists.
2022-10-21 21:48:39 -04:00
Matthias Clasen
1028449bcc filesystemmodel: Drop unneded deprecation guards
Nothing deprecated is used here anymore.
2022-10-21 21:48:39 -04:00
Matthias Clasen
01cca279f9 searchenginemodel: Drop unneeded deprecation guards
Nothing deprecated is used here anymore.
2022-10-21 21:48:39 -04:00
Matthias Clasen
a7cae4bffa gtk-demo: Remove deprecations from characters
Make the characters demo use global style providers.
2022-10-21 21:48:39 -04:00
Matthias Clasen
3e2e29a1dc gtk-demo: Remove deprecations from sizegroup demo
Out with the comboboxes, in with the dropdowns.
2022-10-21 21:48:39 -04:00
Matthias Clasen
de069e15c2 gtk-demo: Remove deprecation from textview demo
Use a dropdown instead of a combobox for the widget
embedding. It's better!
2022-10-21 21:48:39 -04:00
Matthias Clasen
f8edefd7c0 gtk-demo: Remove deprecations from gltransitions
Make the GL transitions demo use global style providers.
2022-10-21 21:48:39 -04:00
Matthias Clasen
24a15b51fe gtk-demo: Remove deprecations from solitaire
Make the solitaire game use global style providers.
2022-10-21 21:48:39 -04:00
Matthias Clasen
1f7aba345d gtk=demo: Drop unneeded deprecation guards
Nothing deprecated in the pixbuf paintable demo.
2022-10-21 21:48:39 -04:00
Matthias Clasen
230212c59c gtk-demo: Remove deprecations from dnd
Make the dnd demo use global style providers.
2022-10-21 21:48:39 -04:00
Matthias Clasen
86f7c19b91 Merge branch 'wip/corey/file-chooser-popup' into 'main'
filechooserwidget: Fix popup issues

See merge request GNOME/gtk!5161
2022-10-22 00:36:26 +00:00
Corey Berla
e5cea4e39d filechooserwidget: Show popup when clicking on empty space
Add gesture to right click or long press in the empty space
in the FileChooserWidget.  Only show the global settings when
clicking on the empty space.
2022-10-21 13:57:21 -07:00
Corey Berla
22aca8952f filechoosercell: Select item when right click or long press 2022-10-21 13:57:15 -07:00
Corey Berla
c0e437d163 filechoosercell: Only use long press when in touch mode 2022-10-21 13:57:11 -07:00
Corey Berla
ffe97a453f filechoosercell: Claim sequence on click 2022-10-21 13:57:06 -07:00
Matthias Clasen
c09ba28b06 Merge branch 'gbsneto/filechooser-column-view' into 'main'
Port filechooser to GtkColumnView

See merge request GNOME/gtk!5108
2022-10-21 19:42:24 +00:00
Matthias Clasen
81de43eba5 Merge branch 'matthiasc/for-main' into 'main'
Bump the GLib requirement

See merge request GNOME/gtk!5158
2022-10-21 16:26:57 +00:00
Matthias Clasen
788be8b945 filesystemmodel: Fix a compiler warning 2022-10-21 12:15:36 -04:00
Matthias Clasen
0370979225 theme: Fix up padding for the file chooser
We need the padding inside the filelistcell, so that
its event controllers cover the whole area.

Introduce a .complex style class for columnviews that
achieves that, and make the filechooser use it.
2022-10-21 08:28:58 -04:00
Matthias Clasen
943014074c Bump the GLib requirement
We now use GSignalGroup, which was introduced
in GLib 2.72.
2022-10-21 07:59:47 -04:00
Matthias Clasen
c0e8523a01 filesystemmodel: Fix a compiler warning 2022-10-21 07:44:13 -04:00
Matthias Clasen
8374ebe4c4 Merge branch 'gtkcompostable-c-fix-c4013' into 'main'
gtkcomposetable.c: Fix build on non-X11

See merge request GNOME/gtk!5156
2022-10-21 11:40:52 +00:00
Chun-wei Fan
611d14108d gtkcomposetable.c: Fix build on non-X11
The build breaks with a C4013 warning/error on Visual Studio because we don't
have a prototype defined for _gtk_get_datadir(), so include gtkprivate.h.

The vs2017-x64 CI did not catch this error because it is building GLib as a
fallback subproject, causing the msvc_recommended_pragmas.h header not to be
found, which is used to detect problems like this.
2022-10-21 12:29:19 +08:00
Matthias Clasen
25cf702345 filechooser: Make search results show up
The tracker search engine implementation was not
setting all the custom attributes that we require
now.

The quartz search engine will need similar fixes.
2022-10-20 22:34:41 -04:00
Matthias Clasen
1d9c61cada filechooserwidget: Remember sort columns and order
These settings existed before, we keep using them.
This loses some information about sorting by multiple
columns, but it is sufficient to get the same primary
sort column back.
2022-10-20 22:34:41 -04:00
Corey Berla
71adb26a0d filechooserwidget: Fix time_sort_func 2022-10-20 22:34:41 -04:00
Corey Berla
e27fa33690 filechooser: Add show-time property
The "Show Time" setting does not take immediate effect (only after
changing folders) because it's set as a single call to
column_view_get_time_visible() on the FileChooserCell creation.
Instead create a bind a show-time property that gets updated
as the setting is changed.
2022-10-20 22:34:41 -04:00
Corey Berla
f7dfead861 filechoosercell: Add a GtkDragSource
Allow dragging one or more items.  If the item dragged is not part of
the current selection, only drag that item.
2022-10-20 22:34:41 -04:00
Corey Berla
aac04a0995 filechoosercell: Bind "item" and "selected" to cell 2022-10-20 22:34:41 -04:00
Corey Berla
8af191e52d filechooserwidget: Expose selection model
FileChooserCell may need to change the selection during a DND.
2022-10-20 22:34:41 -04:00
Corey Berla
06382ff836 filechooserwidget: Rename and expose get_selected_files()
GtkFileChooserCell will need this function
2022-10-20 22:34:41 -04:00
Matthias Clasen
cd469788c3 filechooserwidget: Make rename popover work
Make the rename popover operate on the file that
the context menu was opened for, and pop up at
the same position.
2022-10-20 22:34:40 -04:00
Matthias Clasen
44b5076cf2 filechooserwidget: Make context menus mostly work
Move the gestures to the individual cells, and
make them trigger the context menu via an action
that takes item position and coordinates.

The semantics are changed slightly: the menu actions
now operate on the clicked item, not on the selection.

Still to do: Fix up keyboard activation.
2022-10-20 22:34:40 -04:00
Matthias Clasen
e5be9e1035 filesystemmodel: Drop the model types
We are no longer storing extra values, so no need
to take their types in the api.
2022-10-20 22:34:40 -04:00
Matthias Clasen
b831d01f0d filesystemmodel: Drop unused arguments
Drop the unused get_func arguments in constructors.

Update all callers.
2022-10-20 22:34:40 -04:00
Matthias Clasen
278bcf2680 filechooserentry: Simplify model construction
Don't pass a get_value callback when creating the
filesystem model. It isn't called anymore, and things
continue to work.
2022-10-20 22:34:40 -04:00
Matthias Clasen
c19d0dc9ea filesystemmodel: Drop more unused api
Drop all apis that operate on tree iters.
We are no longer a tree model.
2022-10-20 22:34:40 -04:00
Matthias Clasen
edd5ed169e filesystemmodel: Drop _gtk_file_system_model_get_value
This function is unused, so drop it, and its callback.
2022-10-20 22:34:40 -04:00
Matthias Clasen
8ec9c3fdc6 filechooser: Some work on popup menus
This is a start towards placing menus properly.

We once again center keyboard-triggered menus
on the file list.
2022-10-20 22:34:40 -04:00
Matthias Clasen
e95022040f filechooser: Drop deprecated includes
We no longer use cell renderers and tree models
here. Yay.
2022-10-20 22:34:40 -04:00
Matthias Clasen
3a2ce620e2 filesystemmodel: Fix a possible problem
If the async query fails to reproduce a file info,
we still need to thaw the model, otherwise it ends
up frozen forever.

This was deduced by reading the code, I haven't
actually seen it happen.
2022-10-20 22:34:40 -04:00
Matthias Clasen
df49bf9eec filechooserwidget: Use a string sorter for names
We can use the new collation property of GtkStringSorter,
and get the benefit of sort key caching. This commit
also fixes an accidental leak of all sorters, and
removes the sorter from the location column - we never
show that column when individual colummns are sortable.
2022-10-20 22:34:40 -04:00
Matthias Clasen
53327f3aea filechooser: Drop unnecessary theme tracking
The widgets we are using handle theme changes
themselves, so there is no need for the filechooser
to do anything.
2022-10-20 22:34:40 -04:00
Matthias Clasen
c0c3d75062 filechooser: Bring back sorting
Add a sort model between the filter model and the
file system model, and set it up to sort according
to the circumstances.
2022-10-20 22:34:40 -04:00
Corey Berla
d0d0409f9d filechooserwidget: Reimplement DnD Drop Target
This reverts commit 34752a15a71597d00a8d08befc545ac1c178b81b.

Leaving out the drag source portion as that needs a total
reimplementation.  The GtkDropTarget only required minor
modifications.
2022-10-20 22:34:40 -04:00
Matthias Clasen
3a7d094542 filechooserwidget: Reinstate show_and_select_files
Now that we have information about visible and
filtered-out status of items, we can make this
function work again.
2022-10-20 22:34:40 -04:00
Matthias Clasen
280adcbb8c filechooserwidget: Add a filter model
Put a filter model between the selection model and
the filesystem model, and make it filter on the
filechooser::visible attribute. This makes the filer
combo in the filterchooser and the 'show hidden files'
item work. But we need to prod the filter to trigger
a refiltering every now and then.
2022-10-20 22:34:40 -04:00
Matthias Clasen
83431a999c filesystemmodel: Make filtering info available
Provide the filtered-out and visible bits as a file attributes
under the names filechooser::filtered-out and filechooser::visible,
so that we can filter on it.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
eeeee99aa8 filechooserwidget: Connect to the right model
When recreating the browse_files_model model, connect to that
model's item-changed signal, instead of connecting to the selection
model.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
0f503e0ba2 filechooserwidget: Connect to items-changed when changing model
Just like previous commit, we need to call list_items_changed()
even if we change from single selection to multi selection or
vice-versa.
2022-10-20 22:34:40 -04:00
Matthias Clasen
3e4ae62b44 filesystemmodel: Drop an unused include 2022-10-20 22:34:40 -04:00
Matthias Clasen
ec4f814bd4 filechooserwidget: Listen to items-changed too
To track changes of the selected items in a selection
model, we need to listen to both ::selection-changed
and ::items-changed.

This fixes the open button not turning sensitive
when initially loading a new folder.
2022-10-20 22:34:40 -04:00
Matthias Clasen
0141ba4e00 filechooser: Prevent recursion when activating items
When a list item is activated, we activate the default widget.
Unfortunately, due to some other bug, sometimes the open button
is not made sensitive, and then default.activate falls back
to activating the focus widget (which is the item we are just
coming from). Boom
2022-10-20 22:34:40 -04:00
Matthias Clasen
52ef16c21b actionmuxer: Add debug spew for action activation
This helps tracking down whe activation goes wrong.
2022-10-20 22:34:40 -04:00
Matthias Clasen
6ca7104015 filesystemmodel: Drop the tree model implementation
This is no longer used.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
07d6166ab8 filechooserwidget: Use GListModel API for post-renaming selection 2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
dc651c3dc3 filechooserentry: Use separate GtkTreeStore for completion
Soon GtkFileSystemModel will not be a GtkTreeModel implementation,
so preemptively remove any usage of this interface. Populate the
list store using the GListModel's 'items-changed' signal.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
f520801626 filesystemmodel: Retire GtkFileSystemItem
This has to be the shortest-living object in GTK history!

It helped us greatly during the transition to GtkColumnView, but
now we can remove it in favour of GFileInfo directly. Perhaps I
could have never introduced GtkFileSystemItem in the first place,
but we're 30 commits deep and it's too late to just redo the whole
thing that will get us exactly here anyway.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
4e3fbd0b0f filesystemmodel: Always set standard::file attribute
This will help us greatly when porting GtkFileSystemModel to
GtkDirectoryList.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
8a24fdea38 filesystemmodel: Trivial cleanup
Use g_set_object() which does exactly what the code there does.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
b26222b6ba filechooserutils: Add helper to get GFile from info
This will be used extensively starting from next commit!
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
c8d291ab86 filechooserentry: Trivial cleanups
Use g_clear_object() in a couple of places. No functional changes.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
0a87438432 searchenginemodel: Use GListModel API to filter
We now start a mini-series of commits that will ultimately remove
the GtkTreeModel implementation of GtkFileSystemModel.

As a first step, port GtkSearchEngineModel iter through the files
using GListModel API.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
ddf1cd6678 filechooserwidget: Remove treeview
Now that most of the treeview usage is gone, remove the remaining
code that uses it - mostly event handling code, which for now won't
work, but will be fixed by next commits - and drop the tree view
entirely.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
9c6d5e2ca5 filechooserwidget: Use GtkSelectionModel for selection
So far, GtkFileChooserWidget has relied on GtkTreeView's selection
management. This commit moves it away from GtkTreeView, and that's
a massive surgery - sorry :(

The most important aspect of this commit is that 'selection_model'
is now the main model we deal with. Changing between directories,
recent files, and search, all sets the selection_model's model.

Selections are entirely handled by GtkSelectionModel now.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
1f2561b08e filesystemmodel: Add more GtkFileSystemItem getters
They'll help us further remove GtkTreeModel code.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
d5b31a30fd filechooserwidget: Stop centering on selected files 2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
39c678988d filechooserwidget: Don't queue redraw / resize on tree view 2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
9052c191cb filechooserwidget: Compare focus against column view
This effectively doesn't work, but focus will be reworked at some
point, and this gets us a tiny bit closer to that.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
766f442636 gtkfilechooserwidget: Don't set size request 2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
27a3d2d09e filesystemmodel: Don't implement GtkTreeDragSource 2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
3a3482e41e filechooserwidget: Remove DnD code
Another case where we'll reimplement it later.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
44c37fa34a filesystemmodel: Drop GtkTreeSortable interface
Stop implementing this interface. We'll be able to reimplement
sorting once we fully transition to GListModel.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
5c41dbfaa5 filechooserwidget: Remove sorting
This will be reimplemented later using list models. For now, let's
remove it so we can untangle all this code properly.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
c9d2ff7a0f filechooserwidget: Stop autosizing treeview 2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
174af596c5 filechooserwidget: Use column view scrolled window
One less hook to treeview widgetry.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
de2624faa7 filechooserwidget: Move tooltip text to column view
Use a closure binding to query the tooltip.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
cda784a5f4 filechooserwidget: Move folder navigation to column view
React to column view's 'activate' signal, instead of treeview's
'row-activated'. It doesn't handle file sensitivity yet, but that
will probably be dropped later.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
cc33dbef03 filechooserwidget: Move keynav handling to column view 2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
ce36611c4e filechooserwidget: Set rubberbanding on column view
And stop setting it on the tree view.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
038cb31d27 filesystemmodel: Don't expose cache
With this commit we start slowly cleaning up the sattelite code
surrounding GtkFileChooserWidget, so that we eventually drop it
all.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
3b53a6b0a9 filechooserwidget: Remove extra action bar 2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
619ff2338e filechooserwidget: Move date and time to column view
Because this is the last treeview column, some pending tasks
are marked as TODO. We're getting close to dropping the tree
view!
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
2bcd6949df filechooserwidget: Move file type to column view 2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
abd78ce5f5 filechooserwidget: Move size to column view
This was one of the easier ones. We merely delegate the hard work
to g_format_size(), like we already do for treeview.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
7899fc03c4 filechooserwidget: Move location to column view
Move the entire location column, which only contains the location
renderer, to the column view. The code to generate locations from
the current folder is essentially intact.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
9984f00781 filechooserwidget: Drop name column from treeview
It is now entirely handled by the column view.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
a0d3bdc911 filechooserwidget: Move file icon to column view
This commit moves the icon loading code into a new private
widget called GtkFileThumbnail, which is bound to the GFileInfo
of the model, and asynchronously loads the file icon from that.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
b96317b872 filechooserwidget: Move file name to column view
And remove it from the tree view. Next commits will look a lot like
this, until all columns are moved.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
6c84958b9f filechooserwidget: Replace 'list' page with column view
Replace the 'list' page of the main stack with another page, this
one containing a GtkColumnView. This, again, is the very minimal
code to achieve a column view - and validate the GListModel code
introduced in the previous commit - but there's a long way until
this column view covers the full range of features of the file
chooser.

The tree view still lives in an unused 'list2' page. From now on,
commits will "cannibalize" the treeview, each commit porting any
particular feature - be it a column, an event controller, etc -
to the column view, and dropping the corresponding feature from
the treeview.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
f2559b1dbb filesystemmodel: Implement GListModel
This is a trivial implementation of the GListModel interface. It
does not do anything fancy, like filtering out hidden files, nor
sorting.

The purpose of this minimal implementation is to bootstrap the
initial work to port GtkFileChooserWidget to GtkColumnView.
2022-10-20 22:34:40 -04:00
Georges Basile Stavracas Neto
ed2ade4801 filesystemmodel: Use g_clear_* on finalize
Trivial cleanup, no functional changes.
2022-10-20 22:34:40 -04:00
Matthias Clasen
4549172825 Merge branch 'matthiasc/for-main' into 'main'
inspector: Fix accessibility calls

See merge request GNOME/gtk!5154
2022-10-21 02:28:02 +00:00
Matthias Clasen
b877804eb6 Merge branch 'completion' into 'main'
entrycompletion: Fix inserted-text handler

See merge request GNOME/gtk!4892
2022-10-21 02:13:42 +00:00
Matthias Clasen
5310abbcf7 filechooserentry: Fix completions
Before we can drop them, lets make them work.

This was broken since 4.0, I assume :(
2022-10-20 21:41:18 -04:00
Matthias Clasen
490d4b0b9e inspector: Fix accessibility calls
The argument list of gtk_accessible_update_property
is -1-terminated, not NULL-terminated.
2022-10-20 21:19:13 -04:00
Matthias Clasen
375432f0b6 Merge branch 'columnview-sorter-api' into 'main'
gtk-demo: Add more sort columns

Closes #5149

See merge request GNOME/gtk!5152
2022-10-20 19:18:26 +00:00
Matthias Clasen
c00a23ebbc Merge branch 'fix-wayland-keycode-mapping' into 'main'
wayland: Fix keycode->keyval mapping

Closes #5277

See merge request GNOME/gtk!5147
2022-10-20 19:15:38 +00:00
Matthias Clasen
4cd2e2a11f Merge branch 'ebassi/tree-deprecation-docs' into 'main'
docs: Add deprecation messages to GtkTreeStore

See merge request GNOME/gtk!5115
2022-10-20 18:39:29 +00:00
Matthias Clasen
ae7bf4dcf7 Merge branch 'wip/jtojnar/compose-consistent-system' into 'main'
Improve composetable inclusions

See merge request GNOME/gtk!5150
2022-10-20 18:28:47 +00:00
Matthias Clasen
9ed1505073 columnviewtitle: Clean up interactions
Separate the apis we use for updating title,
menu and sort indicator.
2022-10-20 13:57:33 -04:00
Matthias Clasen
e040d3663e columnviewsorter: Add public API
This API should be sufficient to serialize
a columnviews sort configuration.

Fixes: #5149
2022-10-20 13:06:45 -04:00
Matthias Clasen
6af69a7b7d Make GtkColumnViewSorter public
API is yet to come.
2022-10-20 13:01:18 -04:00
Matthias Clasen
a116e0dd26 columnviewsorter: Cosmetics 2022-10-20 13:01:18 -04:00
Matthias Clasen
3e2b962a36 columnviewcolumn: Add an ID
This string can be used when storing columnview
configuration.
2022-10-20 13:01:18 -04:00
Matthias Clasen
abb60ec579 columnviewcolumn: Remove some unused code 2022-10-20 11:44:05 -04:00
Matthias Clasen
b738d4a6ac columnviewcolumn: Cosmetics 2022-10-20 11:44:05 -04:00
Matthias Clasen
0149bd49ca gtk-demo: Add more sort columns
Add a second sort column to the Settings demo,
to make it easier to test column view sorting.
2022-10-20 11:44:05 -04:00
Emmanuele Bassi
e05157437f Add more messages to the deprecation warnings
Point to replacement types for the old GtkTree* API.
2022-10-20 15:39:07 +01:00
Emmanuele Bassi
e045e798a2 Mark GtkStyleContext type as deprecated
Add the Deprecated tag to the type docblock
2022-10-20 15:39:07 +01:00
Emmanuele Bassi
7908a72fa9 Mark GtkEntryCompletion type as deprecated
Add the Deprecated tag to the type docblock.
2022-10-20 15:39:07 +01:00
Emmanuele Bassi
593bf2bc6d Mark GtkTreeView-related types as deprecated
Add the Deprecated annotation to the type docblock.
2022-10-20 15:39:07 +01:00
Jan Tojnar
cf701d5db4 imcontextsimple: Document that Compose file support is incomplete
And that `include "%L"` does something different as introduced in
3b4b1c6878

Note that user can still use `include "/.%L"` as a workaround.
2022-10-20 16:19:13 +02:00
Emmanuele Bassi
bf8d4c5418 Mark GtkAppChooser-related types as deprecated
The type docblock needs a Deprecated annotation.
2022-10-20 14:38:31 +01:00
Emmanuele Bassi
912145c81b Mark GtkCellRenderer-related types as deprecated
The docblock for the type needs a Deprecated annotation, and we can use
it to point to the appropriate replacement.
2022-10-20 14:38:31 +01:00
Emmanuele Bassi
913127b553 Point at the replacement for GtkIconView
In the symbol annotations and in the docblocks.
2022-10-20 14:38:31 +01:00
Emmanuele Bassi
62f85e2f49 Point at the replacements for GtkTreeView
In the symbol annotations and in the docblocks.
2022-10-20 14:38:31 +01:00
Emmanuele Bassi
4b1212eb4a Point to replacement for GtkComboBoxText
GtkDropDown and GtkStringList replace GtkComboBoxText with a simpler
API.
2022-10-20 14:38:31 +01:00
Jan Tojnar
94a096ec4c composetable: Support non-FHS paths for Compose tables
On platforms like NixOS, the libX11 installation prefix may differ from /usr/share,
breaking the hardcoded placeholders. Let’s re-use the X11 path definition from imcontextsimple.
2022-10-20 12:59:17 +02:00
Emmanuele Bassi
404ee55ec4 Point to GtkDropDown as the GtkComboBox replacement 2022-10-20 11:10:57 +01:00
Emmanuele Bassi
5fbd52da49 docs: Add deprecation message for GtkListStore
Point to GListStore and list models instead.
2022-10-20 11:02:29 +01:00
Emmanuele Bassi
7bf094c117 docs: Add deprecation messages to GtkTreeStore
Point to GtkTreeListModel, and while we're at it, let's fix some of the
gtk-doc-isms that are still there.
2022-10-20 11:02:29 +01:00
Matthias Clasen
4bb79decf3 Merge branch 'label-selection-fix' into 'main'
label: Tweak selection behavior

Closes #2024

See merge request GNOME/gtk!5148
2022-10-19 21:37:08 +00:00
Matthias Clasen
60fb93e063 label: Tweak selection behavior
Arrange for double-click-followed-by-drag to do
select by words, not select-and-dnd. This matches
the behavior in GtkTextView better and feels
intuitive.

Fixes: #2024
2022-10-19 16:22:55 -04:00
Matthias Clasen
1894a8960e wayland: Fix keycode->keyval mapping
We were looping over the levels, but not using
the current level value to obtain the keymap
entries. Oops.

Fixes: #5277
2022-10-19 15:46:27 -04:00
Matthias Clasen
4ba5c90bc9 Merge branch 'filechooser-amberol' into 'main'
filechooser: Improve "Open in File Manager"

Closes #5260

See merge request GNOME/gtk!5140
2022-10-19 19:41:15 +00:00
Matthias Clasen
1d16bd7d30 Merge branch 'matthiasc/for-main' into 'main'
docs: Remove mention of ~/.gtk-4.0

Closes #3266

See merge request GNOME/gtk!5146
2022-10-19 19:11:57 +00:00
Matthias Clasen
17819ad4f6 filechooser: Improve "Open in File Manager"
Just relying on GAppInfo leads to suboptimal
results. Instead, call either the OpenURI portal
or the org.freedesktop.FileManager1 interface
directly, and only fall back to GAppInfo.

The wrapper code for the OpenURI portal is taken
from gio, with small adjustments.

Fixes: #5260
2022-10-19 15:01:21 -04:00
Matthias Clasen
ac1ea6faca docs: Remove mention of ~/.gtk-4.0
We are not looking there anymore, for a long time.

Fixes: #3266
2022-10-19 14:36:48 -04:00
Matthias Clasen
8a3f1a1fa1 Merge branch 'builder-tool-scope' into 'main'
docs: Update gtk4-builder-tool docs

See merge request GNOME/gtk!5145
2022-10-19 18:34:25 +00:00
Matthias Clasen
46c7c0c4e6 docs: Document new buildertool options 2022-10-19 13:36:14 -04:00
Matthias Clasen
dd60a9abd6 buildertool: Support enumerating callbacks
The new scope approach makes this easy, and
it can be useful to know what functions are
needed.
2022-10-19 13:36:14 -04:00
Matthias Clasen
50835ffbf6 buildertool: Improve validate implementation
Reimplement deprecation checking via a scope.
This lets us ignore missing callbacks, and helps
for validating templates.
2022-10-19 13:36:14 -04:00
Matthias Clasen
637713fe72 buildertool: Add a builder scope implementation
This will be used in future commits.
2022-10-19 13:36:14 -04:00
Matthias Clasen
7e71c868ab buildertool: Use --deprecations for templates
Use this option for templates too.

We still can't parse most templates, since they are
missing their callbacks.
2022-10-19 13:36:14 -04:00
Matthias Clasen
aaf5c43e78 Merge branch 'matthiasc/for-main' into 'main'
docs: Update gtk4-builder-tool docs

See merge request GNOME/gtk!5144
2022-10-19 17:13:23 +00:00
Matthias Clasen
5fb6f0e410 Merge branch 'wip/clipboard-serials' into 'main'
gdk/wayland: Use serial of the latest implicit grab available

Closes #5250

See merge request GNOME/gtk!5143
2022-10-19 13:57:19 +00:00
Matthias Clasen
cd031de680 docs: Update gtk4-builder-tool docs
Mention the new --deprecations option of the
validate command.
2022-10-19 08:50:34 -04:00
Carlos Garnacho
eeda25ab04 gdk/wayland: Use serial of the latest implicit grab available
When getting the serial for primary/clipboard selections we used a
function that largely relied on a GdkEvent being passed. We have
another available function that looks up the most recent serial
given the ongoing touch/tablet input as well.

This is the second best, compared to actually knowing the
input/device from the event that was received by the UI an triggered
the clipboard operation, and is already in use in other places
(e.g. window dragging). It is valid for these situations too.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5250
2022-10-19 13:54:07 +02:00
Matthias Clasen
acaf04a24e Merge branch 'builder-deprecations' into 'main'
buildertool: Fix template handling

Closes #5256

See merge request GNOME/gtk!5141
2022-10-19 11:20:37 +00:00
Matthias Clasen
bcabe77799 buildertool: Warn about deprecations
Add a new option --deprecations to the validate
command that will warn about use of deprecated types.

The list of current deprecations is unfortunately
hardcoded in the source, so this list will have to
be kept up-to-date.

Fixes: #5256
2022-10-19 02:51:29 -04:00
Matthias Clasen
64cf31f348 buildertool: Fix template handling
We were not properly parsing the error message
here, leading to badness.
2022-10-19 02:51:29 -04:00
Matthias Clasen
e037155a94 Merge branch 'text-overwrite-undo' into 'main'
testsuite: Fix tiff pixbuf tests

Closes #4411

See merge request GNOME/gtk!5138
2022-10-19 05:59:13 +00:00
Matthias Clasen
55cbb8a8d6 Merge branch 'clarify-gapplication-docs' into 'main'
docs: Clarify a point in GtkApplication docs

See merge request GNOME/gtk!5139
2022-10-19 03:54:36 +00:00
Matthias Clasen
db599f2ae6 Merge branch 'fix-pixbuf-tiff-tests' into 'main'
testsuite: Fix tiff pixbuf tests

Closes #4615

See merge request GNOME/gtk!5137
2022-10-19 03:53:08 +00:00
Matthias Clasen
741567868e Merge branch 'modelbutton-tooltip' into 'main'
widgetfactory: Add text to iconic model buttons

Closes #5220

See merge request GNOME/gtk!5136
2022-10-19 03:51:21 +00:00
Matthias Clasen
1e5e0480fd text: Make overwrite undo-friendly
In overwrite mode, every typed character gets
handled as a delete+insert, but we should not
record these as two individually undoable
steps.

This matches how we handle overwrite mode in
GtkTextView.

Fixes: #4411
2022-10-18 23:49:16 -04:00
Matthias Clasen
917aa7928d docs: Clarify a point in GtkApplication docs
Clarify that loading of automatic resources uses
the resource base path that was set at construction
time.

Fixes: #4300
2022-10-18 23:47:48 -04:00
Matthias Clasen
cd4dbd67a2 testsuite: Skip known-broken tests
The tiff pixbuf tests fail because of known
issues with the pixbuf tiff loader. Skip them.

Fixes: #4615
2022-10-18 23:22:47 -04:00
Matthias Clasen
5a6eab05e9 testsuite: Fix tiff pixbuf tests
This test wasn't actually testing what it claims,
since that functionality is broken in gdk-pixbuf.

Test it anyway.
2022-10-18 23:21:28 -04:00
Matthias Clasen
55ccaf9df9 modelbutton: Set up tooltips
Use the text of iconic model buttons as tooltip.

Fixes: #5220
2022-10-18 22:35:28 -04:00
Matthias Clasen
af0e056eec widgetfactory: Add text to iconic model buttons
We want to use this for tooltips in the future.
2022-10-18 22:35:02 -04:00
Matthias Clasen
77d1f0d982 Merge branch 'matthiasc/for-main' into 'main'
fontchooser: Drop a few errant translations

Closes #5146

See merge request GNOME/gtk!5135
2022-10-19 01:53:56 +00:00
Matthias Clasen
d4d7d5eafd fontchooser: Drop a few errant translations
No point in translating these properties, they
are not strings.

Fixes: #5146
2022-10-18 16:40:37 -04:00
Matthias Clasen
f658027c51 Merge branch 'fix-editable-label-spurious-focus-out' into 'main'
window: Keep a reference to move_focus_widget

Closes #4864

See merge request GNOME/gtk!5134
2022-10-18 19:45:19 +00:00
Matthias Clasen
7be993b728 editablelabel: Defer changes on focus-out
We can get spurious focus-out/-in pairs when
the editable label is in a popover that gets
a Wayland keyboard enter event as a result of
clicking the editable label.

A timeout isn't a great solution, but nothing
better is available right now.

Fixes: #4864
2022-10-18 14:23:22 -04:00
Matthias Clasen
e1d78821f6 window: Keep a reference to move_focus_widget
If we don't take a reference, it can happen that
the pointer is no longer valid by the time we
dereference it in after_paint.
2022-10-18 14:23:11 -04:00
Matthias Clasen
94ac1af293 Merge branch 'fix-focus-changes' into 'main'
window: Fix focus updates

Closes #4903

See merge request GNOME/gtk!5127
2022-10-18 11:02:08 +00:00
Matthias Clasen
b4db48935d Merge branch 'fix-windows-build-testmountoperation' into 'main'
tests/testmountoperation.c: Fix build on Windows

See merge request GNOME/gtk!5126
2022-10-18 10:53:21 +00:00
Matthias Clasen
f5063c1435 window: Don't focus invisible widgets
Only clear a queued move_focus if the widget
we are focusing is actually visible.

This was happening in some cases when popovers
are dismissed by clicking outside, and it was
causing us to miss proper focus updates that
were already queued.
2022-10-18 06:42:17 -04:00
Benjamin Otte
8092a6858e Merge branch 'bilelmoussaoui/gi-deprecated' into 'main'
g-i: Fix deprecated version of GtkTreeView

See merge request GNOME/gtk!5131
2022-10-18 09:53:53 +00:00
Bilal Elmoussaoui
0fbaeaabd0 g-i: Fix deprecated version of GtkTreeView 2022-10-18 11:27:39 +02:00
Luca Bacci
995f00d23f Merge branch 'forward-port-mr-991-to-gtk4-2' into 'main'
Use native Windows API for converting keystrokes to characters

Closes #2944

See merge request GNOME/gtk!4986
2022-10-17 19:20:08 +00:00
Matthias Clasen
100605ef0c window: Fix focus updates
This partially undoes changes from 3dbf5038fa.

That commit did two things:
1) Move the focus update to after-paint time
2) Change from grabbing focus to the visible parent
   to  calling move_focus (TAB)

The second part did have the unintended consequence
of moving focus laterally.

Fixes: #4903
2022-10-17 15:10:41 -04:00
Benjamin Otte
1246cd5e73 Merge branch 'wip/otte/for-main' into 'main'
singleselection: Be more careful about notifies

See merge request GNOME/gtk!5129
2022-10-17 18:34:40 +00:00
Benjamin Otte
f30e59fed9 dropdown: Handle ::selected and ::selected-item separately
GtkSingleSelection will only emit either of those signals if they
change. But it is possible that only one of those properties changes,
and in those cases we want to only notify for that property changing in
the dropdown, too.
2022-10-17 20:11:27 +02:00
Benjamin Otte
5e8b294faf singleselection: Be more careful about notifies
We don't want to notify::selected or notify::selected-item if they
didn't change.
This will bring performance benefits on frequently changing lists.

In particular, if lists get filtered or reordered, but the selected item
stays in the list, not doing a notify::selected-item will avoid updates
in connected handlers like GtkDropdown (and its handlers), thereby
avoiding lots of unnecessary updates.
2022-10-17 20:11:27 +02:00
Philip Zander
c84c469b78 Use native Windows API for converting keystrokes to characters 2022-10-17 19:36:48 +02:00
Chun-wei Fan
1a5a65acd0 tests/testmountoperation.c: Fix build on Windows
Sadly, we can't just use an interger for a GPid on Windows, so just cast
it.  Sounds silly for non-Windows, but that's life...
2022-10-17 12:36:17 +08:00
Matthias Clasen
6f5d18a9f5 macos: Fix clipboard data size handling
We were using the allocated memory size, not
the amount of data that has been written.

Fixes: #5261
2022-10-16 23:45:28 -04:00
Matthias Clasen
004f22a51c Merge branch 'matthiasc/for-main' into 'main'
Rename gtk_widget_get_style_color

See merge request GNOME/gtk!5125
2022-10-17 03:26:21 +00:00
Matthias Clasen
d775caff7f Rename gtk_widget_get_style_color
This name wasn't everybody's favorite, so go with
the generic name gtk_widget_get_color() instead.
2022-10-16 21:41:43 -04:00
Piotr Drąg
baf3a3eecd Update POTFILES.in 2022-10-16 14:34:34 +02:00
Benjamin Otte
ca2e14788d Merge branch 'antoniof-main-patch-03677' into 'main'
columnview: Don't be focusable

See merge request GNOME/gtk!5022
2022-10-14 22:39:49 +00:00
Matthias Clasen
c57d8fc6be Merge branch 'gtk_widget_get_style_color-docs-fix' into 'main'
Fix documentation for `gtk_widget_get_style_color()`

See merge request GNOME/gtk!5119
2022-10-14 10:49:15 +00:00
Sebastian Dröge
294e5bb79f Fix documentation for gtk_widget_get_style_color()
It was pointing at `gtk_widget_get_css_style()` instead.
2022-10-14 12:36:11 +03:00
Matthias Clasen
bde19f9b2a Fix blank popovers
This was a typo in 2b00b64e8c, making
us render the background on the wrong snapshot.
2022-10-13 16:38:41 -04:00
Matthias Clasen
1d2071b892 NEWS: Updates 2022-10-12 23:27:36 -04:00
Matthias Clasen
b46eb5c20a Merge branch 'matthiasc/for-main' into 'main'
filechooser: Update the settings docs

See merge request GNOME/gtk!5118
2022-10-13 03:09:47 +00:00
Matthias Clasen
3d605615ce filechooser: Update the settings docs
Document the window-position setting as unused.
2022-10-12 22:47:51 -04:00
Matthias Clasen
c502d7fca6 Merge branch 'matthiasc/for-main' into 'main'
docs: Add a cross-reference

See merge request GNOME/gtk!5117
2022-10-13 02:43:48 +00:00
Matthias Clasen
9f8abc5d74 docs: Add a cross-reference
Note that GtkTreeView is deprecated and link to the
list view introduction from 'Tree and List Widget Overview'.
2022-10-12 22:26:40 -04:00
Matthias Clasen
c8cbb3fbba Merge branch 'matthiasc/for-main' into 'main'
filechooserentry: Add a set_text api

See merge request GNOME/gtk!5116
2022-10-13 02:25:19 +00:00
Matthias Clasen
fa3c8ed5f9 filechooser: Stop using entrycompletion api
The file chooser entry now has an api for this.
2022-10-12 21:59:35 -04:00
Matthias Clasen
8ac5f1983e filechooserentry: Add a set_text api
This function prevents the completion popup
from coming up when setting the entry text.
2022-10-12 21:59:19 -04:00
Matthias Clasen
eccc02d084 Merge branch 'matthiasc/for-main' into 'main'
Start a migration guide for GTK 5

See merge request GNOME/gtk!5114
2022-10-12 21:02:56 +00:00
Matthias Clasen
0c94db7147 Start a migration guide for GTK 5
No need to panic, GTK 5 is still years away!
But it is good to write this material down while
it is fresh in mind.
2022-10-12 16:39:28 -04:00
Matthias Clasen
ed87473bf9 Merge branch 'deprecate-render' into 'main'
wip: Deprecate gtk_render apis

See merge request GNOME/gtk!5100
2022-10-12 20:38:19 +00:00
Matthias Clasen
812a879ec2 inspector: Use gtk_widget_get_style_color
The graph renderer in the statistics page needs
the CSS foreground color to draw the graph. Use
the just introduced api for it.
2022-10-12 15:35:00 -04:00
Matthias Clasen
5627542d7c Add gtk_widget_get_style_color
There is a widespread need to access the CSS foreground
color for custom drawing in snapshot functions, so make
it available after gtk_style_context_get_color was
deprecated with a new widget api.
2022-10-12 15:35:00 -04:00
Matthias Clasen
f42fe500c9 cssnode: Avoid style context api
Duplicate the print flags in gtkcssnodeprivate.h,
so we don't rely on gtkstylecontext.h here.
2022-10-12 15:35:00 -04:00
Matthias Clasen
ac3177ce95 tests: Ignore deprecations
Some of our tests use deprecated style context api.
Most of them should be ported to use global style
providers eventually. For now, ignore deprecations.
2022-10-12 15:35:00 -04:00
Matthias Clasen
ccaaff406f testsuite: Ignore deprecations
Some of our tests use deprecated style context
apis. Ignore the deprecations for now.
2022-10-12 15:35:00 -04:00
Matthias Clasen
b1ec43ae33 demos: Ignore deprecations
Most of these demos should be ported to use
global style providers eventually. For now,
just ignore the deprecations.
2022-10-12 15:35:00 -04:00
Matthias Clasen
ee8c2a235f stylecontext: Deprecate most apis
The notable exception here are the global provider apis,
which are needed in some form and don't have a replacement
yet. Move them to gtkstyleprovider.[hc], so we can wholly
deprecated gtkstylecontext.[hc].
2022-10-12 15:35:00 -04:00
Matthias Clasen
299fbfd722 tests: Ignore deprecations for render api 2022-10-12 15:35:00 -04:00
Matthias Clasen
5f54ecdf2c aboutdialog: Stop using gtk_style_context_save 2022-10-12 15:35:00 -04:00
Matthias Clasen
e09138ce45 textview: Stop using gtk_style_context_save_to_node 2022-10-12 15:35:00 -04:00
Matthias Clasen
a71893f88b text: Stop using gtk_style_context_save_to_node 2022-10-12 15:35:00 -04:00
Matthias Clasen
01324ffaff label: Stop using gtk_style_context_save_to_node 2022-10-12 15:35:00 -04:00
Matthias Clasen
c354465ed8 scrolledwindow: Stop using gtk_style_context_save_to_node 2022-10-12 15:35:00 -04:00
Matthias Clasen
50ab2386ec printunixdialog: Stop using gtk_style_context_save_to_node 2022-10-12 15:35:00 -04:00
Matthias Clasen
bf9f362597 popover: Stop using gtk_style_context_save_to_node 2022-10-12 15:35:00 -04:00
Matthias Clasen
d03ee57cc5 flowbox: Stop using gtk_style_context_save_to_node 2022-10-12 15:35:00 -04:00
Matthias Clasen
6f24bd9ff4 demos: Ignore deprecations for render apis
Eventually, this demo should probably be removed.
2022-10-12 15:35:00 -04:00
Matthias Clasen
616e0a0d32 textview: Stop using gtk_snapshot_render api
The gtk_snapshot_render api is deprecated, so avoid using it.
2022-10-12 15:35:00 -04:00
Matthias Clasen
ee76105119 text: Stop using gtk_snapshot_render api
The gtk_snapshot_render api is deprecated, so avoid using it.
2022-10-12 15:35:00 -04:00
Matthias Clasen
381f863a18 label: Stop using gtk_snapshot_render api
The gtk_snapshot_render api is deprecated, so avoid using it.
2022-10-12 15:35:00 -04:00
Matthias Clasen
57c63d9ce7 Use the new caret rendering api
Implement the deprecated gtk_snapshot_render api
for carets with the new one.
2022-10-12 15:35:00 -04:00
Matthias Clasen
0522dade9f Add gtk_css_style_snapshot_caret 2022-10-12 15:35:00 -04:00
Matthias Clasen
484cff2182 glarea: Stop using gtk_snapshot_render api
The gtk_snapshot_render api is deprecated, stop using it.
2022-10-12 15:35:00 -04:00
Matthias Clasen
dd3c371c08 inscription: Stop using gtk_snapshot_render api
The gtk_snapshot_render api is deprecated, so avoid using it.
2022-10-12 15:35:00 -04:00
Matthias Clasen
3145bce6a1 render: Use the new layout render api 2022-10-12 15:35:00 -04:00
Matthias Clasen
73f991a7fd Add gtk_css_style_snapshot_layout
This function renders a PangoLayout at a given
position, using text shadows and color from css.
2022-10-12 15:35:00 -04:00
Matthias Clasen
0205caa371 scrolledwindow: Port to the gtk_css_style_snapshot api
The gtk_snapshot_render api is deprecated, so avoid using it.
2022-10-12 15:35:00 -04:00
Matthias Clasen
c2c46a7036 printunixdialog: Port to the gtk_css_style_snapshot api
The gtk_snapshot_render api is deprecated, so avoid using it.
2022-10-12 15:35:00 -04:00
Matthias Clasen
2b00b64e8c popover: Port to the gtk_css_style_snapshot api
The gtk_snapshot_render api is deprecated, so avoid using it.
2022-10-12 15:35:00 -04:00
Matthias Clasen
4e2522a080 iconview: Port to the gtk_css_style_snapshot api
The gtk_snapshot_render api is deprecated, so avoid using it.
2022-10-12 15:35:00 -04:00
Matthias Clasen
473065dfeb flowbox: Port to the gtk_css_style_snapshot api
The gtk_snapshot_render api is deprecated, so avoid using it.
2022-10-12 15:35:00 -04:00
Matthias Clasen
60dafebd91 Deprecate gtk_snapshot_render apis
Move the implementations from gtksnapshot.c to
gtk/deprecated/gtkrender.c and deprecated these
functions. We want to get rid of them.

These functions are still used in some of our widgetry,
so use G_GNUC_BEGIN/END_IGNORE_DEPRECATIONS around
them.
2022-10-12 15:35:00 -04:00
Matthias Clasen
35370752d5 Deprecate gtk_render apis
These take a GtkStyleContext as argument, and we
want to get rid of GtkStyleContext eventually.
The proper drawing api these days is gtk_snapshot.
2022-10-12 15:35:00 -04:00
Matthias Clasen
808d00906c printunixdialog: Stop using gtk_render_ apis
These are getting deprecated.
2022-10-12 15:35:00 -04:00
Matthias Clasen
da5d5bd71f popover: Stop using gtk_render_background
The gtk_render_ apis are getting deprecated.
2022-10-12 15:34:59 -04:00
Matthias Clasen
0c99e69423 flowbox: Stop using gtk_render_background
The gtk_render_ apis are getting deprecated.
2022-10-12 15:34:59 -04:00
Matthias Clasen
410813eb6b Merge branch 'deprecate-all-the-cells' into 'main'
Deprecate treeviews and cell renderers

See merge request GNOME/gtk!5098
2022-10-12 19:28:04 +00:00
Luca Bacci
6cc44eb0fe Merge branch 'for-master' into 'main'
For master

See merge request GNOME/gtk!5095
2022-10-12 13:56:51 +00:00
Matthias Clasen
11ee930b9d Merge branch 'inspector_a11y' into 'main'
GtkInspector: make the inspector at least a little bit more accessible

See merge request GNOME/gtk!5109
2022-10-12 11:06:35 +00:00
Matthias Clasen
69e4c9b01e tests: Ignore deprecations
Eventually, most of these tests should be dropped.
2022-10-11 17:18:21 -04:00
Matthias Clasen
c32fed9238 testsuite: Ignore deprecations
For now, just ignore deprecations. Eventually,
we will have to go through, drop demos that are
for wholly deprecated widgets, and update others.
2022-10-11 17:18:21 -04:00
Matthias Clasen
4941ef659f tools: Ignore deprecations
For now, just ignore deprecations. Eventually,
we will have to go through and drop code that is
dealing with widgets that are going away.
2022-10-11 17:18:21 -04:00
Matthias Clasen
6efb18330f demos and examples: Ignore deprecations
For now, just ignore deprecations. Eventually,
we will have to go through, drop demos that are
for wholly deprecated widgets, and update others.
2022-10-11 17:18:21 -04:00
Matthias Clasen
5e256590db Deprecate treeviews and cell renderers
This includes

GtkCellArea
GtkCellAreaBox
GtkCellAreaContext
GtkCellEditable
GtkCellRenderer
GtkCellRendererAccel
GtkCellRendererCombo
GtkCellRendererPixbuf
GtkCellRendererProgress
GtkCellRendererSpin
GtkCellRendererSpinner
GtkCellRendererText
GtkCellRendererToggle
GtkCellView
GtkComboBox
GtkComboBoxText
GtkIconView
GtkListStore
GtkTreeModel
GtkTreeModelFilter
GtkTreeModelSort
GtkTreeStore
GtkTreeView
GtkTreeViewColumn
GtkTreeSelection
2022-10-11 17:18:21 -04:00
Matthias Clasen
79303d7cd3 inspector: Drop an unused file 2022-10-11 17:18:21 -04:00
Matthias Clasen
681a818af2 flowbox: Stop using gtk_render_background
The gtk_render_ apis are getting deprecated.
2022-10-11 17:18:21 -04:00
Matthias Clasen
933b1eb4df Merge branch 'filename-sorter' into 'main'
stringsorter: Add a collate-mode property

See merge request GNOME/gtk!5111
2022-10-11 20:59:08 +00:00
Matthias Clasen
c419b57754 stringsorter: Fix up a doc typo
gi-docgen links can be tricky to get right.
2022-10-11 15:32:05 -04:00
Matthias Clasen
05323869d7 stringsorter: Add more detail to the docs
Mention when a collation value of NONE might
be useful.
2022-10-11 14:09:21 -04:00
Matthias Clasen
2520148ebb Apply 2 suggestion(s) to 2 file(s) 2022-10-11 17:53:26 +00:00
Matthias Clasen
a06a4ad59a ci: Allow macos builds to fail
The runner seems busted, so allow builds to fail
for now.
2022-10-11 13:43:36 -04:00
Matthias Clasen
141aac1a60 stringsorter: Add a collation property
The new property lets us choose between
Unicode collation, filename collation, and
plain strcmp.

This will be used in the filechooser.
2022-10-11 13:42:00 -04:00
Lukáš Tyrychtr
8a1578ede8 GtkInspector: make the inspector at least a little bit more accessible
Namely, it adds accessible name to the property value editors and to a few labels in the a11y panel.
2022-10-11 13:34:53 +02:00
Matthias Clasen
8ba7840528 Merge branch 'wip/corey/file-clipboard' into 'main'
gdkcontentserializer: Use newlines for file separators

Closes #5240

See merge request GNOME/gtk!5107
2022-10-10 21:13:28 +00:00
Corey Berla
3168a3e086 gdkcontentserializer: Use newlines for file separators
Use newlines rather than spaces to separate file paths (or uri's)
when serializing text/plain files.  There isn't a matching
deserializer, so we can do this in isolation.  Newlines
seem to make more sense when pasting into a text editor etc.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5240
2022-10-10 13:27:07 -07:00
Matthias Clasen
3cf9149129 Merge branch 'matthiasc/for-main' into 'main'
Matthiasc/for main

See merge request GNOME/gtk!5106
2022-10-10 03:29:41 +00:00
Matthias Clasen
7c8a098852 emojicompletion: Drop an unused include 2022-10-09 23:08:55 -04:00
Matthias Clasen
ecbdb3104a emojichooser: Drop an unused include 2022-10-09 23:03:43 -04:00
Matthias Clasen
c8a332b3af searchentry: Drop an unused include 2022-10-09 23:03:36 -04:00
Matthias Clasen
b5f7d57124 Merge branch 'matthiasc/for-main' into 'main'
gtk-demo: Modernize accordion demo

See merge request GNOME/gtk!5105
2022-10-09 14:26:58 +00:00
Benjamin Otte
0db5c7f421 testgtk: Use global css provider 2022-10-09 10:13:44 -04:00
Benjamin Otte
ed83272f35 tests: Use per-screen CSS providers 2022-10-09 10:13:10 -04:00
Benjamin Otte
20b49e7c34 gtk-demo: Modernize accordion demo 2022-10-09 10:09:59 -04:00
Matthias Clasen
6a6ef0f437 Merge branch 'matthiasc/for-main' into 'main'
inspector: Fix some criticals

See merge request GNOME/gtk!5104
2022-10-09 13:53:54 +00:00
Benjamin Otte
32ef462f1d fontbutton: Use attributes for custom font
Don't try to use CSS.
2022-10-09 09:10:39 -04:00
Matthias Clasen
b895360f49 inspector: Fix some criticals
This is fallout from the recent porting to GtkColumnView.
2022-10-09 09:10:39 -04:00
Matthias Clasen
c2c094e8a1 Merge branch 'matthiasc/for-main' into 'main'
widget: Changing the scale does no longer require a redraw

See merge request GNOME/gtk!5103
2022-10-09 13:10:24 +00:00
Benjamin Otte
d4d0192405 widget: Changing the scale does no longer require a redraw
It doesn't require one generally anyway, because only the root can
change scale and when that happens the root will queue a redraw.

But even if the root doesn't queue a redraw, render nodes (the only
thing discarded by queue_draw()) are scale-independant.
2022-10-09 08:50:32 -04:00
Matthias Clasen
15ea36e7fd Merge branch 'matthiasc/for-main' into 'main'
glarea: Drop an unused include

See merge request GNOME/gtk!5102
2022-10-09 12:49:42 +00:00
Matthias Clasen
692279586a Merge branch 'main' into 'main'
GtkPaned: Fix symbol names in code example

See merge request GNOME/gtk!5101
2022-10-09 12:22:08 +00:00
Matthias Clasen
9eec475dcc glarea: Drop an unused include
We are not using gtk_render apis here.
2022-10-09 08:10:12 -04:00
Tilo Villwock
661130d429 GtkPaned: Fix symbol names in code example 2022-10-08 13:49:10 +02:00
Matthias Clasen
68b73ebf91 Merge branch 'matthiasc/for-main' into 'main'
paperdialog: Drop an unused function

See merge request GNOME/gtk!5099
2022-10-08 03:01:24 +00:00
Matthias Clasen
08c0020ac3 placesview: Stop using GtkEntryCompletion
We want to get rid of tree models and cell renderers,
and that includes GtkEntryCompletion. The functionality
here is really not that essential.
2022-10-07 22:22:36 -04:00
Matthias Clasen
ac87c72797 paperdialog: Drop an unused function
This gets rid of a GtkListStore use.
2022-10-07 22:03:15 -04:00
Matthias Clasen
5be8710774 Merge branch 'inspector-trees' into 'main'
inspector: Stop using GtkTreeView for css nodes

See merge request GNOME/gtk!5097
2022-10-07 21:55:10 +00:00
Matthias Clasen
5fa027ab8a cssnode: Drop the node-added/-removed signals
These are no longer used, and the children-observer
listmodel is a better approach for monitoring the
children.
2022-10-07 17:21:04 -04:00
Matthias Clasen
dbe04adb1a inspector: Drop the css node tree model
This is not used anymore.
2022-10-07 17:17:41 -04:00
Matthias Clasen
6815f3af6d inspector: Stop using GtkTreeView for css nodes
Replace the css node tree with a GtkColumnView, using
the new gtk_css_node_observe_children api.
2022-10-07 15:54:02 -04:00
Matthias Clasen
f8357512d0 Add gtk_css_node_observe_children 2022-10-07 15:54:01 -04:00
Luca Bacci
8bfc19e7f7 GtkFileChooserNativeWin32: Add some option flags
Avoid changing the current directory.
Also avoid creating a sample file to test if the target file
can be created.

References:

* "Why does the common file dialog change the current directory?"
 -> https://devblogs.microsoft.com/oldnewthing/20101112-00/?p=12293

* "Why does the common file save dialog create a temporary file and then delete it?"
 -> https://devblogs.microsoft.com/oldnewthing/20140429-00/?p=1123
2022-10-07 19:06:09 +02:00
Luca Bacci
d6f7449636 GdkWin32: Return TRUE when processing WM_XBUTTONDOWN/UP messages
As documented on MSDN:

> Unlike the WM_LBUTTONUP, WM_MBUTTONUP, and WM_RBUTTONUP messages, an
> application should return TRUE from this message if it processes it.
2022-10-07 19:05:29 +02:00
Luca Bacci
f4286e8f1a GdkWin32: Use gdk_pixbuf_read_pixels () where applicable
This is an optimization in case of reading unmodifiable GdkPixbufs.
Also replace uses of GLib integral types with <stdlib.h> integral
types.
2022-10-07 19:05:29 +02:00
Matthias Clasen
14e6fd1f12 Merge branch 'wroy-main-patch-03767' into 'main'
Add subproject/libjpeg-turbo.wrap

Closes #5237

See merge request GNOME/gtk!5094
2022-10-07 16:00:36 +00:00
William Roy
2e57621fc5 Add subproject/libjpeg-turbo.wrap 2022-10-07 14:48:49 +00:00
Matthias Clasen
4a8ae3a20c Merge branch 'inspector-trees' into 'main'
inspector: Stop using GtkTreeView for statistics

See merge request GNOME/gtk!5093
2022-10-07 05:57:02 +00:00
Matthias Clasen
61393fdcce inspector: Stop using GtkTreeView for statistics
GtkTreeView is heading towards deprecation; use
a GtkColumnView instead.
2022-10-07 01:40:51 -04:00
Matthias Clasen
6ed6cebcf4 inspector: Fixup
We were overlooking a transfer full here.
2022-10-07 00:12:47 -04:00
Jürgen Benvenuti
2f764f6c18 Update German translation
(cherry picked from commit 52dd917c6a)
2022-10-06 20:48:36 +00:00
Matthias Clasen
a646e50019 Merge branch 'main' into 'main'
Treat XKB_MOD_NAME_LOGO as super key

Closes #4913

See merge request GNOME/gtk!5088
2022-10-06 10:41:56 +00:00
Po Lu
e967dfed2d Treat XKB_MOD_NAME_LOGO as super key 2022-10-06 11:19:31 +04:00
Matthias Clasen
2dc33a9de1 Merge branch 'matthiasc/for-main' into 'main'
gdk: Cosmetics

See merge request GNOME/gtk!5087
2022-10-06 03:48:36 +00:00
Matthias Clasen
7c5e1c6195 gtk: Rename some private headers
Improve the consistency of our private header
naming, by add 'private' to a bunch of them.
2022-10-05 23:01:28 -04:00
Matthias Clasen
8607312fef gdk: Cosmetics
Add a define for each renderer.
2022-10-05 23:01:28 -04:00
Matthias Clasen
abac891bd2 Merge branch 'inspector-trees' into 'main'
inspector: Stop using a treeview for css properties

See merge request GNOME/gtk!5086
2022-10-06 02:52:12 +00:00
Matthias Clasen
2e25a13fc0 Merge branch 'matthiasc/for-main' into 'main'
mountoperation: Add a mnemonic to a button

See merge request GNOME/gtk!5085
2022-10-06 02:15:16 +00:00
Matthias Clasen
7a2c4e8a38 inspector: Stop using a treeview for css properties
Treeviews are heading towards deprecation.
2022-10-05 22:12:57 -04:00
Matthias Clasen
90e0ace325 inspector: Cosmetics 2022-10-05 21:20:04 -04:00
Matthias Clasen
9a2a5d9c8b mountoperation: Add a mnemonic to a button
This is a good practice, even if this is a rarely
used dialog.
2022-10-05 20:14:09 -04:00
Matthias Clasen
d4dd0dcd79 Merge branch 'accessible_range_interface' into 'main'
Introduce GtkAccessibleRange

See merge request GNOME/gtk!5066
2022-10-05 11:33:56 +00:00
Matthias Clasen
d454586927 Review fixes 2022-10-05 11:13:21 +00:00
Matthias Clasen
1917b6a0a3 Merge branch 'matthiasc/for-main' into 'main'
inspector: Use more compact list styles

See merge request GNOME/gtk!5083
2022-10-05 10:14:04 +00:00
Matthias Clasen
a924b820c2 inspector: Use more compact list styles
Use the same style classes throughout for
data lists that benefit from smaller fonts.
2022-10-04 23:25:12 -04:00
Matthias Clasen
9e82d2b843 Merge branch 'inspector-menus' into 'main'
Drop unused includes

See merge request GNOME/gtk!5082
2022-10-05 03:11:41 +00:00
Matthias Clasen
ab7a04d89f inspector: Stop using a treeview for menus
Replace this with a GtkColumnView.
2022-10-04 22:49:05 -04:00
Matthias Clasen
a377f95aac Drop unused includes
This gets rid of treeview includes in a number of places.
2022-10-04 22:49:05 -04:00
Matthias Clasen
4356e0c3ce Merge branch 'mountoperation-trees' into 'main'
mountoperation: Survive on Wayland

See merge request GNOME/gtk!5081
2022-10-05 02:48:39 +00:00
Matthias Clasen
5d5de9f759 mountoperation: Don't use a treeview
Port the process list from GtkTreeView
to GtkListView, and fix a number of broken
things along the way.
2022-10-04 21:26:07 -04:00
Matthias Clasen
e1f69ea278 testmountoperation: Test process dialog
Without this, it is hard to trigger the
dialog. Event with this, we have to force
GtkMountOperation to use its own dialog.
2022-10-04 21:26:07 -04:00
Matthias Clasen
6a76fe41c6 mountoperation: Survive on Wayland
The code was assuming it is dealing with an
X11 display, and trigger assertions. Fix that
to make it work at least as well as it does
on Windows.
2022-10-04 21:26:07 -04:00
Matthias Clasen
aae82d7992 Merge branch 'inspector-trees' into 'main'
inspector: Don't use treeviews in the recorder

See merge request GNOME/gtk!5080
2022-10-04 20:54:10 +00:00
Matthias Clasen
ca576e877f inspector: Don't use treeviews in the recorder
Replace the event and render node details views with
columnviews.
2022-10-04 16:26:28 -04:00
Alexander Shopov
bc23038848 Update Bulgarian translation
(cherry picked from commit 2ca2a15637)
2022-10-04 18:07:24 +00:00
Matthias Clasen
43e8730acd Merge branch 'inspector-fixes' into 'main'
inspector: Fix some lifecycle issues

See merge request GNOME/gtk!5079
2022-10-04 15:34:53 +00:00
Piotr Drąg
c43def5fce Update POTFILES.in 2022-10-04 15:20:57 +02:00
Matthias Clasen
e68b365fa1 inspector: Fix some lifecycle issues
The template use in the inspector was not properly
disposing all widgets. gtk_widget_dispose_template
will only unparent widgets that have been named
as template children, so we need to make the toplevel
elements in the ui file named children, or manually
dispose them. This commit does the former.
2022-10-04 07:10:35 -04:00
Matthias Clasen
3867f9b8ea Merge branch 'deprecate-entry-completion' into 'main'
Deprecate GtkEntryCompletion

See merge request GNOME/gtk!5078
2022-10-04 03:35:26 +00:00
Matthias Clasen
0b20c57867 Merge branch 'deprecate-app-choosers' into 'main'
Deprecate app choosers

See merge request GNOME/gtk!5077
2022-10-04 03:28:09 +00:00
Matthias Clasen
7e9ca5b41d Deprecate GtkEntryCompletion
We want to drop cell renderers and tree models
in GTK 5. The functionality of GtkEntryCompletion
may be replaced by a new widget in GTK 5.
2022-10-03 23:23:56 -04:00
Matthias Clasen
a527a4d82e Deprecate the app chooser widgets
These are a family of pretty specialized widgets, and
are very rarely used. Instead of porting them away
from GtkTreeView and GtkComboBox, deprecate them.
2022-10-03 23:02:09 -04:00
Matthias Clasen
adfc29968a Revert "gtk: Use gnome.mkenums_simple"
This reverts commit 11829fe7d0.

The mkenums_simple function can't properly handle headers
in subdirectories currently, so go back to the template
version.
2022-10-03 22:20:07 -04:00
Benjamin Otte
e17e94d2da Merge branch 'oh-no-my-docs' into 'main'
Remove outdated docs

See merge request GNOME/gtk!5076
2022-10-03 22:21:48 +00:00
Benjamin Otte
9af3bb8dc1 Remove outdated docs
There are a lot of automatic conversions in the blame log.
2022-10-03 21:12:42 +00:00
Matthias Clasen
998dd11cbd Merge branch 'wip/jimmac/combobox-lists' into 'main'
stylesheet: sync combox with other popovers

Closes #5221

See merge request GNOME/gtk!5074
2022-10-03 21:02:25 +00:00
António Fernandes
9cb8d21cb5 columnview: Forward all focus to child
For the same reasoning as the preceding commit.

Also don't make GtkColumnView focusable. Its internal list view
is already focusable, which is enough to take care of the empty
view case.
2022-10-03 20:48:10 +01:00
António Fernandes
4fc4298920 listbase: Grab focus on items instead of container
The container view itself being focusable makes keyboard navigation
slower by adding a useless focus step.

It also means if an item gets removed, the focus jumps back to the view,
instead of jumping to the next item, as seen in nautilus bug report:
https://gitlab.gnome.org/GNOME/nautilus/-/issues/2489

Instead of making the GtkListBase container itself focusable, override
the .grab_focus() vfunc. This way, calling gtk_widget_grab_focus() on
the view container keeps working sucessfully, but focuses the focus
item directly instead.

This is particularly useful to have because applicaiton authors do
not have direct acess to this class's children, so they can't call
gtk_widget_grab_focus() on them directly.
2022-10-03 20:26:24 +01:00
Corey Berla
230188fb30 entrycompletion: Use GSignalGroup on the entry's buffer
We connect to the inserted-text signal for the entry's buffer.
During the lifetime of the entry, the buffer changes.  This is
literally the example used for GSignalGroup in the docs.
2022-10-03 10:40:27 -07:00
Jakub Steiner
a96c75ff02 stylesheet: sync combox with other popovers
- use the same lists style as everything else (menus, sidebars ...)

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5221
2022-10-03 15:43:07 +02:00
Carlos Garnacho
1b4ed00509 Merge branch 'evince_crash_popover_motion2' into 'main'
fix crash in gtk_synthesize_crossing_events()

Closes #5190

See merge request GNOME/gtk!5052
2022-10-03 12:19:35 +00:00
Fabio Tomat
a54284b629 Update Friulian translation
(cherry picked from commit 6387863256)
2022-10-03 08:35:56 +00:00
Goran Vidović
ee9e9bb3e1 Update Croatian translation 2022-10-02 14:05:29 +00:00
Aleksandr Melman
cae9689281 Update Russian translation 2022-10-01 15:40:59 +00:00
Emin Tufan Çetin
1f6e2cf291 Update Turkish translation 2022-10-01 14:57:10 +00:00
Zurab Kargareteli
69a76054e8 Update Georgian translation 2022-10-01 10:17:09 +00:00
Emmanuele Bassi
31fea11255 a11y: Drop GtkAccessibleRange.get_minimum_increment()
MinimumIncrement is an AT-SPI-ism that has no counterpart in the ARIA
specification, so it should not live inside public API. Additionally,
it's not really a useful method because it collapses two values on the
adjustment API.

The only method in the GtkAccessibleRange interface should be the
set_current_value(), which allows ATs to control the current position in
a ranged widget.

The AT-SPI implementation can now use all the accessible properties,
including the VALUE_TEXT one, mapped to the Text property on the
AtSpi.Value interface.
2022-09-30 18:36:02 +01:00
Emmanuele Bassi
5dd7e24806 Clean up GtkAccessibleRange
Coding style and documentation fixes.
2022-09-30 16:58:00 +01:00
Goran Vidović
848dc78112 Update Croatian translation 2022-09-30 12:05:09 +00:00
Matthias Clasen
e9d7cd3a48 Merge branch 'wip/handle-zero-bounds' into 'main'
Fix shrinking windows when suspending

See merge request GNOME/gtk!5069
2022-09-30 11:26:29 +00:00
Jonas Ådahl
b3a3a6ceb1 toplevel-size: Report zero bounds as infinite
Empty/zero bounds are sent by the Wayland compositor if there are no
valid bounds to report, e.g. if there are no connected monitors. Report
this to GTK, which uses this to clamp calculated sizes, as INT_MAX, so
that clamping isn't done until there are actual valid bounds to clamp
to.

This fixes clients sometimes shrinking to their minimum size during
hotplugs or after having suspended the session.
2022-09-30 09:31:40 +02:00
Jonas Ådahl
148c133674 surface/wayland: Handle no current monitor when calculating bounds
We shouldn't assume there is always a monitor to derive bounds from.
If there is no monitor, pass empty bounds, as this matches what
xdg_toplevel.configure_bounds do in this case.
2022-09-30 09:31:40 +02:00
Asier Sarasua Garmendia
d2c9cbba4f Update Basque translation 2022-09-29 16:55:20 +00:00
Balázs Úr
8b33900e1d Update Hungarian translation 2022-09-29 16:43:31 +00:00
Nart Tlisha
0c3572312a Update Abkhazian translation 2022-09-29 15:19:37 +00:00
Lukáš Tyrychtr
7e683ed89b Use proper version specifier 2022-09-29 09:55:10 +02:00
Lukáš Tyrychtr
7fb892460a Document that this will be available only in GTK 4.10 2022-09-29 09:36:09 +02:00
Lukáš Tyrychtr
d517804acd Actually use the AccessibleRange interface 2022-09-29 09:36:09 +02:00
Lukáš Tyrychtr
ce761122b2 Implement also for GtkPaned 2022-09-29 09:36:09 +02:00
Lukáš Tyrychtr
76a5354ad7 Implement GtkAccessibleRange for GtkScaleButton 2022-09-29 09:36:08 +02:00
Lukáš Tyrychtr
006b473c0c Improve documentation 2022-09-29 09:36:08 +02:00
Lukáš Tyrychtr
5e1af6d7d5 Implement GtkAccessibleRange for GtkProgressBar 2022-09-29 09:36:08 +02:00
Lukáš Tyrychtr
ec0cd4a994 Implement GtkAccessibleRange for GtkLevelBar 2022-09-29 09:36:08 +02:00
Lukáš Tyrychtr
86864d7bc0 Account for GtkAccessibleRange implementations which do not have a
minimum step and it makes no sense for them to set the current value
2022-09-29 09:36:08 +02:00
Lukáš Tyrychtr
485ffcde38 Implement GtkAccessibleRange for GtkSpinButton 2022-09-29 09:36:08 +02:00
Lukáš Tyrychtr
0304eaec94 Implement GtkAccessibleRange for GtkRange 2022-09-29 09:36:08 +02:00
Lukáš Tyrychtr
a7814a0963 Introduce GtkAccessibleRange
This introduces GtkAccessibleRange, an interface which allows the accessibility backend to work with a control which can adjust a value.
2022-09-29 09:36:08 +02:00
Zurab Kargareteli
160a83023a Update Georgian translation 2022-09-28 18:33:41 +00:00
Matthias Clasen
911abe2d2c Fix expected test output
The major.minor version number shows up in the expected
output of this test, so it needs to be adjusted at the
beginning of every cycle.
2022-09-28 13:32:40 -04:00
Matthias Clasen
0c02573c47 Add 4.10 version macros 2022-09-28 13:30:01 -04:00
Matthias Clasen
4257e1ce4f Post-release version bump
This is an experiment to see if I can keep up with
doing post-release version bumps, so git snapshots
will always have a different version from released
tarballs.

This commit also marks the beginning of the 4.10
development cycle, as 4.8 has been branched.
2022-09-28 13:19:49 -04:00
Matthias Clasen
39bc13c8a7 Merge branch 'matthiasc/for-main' into 'main'
Add more names to sources

See merge request GNOME/gtk!5064
2022-09-28 17:02:09 +00:00
Matthias Clasen
dd7cd6ffdd Add more names to sources
This helps with identifying things in sysprof logs,
and while debugging.
2022-09-28 12:37:21 -04:00
Matthias Clasen
349cda3d36 Merge branch 'post-install' into 'main'
meson: Remove post-install script

See merge request GNOME/gtk!5063
2022-09-28 16:21:49 +00:00
Xavier Claessens
48cc56081d meson: Remove post-install script
GTK depends on Meson >= 0.60 so it was never used.
2022-09-28 11:25:43 -04:00
Matthias Clasen
aa9a7a931d Merge branch 'wip/carlosg/shuffle-reset-take2' into 'main'
gtkimcontextwayland: Shuffle full resets after IM changes

Closes #5200

See merge request GNOME/gtk!5050
2022-09-28 01:39:49 +00:00
Matthias Clasen
3aee45de28 Merge branch 'wroy-main-patch-32519' into 'main'
Fix #5211: Preprocessor conformance with MSVC

Closes #5211

See merge request GNOME/gtk!5058
2022-09-28 01:39:15 +00:00
Matthias Clasen
5f469d8903 Merge branch 'broadway-device-query-state-fix' into 'main'
GTK4 gdk/broadway: correct gdk_broadway_device_query_state() to return pointer coordinates relative to the upper left corner of surface

See merge request GNOME/gtk!5053
2022-09-28 01:38:45 +00:00
Matthias Clasen
2ce2e90205 Merge branch 'fix-scale-crashes' into 'main'
scale: Fix a typo

See merge request GNOME/gtk!5061
2022-09-28 01:22:49 +00:00
Matthias Clasen
8b76cc841d scale: Fix a typo
We want to update the label size request when
the adjustment changes, not when anything else
changes.

This may be the reason for crash reports like
https://retrace.fedoraproject.org/faf/problems/bthash/?bth=1e5cc1318358d5db298e5d6c2ec47361922cce74
2022-09-27 21:03:56 -04:00
Aurimas Černius
75b1d75751 Updated Lithuanian translation 2022-09-27 22:40:49 +03:00
Hugo Carvalho
2d19a1f1ec Update Portuguese translation 2022-09-27 19:39:53 +00:00
Rafael Fontenelle
e57d005076 Update Brazilian Portuguese translation 2022-09-27 13:10:05 +00:00
Matthias Clasen
31d483dfbc Apply 1 suggestion(s) to 1 file(s) 2022-09-27 11:31:55 +00:00
Martin
fc2cb9d063 Update Slovenian translation 2022-09-27 08:03:24 +00:00
Fran Dieguez
91cc03a81a Update Galician translation 2022-09-27 06:22:18 +00:00
Benjamin Otte
67049c3261 Merge branch 'wip/otte/for-main' into 'main'
drop target: Warn about broken signal handler returns

See merge request GNOME/gtk!5060
2022-09-27 02:07:21 +00:00
Benjamin Otte
c98cea3dbb drop target: Warn about broken signal handler returns
Signal handlers ust return their preferred action and that one must be
unique.

Shout at them if they don't do that, before gdk_drop_status() does
tesame thing.

Related: gnome-build-meta#554
Related: gnome-builder#1799
2022-09-27 03:50:29 +02:00
Emmanuele Bassi
0a67ac6d47 Merge branch 'left-right-typo' into 'main'
Fix GtkSettings docs typo

See merge request GNOME/gtk!5059
2022-09-26 22:23:29 +00:00
Mitchell Hentges
f8c0d86d6c Fix GtkSettings docs typo
"left of right" should be "left or right".
There's a small (subjective?) English nit in there as well: I believe
that buttons are placed (for example) "on the right" rather than "at the
right".
2022-09-27 00:00:30 +02:00
William Roy
872e04f94e Fix preprocessor conformance with MSVC 2022-09-26 19:52:57 +00:00
Goran Vidović
d5c60438d1 Update Croatian translation 2022-09-26 19:30:45 +00:00
Anders Jonsson
60788913da Update Swedish translation 2022-09-26 18:28:19 +00:00
Matthias Clasen
f01118f2fc Merge branch 'kjellahl/gtkprintbackendlpr' into 'main'
gtkprintbackendlpr.c: Add #include "gtkprivate.h"

See merge request GNOME/gtk!5057
2022-09-26 18:22:21 +00:00
Kjell Ahlstedt
9db812ea7f gtkprintbackendlpr.c: Add #include "gtkprivate.h"
Necessary after GTK_NOTE was replaced by GTK_DEBUG.
GTK_DEBUG is defined in gtk/gtkprivate.h. GTK_NOTE was defined
in gtk/gtkdebug.h.
2022-09-26 18:38:06 +02:00
Piotr Drąg
d538e78d8a Update Polish translation 2022-09-26 18:01:02 +02:00
Yuri Chornoivan
ba0499a803 Update Ukrainian translation 2022-09-26 14:54:56 +00:00
Matthias Clasen
1318fdc52c Merge branch 'fix_4577' into 'main'
Make the presentation of the stack sidebar listbox nicer for A11Y

Closes #4577

See merge request GNOME/gtk!4661
2022-09-26 14:41:29 +00:00
Luca Bacci
d3c50fad6c Merge branch 'gdk-win32-fix-subclassing-gdk-win32-clipdrop' into 'main'
GdkWin32: Fix subclassing for GdkWin32Clipdrop

Closes #5207

See merge request GNOME/gtk!5055
2022-09-26 12:59:17 +00:00
Luca Bacci
e2219858ae GdkWin32: Fix subclassing for GdkWin32Clipdrop
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5207
2022-09-26 14:34:24 +02:00
Matthias Clasen
85043a2d1b Merge branch 'bump-meson-req' into 'main'
Bump the meson requirement

See merge request GNOME/gtk!5051
2022-09-25 17:24:53 +00:00
Piotr Drąg
cac813bbc4 Update POTFILES.in 2022-09-25 14:10:28 +02:00
Nelson Benítez León
94a4c2cb40 fix crash in gtk_synthesize_crossing_events()
Update ancestor between GTK_CROSSING_OUT and
GTK_CROSSING_IN as it may have changed.

Fixes #5190
2022-09-24 21:25:05 -04:00
Matthias Clasen
11829fe7d0 gtk: Use gnome.mkenums_simple
This lets us avoid template files, and works just as well.
2022-09-24 21:23:00 -04:00
Matthias Clasen
455eefa854 gdk: Use gnome.mkenums_simple
This lets us avoid template files, and works just as well.
2022-09-24 21:22:53 -04:00
Matthias Clasen
0f4f90d722 Bump the meson requirement
GLib requires meson 0.60 nowadays, and it does not
make much sense for us to support an older meson.
2022-09-24 20:07:03 -04:00
Matthias Clasen
cefb0a3eb8 Merge branch 'header-cleanup' into 'main'
Header cleanup

See merge request GNOME/gtk!5049
2022-09-24 14:23:39 +00:00
Matthias Clasen
bc661a8ed5 gdk: Rename gdkpixbuf-drawable.c
There is nothing particularly specific to drawables
in there (and we don't have that concept anymore),
so just name the source file to match the header.
Easier for everybody.
2022-09-24 10:03:37 -04:00
Matthias Clasen
9ff549799d gdk: Tweaks to keyname handling
Rename the private header to follow our naming
conventions, and drop the extra gdkkeys.c file.
2022-09-24 10:03:37 -04:00
Matthias Clasen
e499a09759 Drop gtkintl.h
Include gtkprivate.h for I_() and glib-i18n.h for
gettext macros.
2022-09-24 10:03:37 -04:00
Carlos Garnacho
fb280e47d6 gtkimcontextwayland: Shuffle full resets after IM changes
Doing reset() on the text widgets after commit and delete_surrounding
is still too eager for some IMs (e.g. those that expect being able
to commit text while keeping a preedit buffer shown).

However, reset() is more of a "synchronize state" action on Wayland,
and it is still desirable to do that after changes that do come from
the IM (e.g. requesting the new surrounding text and cursor/anchor
positions). Notably here, the text_input protocol may still come up
with a preedit string after this state synchronization happens.

Shuffle the code so that the text widgets do not reset() the IM
context after text is deleted or committed, but the Wayland IM does
apply its practical effects after these actions happen. This keeps
the Wayland IM fully up-to-date wrt text widget state, while not
altering the ::commit and ::delete-surrounding-text behavior for
other IM context implementations.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5200
Fixes: 5b78fe2721 (gtktextview: Also reset IM context after IM...)
Fixes: 7c0a395ff9 (gtktext: Also reset IM context after IM...)
Fixes: 52ac71b972 (gtktextview: Shuffle the places doing IM reset)
Fixes: 9e29739e66 (gtktext: Shuffle the places doing IM reset)
2022-09-24 11:52:16 +02:00
Matthias Clasen
4aabc45685 Drop gdkintl.h
This header was merely including gi18n-lib.h.
Just do that directly.
2022-09-23 23:33:42 -04:00
Matthias Clasen
a8af7caae1 Rename gdk-private.h to gdkprivate.h
The extra - does not add any value.
2022-09-23 23:23:27 -04:00
Matthias Clasen
7d2c296357 Rename gdkconstructor.h to gdkconstructorprivate.h
This is the naming convention for private headers.
2022-09-23 23:14:08 -04:00
Matthias Clasen
c24a69549d Rename gdkdebug.h to gdkdebugprivate.h
This is the naming convention for private headers.
2022-09-23 23:12:01 -04:00
Matthias Clasen
f141da6b55 gtk: Dissolve gtk-autocleanup.h
Move the autocleanup declarations into their
respective headers.
2022-09-23 23:07:43 -04:00
Matthias Clasen
3688ece655 gsk: Dissolve gsk-autocleanup.h
Move the autocleanup declarations into their
respective headers.
2022-09-23 19:50:09 -04:00
Matthias Clasen
61a51dea7b gdk: Dissolve gdk-autocleanup.h
Move the autocleanup declarations into their
respective headers.

While we are at it, correct the autocleanup
declaration for GdkEvent to use gdk_event_unref,
not g_object_unref. Oops
2022-09-23 19:49:58 -04:00
Matthias Clasen
bccb4f87be Merge branch 'debug-envvars-cleanup' into 'main'
Clean up debug env vars

See merge request GNOME/gtk!5044
2022-09-23 23:06:47 +00:00
Matthias Clasen
52b6dbf2b4 gtk: Remove old debug macros
These are no longer used.
2022-09-23 18:51:46 -04:00
Matthias Clasen
f33f55bcbb gtk: Use the new debug macros 2022-09-23 18:12:39 -04:00
Matthias Clasen
f4d3f45c16 gtk: Introduce new debug macros
Introduce GTK_DISPLAY_DEBUG() and GTK_DEBUG(), which
mirror the new macros in gdk. They use the same helper
function gdk_debug_message().
2022-09-23 18:12:39 -04:00
Matthias Clasen
1e65d6640f tests: Rewrite the icontheme tests
The lookup order tests were relying on out
debug spew using g_log, so they can redirect
the output by setting a log writer function.

Rewrite this to use g_test_subprocess() and
parse stderr.
2022-09-23 18:12:39 -04:00
Matthias Clasen
8a4fd30797 gsk: drop old debug macros
These are no longer used.
2022-09-23 18:11:48 -04:00
Matthias Clasen
9818ec4ad9 gsk: Use the new debug macros 2022-09-23 18:11:48 -04:00
Matthias Clasen
4d08eb264d gsk: Introduce new debug macros
Introduce GSK_RENDERER_DEBUG() and GSK_DEBUG(), which
mirror the new macros in gdk. They use the same helper
function gdk_debug_message().
2022-09-23 18:11:48 -04:00
Matthias Clasen
bc159207bd gdk: Drop old debug macros
Drop the old GDK_NOTE() and GDK_DISPLAY_NOTE()
macros from gdkdebug.h. Reintroduce them in the
win32 backend, where they are still used.
2022-09-23 18:11:48 -04:00
Matthias Clasen
1f166ae071 macos: Use the new debug macros 2022-09-23 18:11:48 -04:00
Matthias Clasen
ce4c2154f4 x11: Use the new debug macros 2022-09-23 18:11:48 -04:00
Matthias Clasen
71fedee85d wayland: Use the new debug macros 2022-09-23 18:11:48 -04:00
Matthias Clasen
90c2b548e5 broadway: Use the new debug macros 2022-09-23 18:11:48 -04:00
Matthias Clasen
1d48f96fc5 gdk: Use the new debug macros 2022-09-23 18:11:48 -04:00
Matthias Clasen
10255eee72 Introduce new debug macros
Introduce GDK_DISPLAY_DEBUG() and GDK_DEBUG() and
the helper function gdk_debug_message(). This is
meant to clean up the mess of our current debug
statements which wildly mix g_message, g_print
and g_printerr.
2022-09-23 18:11:48 -04:00
Matthias Clasen
5b2568e9e4 Merge branch 'wip/jimmac/backdrop-titles' into 'main'
theme: tone down unfocused title labels

Closes #4468

See merge request GNOME/gtk!5047
2022-09-23 17:27:08 +00:00
Jakub Steiner
be6413b0e7 theme: tone down unfocused title labels
- mimic libadwaita in toning down unfocused titles. Cargo culting the
  filter instead of using normal opacity property.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4468
2022-09-23 17:01:24 +02:00
Matthias Clasen
15d1c86b2c Merge branch 'wip/carlosg/touchpad-gestures-matching-fingers' into 'main'
gtkgesture: Do not update gestures with mismatching n-points on touchpad

See merge request GNOME/gtk!5046
2022-09-23 14:37:58 +00:00
Marek Černocký
dd47e3bcab Updated Czech translation 2022-09-23 16:22:41 +02:00
Carlos Garnacho
872534e763 gtkgesture: Do not update gestures with mismatching n-points on touchpad
Check that the touchpad gesture event has a matching number of fingers before
updating the GtkGesture point tracking, instead of afterwards. Avoids pointless
tracking of these touchpad events when we know beforehand that the gesture
will never be activated by the touchpad events.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/5199
2022-09-23 16:04:32 +02:00
Marek Černocký
d351cbbcea Updated Czech translation 2022-09-23 15:57:50 +02:00
Matthias Clasen
6c95547c3f docs: Some updates
Make the section about environment variables match
current code.

Add a warning about env vars not being stable and
only for debugging.
2022-09-21 21:59:33 -04:00
Matthias Clasen
c7a7e550dc Only print supported debug flags
It is a bit disorienting to print a lot of unavailable
debug flags, with some working ones mixed in. Just show
the ones that work.
2022-09-21 21:51:58 -04:00
Matthias Clasen
ee1a634c25 Mark the invert-text-dir flag as always there
This flag works in non-debug builds too.
2022-09-21 21:47:06 -04:00
Matthias Clasen
55ab99cb98 Make GL flavor flags always available
No need to restrict this to debug builds.
2022-09-21 21:29:34 -04:00
Matthias Clasen
f50b0a0bcb Make the gl-debug debug flag always available
No need to restrict this to debug builds.
2022-09-21 21:17:16 -04:00
Matthias Clasen
01054c9c79 Make the gl-gles debug flag always available
No need to restrict this to debug builds.
2022-09-21 21:12:22 -04:00
Matthias Clasen
8bd3ec2ba1 Make the gl-legacy debug flag always available
No need to restrict this to debug builds.
2022-09-21 21:09:08 -04:00
Matthias Clasen
e08a9ea9ad Drop the gl-texture-rect debug flag
This was not doing anything.
2022-09-21 21:05:25 -04:00
Matthias Clasen
1987398ec5 Drop the software-gl debug flag
This was not doing anything.
2022-09-21 21:03:40 -04:00
Matthias Clasen
fa0fc9acb8 Make the gl-disable flag always available
No need to restrict this to debug builds.
2022-09-21 20:57:22 -04:00
Matthias Clasen
fa1c461c13 Make the portals debug flag always available
No need to restrict this to debug builds.
2022-09-21 20:55:46 -04:00
Matthias Clasen
a99b05525d Make the nograbs flag always available
No need to restrict this to debug builds.
2022-09-21 20:53:46 -04:00
Matthias Clasen
a337b21a4f Make vulkan-disable always available
There is no need to restrict this to debug builds.
2022-09-21 20:51:35 -04:00
Matthias Clasen
1b96828667 Make vulkan-validate always available
There is no need to restrict this debug builds.
2022-09-21 20:49:53 -04:00
Matthias Clasen
7785c18c56 Fix high-depth handling
We mark this flag as always available, but we
were only checking it in debug builds.
2022-09-21 20:47:26 -04:00
Matthias Clasen
183709c522 Fix default-settings handling
This is meant to be always available, but we
were checking for debug in one place.
2022-09-21 20:45:43 -04:00
Emmanuele Bassi
458bf674ad Merge branch 'windows-build-instructions-link' into 'main'
Update GTK on Windows link: use gtk.org, not wiki

See merge request GNOME/gtk!5043
2022-09-21 21:06:23 +00:00
Matthias Clasen
3016edbe72 Merge branch 'font-chooser-docs' into 'main'
fontchooser: Add some details to the docs

See merge request GNOME/gtk!5041
2022-09-21 18:57:58 +00:00
Mitchell Hentges
fa554a8e85 Update GTK on Windows link: use gtk.org, not wiki
The old wiki page has a couple issues:
* It's out-of-date, not having any notes for GTK4 specifically,
  and it doesn't link to `gvsbuild`, which (I believe) is
  the current official (and best) way to build GTK with MSVC.
* It's "locked", so it's harder for contributors to update. This
  is OK, except for one spicy detail:
* It's not clear how to contribute/report issues on the locked wiki
  pages, so out-of-date information falls off the radar.

Regardless :) the gtk.org GTK for Windows docs are a much better
springboard, in my opinion.
2022-09-21 20:12:21 +02:00
Matthias Clasen
5b03f5c531 fontchooser: Add some details to the docs 2022-09-21 09:39:06 -04:00
Maxim Zakharov
2acd10d7b0 gdk/broadway: correct gdk_broadway_device_query_state() to return pointer
coordinates relative to the upper left corner of surface
2022-09-21 15:42:40 +10:00
Matthias Clasen
a012f5bddb Merge branch 'cross-gi-docgen-detection' into 'main'
build: fix gi-docgen detection in cross builds

See merge request GNOME/gtk!5039
2022-09-20 10:58:45 +00:00
Michal Vasilek
98796d4513 build: fix gi-docgen detection in cross builds
gi-docgen is supposed to be ran natively on the build machine, without
native: true dependency() searches for gi-docgen on the host system.
When it doesn't find it, it falls back to a subproject even if gi-docgen
is available on the build machine.

also make gtk_doc require introspection
2022-09-20 01:27:26 +02:00
Matej Urbančič
2bbf7d267a Update Slovenian translation 2022-09-19 19:50:27 +00:00
Bruce Cowan
266d72a82f Update British English translation 2022-09-19 15:17:18 +00:00
Matthias Clasen
873c437235 Merge branch 'wip/smcv/shifted-shortcuts' into 'main'
gdkevents: Don't ignore modifiers that are not currently active

Closes #5095

See merge request GNOME/gtk!5037
2022-09-19 13:55:10 +00:00
Matthias Clasen
15e0f3e8c6 Merge branch 'wip/smcv/reliable-gresource' into 'main'
build: Use more conservative GResource embedding on non-x86_64

Closes #5107

See merge request GNOME/gtk!4956
2022-09-19 13:30:22 +00:00
Martin
af2a4d4a91 Update Slovenian translation 2022-09-19 08:38:02 +00:00
Sabri Ünal
d4e2f23287 Update Turkish translation 2022-09-18 08:21:42 +00:00
Baurzhan Muftakhidinov
332bd868f5 Update Kazakh translation 2022-09-18 04:56:54 +00:00
Simon McVittie
60a83a51c3 build: Use more conservative GResource embedding on non-x86_64
Doing clever things with objcopy is faster and seems to be reliable on
x86_64 Linux, but also doesn't work on all toolchains and architectures:
in particular, Debian has had trouble with this on arm and mips.
In a distro build environment where we are compiling all of GTK every
time, the cost of potentially unreliable builds is higher than the cost
of using slower but more conservative GResource embedding.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/5107
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-09-17 21:50:38 +01:00
Simon McVittie
79285bd63e gdkevents: Don't ignore modifiers that are not currently active
The X11 backend can mark modifiers like Shift as consumed even if they
aren't actually active, which seems to be something to do with making
shortcuts like `<Control><Shift>plus` and `<Control>plus` work as
intended regardless of whether the plus symbol is obtained by pressing
Shift and a key (like `+/=` on American, British or French keyboards)
or not (like `*/+` on German keyboards).

However, this can go badly wrong when the modifier is *not* pressed.
For example, terminals normally have separate bindings for `<Control>c`
(send SIGINT) and `<Control><Shift>c` (copy). If we disregard the
consumed modifiers completely, when the X11 backend marks Shift as
consumed, pressing Ctrl+c would send SIGINT *and* copy to the clipboard,
which is not what was intended.

By masking out the members of `consumed` that are not in `state`, we
get the same interpretation for X11 and Wayland, and ensure that
keyboard shortcuts that explicitly mention Shift can only be triggered
while holding Shift. It continues to be possible to trigger keyboard
shortcuts that do not explicitly mention Shift (such as `<Control>plus`)
while holding Shift, if the backend reports Shift as having been
consumed in order to generate the plus keysym.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/5095
Bug-Debian: https://bugs.debian.org/1016927
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-09-17 19:40:53 +01:00
Matthias Clasen
3a941eff4a 4.8.1 2022-09-16 12:29:33 -04:00
Matthias Clasen
65adcec82f Merge branch 'detect-stylus' into 'main'
Recognize "stylus" devices as GDK_SOURCE_PEN

Closes #4394

See merge request GNOME/gtk!4776
2022-09-16 12:12:37 +00:00
Matthias Clasen
ffb6f39715 Merge branch 'fix-filetransfer-mimetype' into 'main'
portal: Use the right mimetype for file transfers

Closes #5182

See merge request GNOME/gtk!5033
2022-09-16 00:35:13 +00:00
Matthias Clasen
9a16269747 Merge branch 'wip/abono/gtk-main-remove-condition' into 'main'
gtk/main: Remove condition that always evaluates TRUE

See merge request GNOME/gtk!5031
2022-09-15 19:24:04 +00:00
Matthias Clasen
32f55a74b0 portal: Use the right mimetype for file transfers
The filetransfer protocol says to use
application/vnd.portal.filetransfer, but I used
application/vnd.portal.files when I implemented the
protocol. Oops.

This commit dds the correct mimetype, but we still
support the old one to preserve interoperatibility
with existing flatpaks using GTK 4.6.

Fixes: #5182
2022-09-15 15:18:17 -04:00
Alessandro Bono
5320acf589 gtk/main: Remove condition that always evaluates TRUE 2022-09-15 16:44:44 +02:00
Benjamin Otte
b9b2ac2ce3 Merge branch 'wip/coreyberla/gridview-rubberband' into 'main'
gridview: Fix rubberbanding from negative x coordinates

Closes nautilus#2492

See merge request GNOME/gtk!5030
2022-09-14 18:48:11 +00:00
Corey Berla
ad041fc5d4 gridview: Fix rubberbanding from negative x coordinates
This is a follow-up to 1e9a36ffa8. For GridView
we also need to make sure that we aren't rubberbanding below x=0 which
causes unexpected rubberbanding behavior.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2492
2022-09-14 11:27:52 -07:00
Nate Eldredge
5faa300c5e Recognize "stylus" devices as GDK_SOURCE_PEN
Add "stylus" to the list of substrings in a device name that cause it to be recognized
as a GDK_SOURCE_PEN device (previously "wacom", "pen" and "eraser").  Some devices
just use "stylus" in their name, and are otherwise recognized as
GDK_SOURCE_TOUCHSCREEN instead.

Fixes #4394.
2022-05-29 15:30:19 -06:00
Lukáš Tyrychtr
4ab9592924 Use the correct macro 2022-04-25 14:21:40 +02:00
Lukáš Tyrychtr
6f01d458d5 Localize the a11y label 2022-04-22 11:42:32 +02:00
Lukáš Tyrychtr
6f9013297a Make the presentation of the stack sidebar listbox nicer for A11Y
This fixes #4577.
2022-04-21 17:55:39 +02:00
897 changed files with 35140 additions and 25704 deletions

View File

@@ -192,6 +192,7 @@ macos:
only:
- branches@GNOME/gtk
stage: build
allow_failure: true
tags:
- macos
needs: []

79
NEWS
View File

@@ -1,3 +1,82 @@
Overview of Changes in 4.9.1, dd-mm-yyyy
========================================
Note that deprecations are an early outlook
at changes that will appear in an eventual
GTK 5 release, which is still far away.
* GtkTreeView, GtkIconView, GtkComboBox and
auxiliary classes have been deprecated
* GtkEntryCompletion has been deprecated
* GtkStyleContext has been deprecated
* gtk_render_ and gtk_snapshot_render_ APIs
have been deprecated
* GtkAppChooser widgets hae been deprecated
* GtkMountOperation:
- Fix the dialog to look reasonable
- Make it work under non-X11
* GtkStringSorter:
- Support different collation methods
* Accessibility:
- Introduce GtkAccessibleRange and implement it
* Debugging:
- Unify formatting for debug output
- Make make debug options available in
non-debug builds
* Translation updates:
Abkhazian
Basque
Bulgarian
Croatian
Friulian
Georgian
German
Hungarian
Russian
Turkish
Overview of Changes in 4.8.1, 16-09-2022
========================================
* Input:
- Fix problems with input method interactions that caused
dead keys not to work
- Accept single-key compose sequences (these are used with
some keyboard layouts)
* GtkColumnView:
- Flip column order in right-to-left context
* GtkGridView:
- Fix problems with rubberbanding
* GtkFileChooser:
- Fix positioning of popovers in the places view
- Make ~ and . keyboard shortcuts work again
* gsk:
- Make glyph upload more similar to icons
* Make file transfer via portals work, this fixes file
copy/paste and dnd in flatpaks
* Translation updates:
Catalan
Chinese (China)
Chinese (Taiwan)
Latvian
Overview of Changes in 4.8.0, 06-09-2022
========================================

View File

@@ -1,45 +0,0 @@
#!/usr/bin/env python3
import os
import sys
import subprocess
if 'DESTDIR' not in os.environ:
gtk_api_version = sys.argv[1]
gtk_abi_version = sys.argv[2]
gtk_libdir = sys.argv[3]
gtk_datadir = sys.argv[4]
gtk_bindir = sys.argv[5]
gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version)
gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends')
gtk_mediamodule_dir = os.path.join(gtk_moduledir, 'media')
print('Compiling GSettings schemas...')
glib_compile_schemas = subprocess.check_output(['pkg-config',
'--variable=glib_compile_schemas',
'gio-2.0']).strip()
if not os.path.exists(glib_compile_schemas):
# pkg-config variables only available since GLib 2.62.0.
glib_compile_schemas = 'glib-compile-schemas'
subprocess.call([glib_compile_schemas,
os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
print('Updating icon cache...')
update_icon_cache = os.path.join(gtk_bindir, 'gtk4-update-icon-cache')
subprocess.call([update_icon_cache, '-q', '-t' ,'-f',
os.path.join(gtk_datadir, 'icons', 'hicolor')])
print('Updating module cache for print backends...')
os.makedirs(gtk_printmodule_dir, exist_ok=True)
gio_querymodules = subprocess.check_output(['pkg-config',
'--variable=gio_querymodules',
'gio-2.0']).strip()
if not os.path.exists(gio_querymodules):
# pkg-config variables only available since GLib 2.62.0.
gio_querymodules = 'gio-querymodules'
subprocess.call([gio_querymodules, gtk_printmodule_dir])
print('Updating module cache for media backends...')
os.makedirs(gtk_mediamodule_dir, exist_ok=True)
subprocess.call([gio_querymodules, gtk_mediamodule_dir])

View File

@@ -21,6 +21,8 @@
#include "constraint-editor.h"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
struct _ConstraintEditor
{
GtkWidget parent_instance;

View File

@@ -21,6 +21,8 @@
#include "guide-editor.h"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
struct _GuideEditor
{
GtkWidget parent_instance;

View File

@@ -11,6 +11,8 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
enum
{
ICON_NAME_COL,

View File

@@ -1,20 +1,16 @@
/* Theming/CSS Accordion
*
* A simple accordion demo written using CSS transitions and multiple backgrounds
*
*/
#include <gtk/gtk.h>
static void
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
destroy_provider (GtkWidget *window,
GtkStyleProvider *provider)
{
GtkWidget *child;
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
for (child = gtk_widget_get_first_child (widget);
child != NULL;
child = gtk_widget_get_next_sibling (child))
apply_css (child, provider);
gtk_style_context_remove_provider_for_display (gtk_widget_get_display (window), provider);
}
GtkWidget *
@@ -24,8 +20,8 @@ do_css_accordion (GtkWidget *do_widget)
if (!window)
{
GtkWidget *container, *child;
GtkStyleProvider *provider;
GtkWidget *container, *styled_box, *child;
GtkCssProvider *provider;
window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (window), "CSS Accordion");
@@ -33,10 +29,13 @@ do_css_accordion (GtkWidget *do_widget)
gtk_window_set_default_size (GTK_WINDOW (window), 600, 300);
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
styled_box = gtk_frame_new (NULL);
gtk_window_set_child (GTK_WINDOW (window), styled_box);
gtk_widget_add_css_class (styled_box, "accordion");
container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_set_halign (container, GTK_ALIGN_CENTER);
gtk_widget_set_valign (container, GTK_ALIGN_CENTER);
gtk_window_set_child (GTK_WINDOW (window), container);
gtk_frame_set_child (GTK_FRAME (styled_box), container);
child = gtk_button_new_with_label ("This");
gtk_box_append (GTK_BOX (container), child);
@@ -56,10 +55,16 @@ do_css_accordion (GtkWidget *do_widget)
child = gtk_button_new_with_label (":-)");
gtk_box_append (GTK_BOX (container), child);
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
gtk_css_provider_load_from_resource (GTK_CSS_PROVIDER (provider), "/css_accordion/css_accordion.css");
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (provider, "/css_accordion/css_accordion.css");
apply_css (window, provider);
gtk_style_context_add_provider_for_display (gtk_widget_get_display (window),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_signal_connect (window, "destroy",
G_CALLBACK (destroy_provider), provider);
g_object_unref (provider);
}
if (!gtk_widget_get_visible (window))

View File

@@ -1,13 +1,13 @@
@import url("resource://css_accordion/reset.css");
.accordion, .accordion * {
all: unset;
* {
transition-property: color, background-color, border-color, background-image, padding, border-width;
transition-duration: 1s;
font: 20px Cantarell;
}
window {
.accordion {
background: linear-gradient(153deg, #151515, #151515 5px, transparent 5px) 0 0,
linear-gradient(333deg, #151515, #151515 5px, transparent 5px) 10px 5px,
linear-gradient(153deg, #222, #222 5px, transparent 5px) 0 5px,
@@ -18,7 +18,7 @@ window {
background-size: 20px 20px;
}
button {
.accordion button {
color: black;
background-color: #bbb;
border-style: solid;
@@ -28,25 +28,25 @@ button {
padding: 12px 4px;
}
button:first-child {
.accordion button:first-child {
border-radius: 5px 0 0 5px;
}
button:last-child {
.accordion button:last-child {
border-radius: 0 5px 5px 0;
border-width: 2px;
}
button:hover {
.accordion button:hover {
padding: 12px 48px;
background-color: #4870bc;
}
button *:hover {
.accordion button *:hover {
color: white;
}
button:hover:active,
button:active {
.accordion button:hover:active,
.accordion button:active {
background-color: #993401;
}

View File

@@ -6,6 +6,8 @@
#include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
show_parsing_error (GtkCssProvider *provider,
GtkCssSection *section,

View File

@@ -6,6 +6,8 @@
#include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
show_parsing_error (GtkCssProvider *provider,
GtkCssSection *section,

View File

@@ -7,6 +7,8 @@
#include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
show_parsing_error (GtkCssProvider *provider,
GtkCssSection *section,

View File

@@ -5,6 +5,8 @@
#include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
show_parsing_error (GtkCssProvider *provider,
GtkCssSection *section,

View File

@@ -24,7 +24,6 @@
</gresource>
<gresource prefix="/css_accordion">
<file>css_accordion.css</file>
<file>reset.css</file>
</gresource>
<gresource prefix="/css_basics">
<file>css_basics.css</file>

View File

@@ -11,6 +11,7 @@
#include <gtk/gtk.h>
G_DECLARE_FINAL_TYPE (CanvasItem, canvas_item, CANVAS, ITEM, GtkWidget)
struct _CanvasItem {
@@ -24,6 +25,9 @@ struct _CanvasItem {
double delta;
GtkWidget *editor;
GtkStyleProvider *provider;
char *css_class;
};
struct _CanvasItemClass {
@@ -34,32 +38,41 @@ G_DEFINE_TYPE (CanvasItem, canvas_item, GTK_TYPE_WIDGET)
static int n_items = 0;
static void
unstyle_item (CanvasItem *item)
{
if (item->provider)
{
gtk_style_context_remove_provider_for_display (gtk_widget_get_display (item->label), item->provider);
g_clear_object (&item->provider);
}
if (item->css_class)
{
gtk_widget_remove_css_class (item->label, item->css_class);
g_clear_pointer (&item->css_class, g_free);
}
}
static void
set_color (CanvasItem *item,
GdkRGBA *color)
{
char *css;
char *str;
GtkStyleContext *context;
GtkCssProvider *provider;
const char *old_class;
const char *name;
unstyle_item (item);
str = gdk_rgba_to_string (color);
css = g_strdup_printf ("* { background: %s; }", str);
context = gtk_widget_get_style_context (item->label);
provider = g_object_get_data (G_OBJECT (context), "style-provider");
if (provider)
gtk_style_context_remove_provider (context, GTK_STYLE_PROVIDER (provider));
old_class = (const char *)g_object_get_data (G_OBJECT (item->label), "css-class");
if (old_class)
gtk_widget_remove_css_class (item->label, old_class);
name = gtk_widget_get_name (item->label);
css = g_strdup_printf ("#%s { background: %s; }", name, str);
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, css, -1);
gtk_style_context_add_provider (gtk_widget_get_style_context (item->label), GTK_STYLE_PROVIDER (provider), 800);
g_object_set_data_full (G_OBJECT (context), "style-provider", provider, g_object_unref);
gtk_style_context_add_provider_for_display (gtk_widget_get_display (item->label), GTK_STYLE_PROVIDER (provider), 700);
item->provider = GTK_STYLE_PROVIDER (provider);
g_free (str);
g_free (css);
@@ -69,21 +82,10 @@ static void
set_css (CanvasItem *item,
const char *class)
{
GtkStyleContext *context;
GtkCssProvider *provider;
const char *old_class;
unstyle_item (item);
context = gtk_widget_get_style_context (item->label);
provider = g_object_get_data (G_OBJECT (context), "style-provider");
if (provider)
gtk_style_context_remove_provider (context, GTK_STYLE_PROVIDER (provider));
old_class = (const char *)g_object_get_data (G_OBJECT (item->label), "css-class");
if (old_class)
gtk_widget_remove_css_class (item->label, old_class);
g_object_set_data_full (G_OBJECT (item->label), "css-class", g_strdup (class), g_free);
gtk_widget_add_css_class (item->label, class);
item->css_class = g_strdup (class);
}
static gboolean
@@ -722,6 +724,7 @@ do_dnd (GtkWidget *do_widget)
int i;
int x, y;
GtkCssProvider *provider;
GString *css;
button = gtk_color_button_new ();
g_object_unref (g_object_ref_sink (button));
@@ -733,6 +736,18 @@ do_dnd (GtkWidget *do_widget)
800);
g_object_unref (provider);
css = g_string_new ("");
for (i = 0; colors[i]; i++)
g_string_append_printf (css, ".canvasitem.%s { background: %s; }\n", colors[i], colors[i]);
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, css->str, css->len);
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (provider),
800);
g_object_unref (provider);
g_string_free (css, TRUE);
window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));

View File

@@ -14,6 +14,8 @@
#include <string.h>
#include <stdlib.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
typedef struct
{
int number;

View File

@@ -8,6 +8,8 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* Creates a tree model containing the completions */
static GtkTreeModel *
create_completion_model (void)

View File

@@ -9,6 +9,8 @@
#include <gtk/gtk.h>
#include <stdlib.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
enum {
WIDTH_COLUMN,
HEIGHT_COLUMN,

View File

@@ -21,6 +21,75 @@
#include "script-names.h"
#include "language-names.h"
/* {{{ ScriptLang object */
G_DECLARE_FINAL_TYPE (ScriptLang, script_lang, SCRIPT, LANG, GObject)
struct _ScriptLang
{
GObject parent;
char *langname;
unsigned int script_index;
unsigned int lang_index;
hb_tag_t lang_tag;
};
struct _ScriptLangClass
{
GObjectClass parent_class;
};
G_DEFINE_TYPE (ScriptLang, script_lang, G_TYPE_OBJECT)
static void
script_lang_init (ScriptLang *self)
{
}
static void
script_lang_finalize (GObject *object)
{
ScriptLang *self = SCRIPT_LANG (object);
g_free (self->langname);
G_OBJECT_CLASS (script_lang_parent_class)->finalize (object);
}
static void
script_lang_class_init (ScriptLangClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->finalize = script_lang_finalize;
}
static ScriptLang *
script_lang_new (const char *langname,
unsigned int script_index,
unsigned int lang_index,
hb_tag_t lang_tag)
{
ScriptLang *self;
self = g_object_new (script_lang_get_type (), NULL);
self->langname = g_strdup (langname);
self->script_index = script_index;
self->lang_index = lang_index;
self->lang_tag = lang_tag;
return self;
}
static char *
script_lang_get_langname (ScriptLang *self)
{
return g_strdup (self->langname);
}
/* }}} */
#define MAKE_TAG(a,b,c,d) (unsigned int)(((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
@@ -94,6 +163,10 @@ demo_free (gpointer data)
g_clear_pointer (&demo->axes, g_hash_table_unref);
g_clear_pointer (&demo->text, g_free);
gtk_style_context_remove_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (demo->provider));
g_object_unref (demo->provider);
g_free (demo);
}
@@ -471,8 +544,6 @@ update_display (void)
GString *s;
char *text;
gboolean has_feature;
GtkTreeIter iter;
GtkTreeModel *model;
PangoFontDescription *desc;
GList *l;
PangoAttrList *attrs;
@@ -575,14 +646,13 @@ update_display (void)
features = g_string_free (s, FALSE);
if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (demo->script_lang), &iter))
if (gtk_drop_down_get_selected (GTK_DROP_DOWN (demo->script_lang)) != 0)
{
hb_tag_t lang_tag;
ScriptLang *selected;
model = gtk_combo_box_get_model (GTK_COMBO_BOX (demo->script_lang));
gtk_tree_model_get (model, &iter, 3, &lang_tag, -1);
selected = gtk_drop_down_get_selected_item (GTK_DROP_DOWN (demo->script_lang));
lang = pango_language_from_string (hb_language_to_string (hb_ot_tag_to_language (lang_tag)));
lang = pango_language_from_string (hb_language_to_string (hb_ot_tag_to_language (selected->lang_tag)));
}
else
lang = NULL;
@@ -739,40 +809,30 @@ tag_pair_equal (gconstpointer a, gconstpointer b)
return pair_a->script_tag == pair_b->script_tag && pair_a->lang_tag == pair_b->lang_tag;
}
static int
script_sort_func (GtkTreeModel *model,
GtkTreeIter *a,
GtkTreeIter *b,
gpointer user_data)
static GtkOrdering
script_sort (const void *item1,
const void *item2,
void *data)
{
char *sa, *sb;
int ret;
ScriptLang *a = (ScriptLang *)item1;
ScriptLang *b = (ScriptLang *)item2;
gtk_tree_model_get (model, a, 0, &sa, -1);
gtk_tree_model_get (model, b, 0, &sb, -1);
ret = strcmp (sa, sb);
g_free (sa);
g_free (sb);
return ret;
return strcmp (a->langname, b->langname);
}
static void
update_script_combo (void)
{
GtkListStore *store;
GListStore *store;
GtkSortListModel *sortmodel;
hb_font_t *hb_font;
int i, j, k;
PangoFont *pango_font;
GHashTable *tags;
GHashTableIter iter;
TagPair *pair;
char *lang;
hb_tag_t active;
GtkTreeIter active_iter;
gboolean have_active = FALSE;
lang = gtk_font_chooser_get_language (GTK_FONT_CHOOSER (demo->font));
@@ -782,7 +842,7 @@ update_script_combo (void)
g_free (lang);
store = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
store = g_list_store_new (script_lang_get_type ());
pango_font = get_pango_font ();
hb_font = pango_font_get_hb_font (pango_font);
@@ -806,19 +866,19 @@ update_script_combo (void)
hb_face = hb_font_get_face (hb_font);
for (i= 0; i < 2; i++)
for (guint i = 0; i < 2; i++)
{
hb_tag_t scripts[80];
unsigned int script_count = G_N_ELEMENTS (scripts);
hb_ot_layout_table_get_script_tags (hb_face, tables[i], 0, &script_count, scripts);
for (j = 0; j < script_count; j++)
for (guint j = 0; j < script_count; j++)
{
hb_tag_t languages[80];
unsigned int language_count = G_N_ELEMENTS (languages);
hb_ot_layout_script_get_language_tags (hb_face, tables[i], j, 0, &language_count, languages);
for (k = 0; k < language_count; k++)
for (guint k = 0; k < language_count; k++)
{
pair = g_new (TagPair, 1);
pair->script_tag = scripts[j];
@@ -838,7 +898,6 @@ update_script_combo (void)
{
const char *langname;
char langbuf[5];
GtkTreeIter tree_iter;
if (pair->lang_tag == 0 && pair->script_tag == 0)
langname = NC_("Language", "None");
@@ -855,31 +914,31 @@ update_script_combo (void)
}
}
gtk_list_store_insert_with_values (store, &tree_iter, -1,
0, langname,
1, pair->script_index,
2, pair->lang_index,
3, pair->lang_tag,
-1);
if (pair->lang_tag == active)
{
have_active = TRUE;
active_iter = tree_iter;
}
g_list_store_append (store, script_lang_new (langname,
pair->script_index,
pair->lang_index,
pair->lang_tag));
}
g_hash_table_destroy (tags);
gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (store),
script_sort_func, NULL, NULL);
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
GTK_SORT_ASCENDING);
gtk_combo_box_set_model (GTK_COMBO_BOX (demo->script_lang), GTK_TREE_MODEL (store));
if (have_active)
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (demo->script_lang), &active_iter);
else
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (demo->script_lang), 0);
sortmodel = gtk_sort_list_model_new (G_LIST_MODEL (store),
GTK_SORTER (gtk_custom_sorter_new (script_sort, NULL, NULL)));
gtk_drop_down_set_model (GTK_DROP_DOWN (demo->script_lang), G_LIST_MODEL (sortmodel));
for (guint i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (sortmodel)); i++)
{
ScriptLang *item = g_list_model_get_item (G_LIST_MODEL (sortmodel), i);
g_object_unref (item);
if (item->lang_tag == active)
{
gtk_drop_down_set_selected (GTK_DROP_DOWN (demo->script_lang), i);
break;
}
}
g_object_unref (sortmodel);
}
static char *
@@ -904,27 +963,19 @@ static void
update_features (void)
{
int i, j;
GtkTreeModel *model;
GtkTreeIter iter;
guint script_index, lang_index;
hb_tag_t lang_tag;
PangoFont *pango_font;
hb_font_t *hb_font;
GList *l;
ScriptLang *selected;
/* set feature presence checks from the font features */
if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (demo->script_lang), &iter))
if (gtk_drop_down_get_selected (GTK_DROP_DOWN (demo->script_lang)) == 0)
return;
model = gtk_combo_box_get_model (GTK_COMBO_BOX (demo->script_lang));
gtk_tree_model_get (model, &iter,
1, &script_index,
2, &lang_index,
3, &lang_tag,
-1);
selected = gtk_drop_down_get_selected_item (GTK_DROP_DOWN (demo->script_lang));
if (lang_tag == 0) /* None is selected */
if (selected->lang_tag == 0) /* None is selected */
{
for (l = demo->feature_items; l; l = l->next)
{
@@ -965,8 +1016,8 @@ update_features (void)
hb_ot_layout_language_get_feature_tags (hb_face,
tables[i],
script_index,
lang_index,
selected->script_index,
selected->lang_index,
0,
&count,
features);
@@ -988,8 +1039,8 @@ update_features (void)
hb_ot_layout_language_find_feature (hb_face,
tables[i],
script_index,
lang_index,
selected->script_index,
selected->lang_index,
features[j],
&feature_index);
@@ -1321,10 +1372,9 @@ free_instance (gpointer data)
}
static void
add_instance (hb_face_t *face,
unsigned int index,
GtkWidget *combo,
int pos)
add_instance (hb_face_t *face,
unsigned int index,
GtkStringList *strings)
{
Instance *instance;
hb_ot_name_id_t name_id;
@@ -1340,20 +1390,20 @@ add_instance (hb_face_t *face,
instance->index = index;
g_hash_table_add (demo->instances, instance);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), instance->name);
gtk_string_list_append (GTK_STRING_LIST (strings), instance->name);
}
static void
unset_instance (GtkAdjustment *adjustment)
{
if (demo->instance_combo)
gtk_combo_box_set_active (GTK_COMBO_BOX (demo->instance_combo), 0);
gtk_drop_down_set_selected (GTK_DROP_DOWN (demo->instance_combo), 0);
}
static void
instance_changed (GtkComboBox *combo)
instance_changed (GtkDropDown *combo)
{
char *text;
const char *text;
Instance *instance;
Instance ikey;
int i;
@@ -1365,11 +1415,12 @@ instance_changed (GtkComboBox *combo)
hb_font_t *hb_font;
hb_face_t *hb_face;
text = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo));
text = gtk_string_list_get_string (GTK_STRING_LIST (gtk_drop_down_get_model (combo)),
gtk_drop_down_get_selected (combo));
if (text[0] == '\0')
goto out;
ikey.name = text;
ikey.name = (char *) text;
instance = g_hash_table_lookup (demo->instances, &ikey);
if (!instance)
{
@@ -1410,7 +1461,6 @@ instance_changed (GtkComboBox *combo)
}
out:
g_free (text);
g_clear_object (&pango_font);
g_free (ai);
g_free (coords);
@@ -1520,6 +1570,7 @@ update_font_variations (void)
{
GtkWidget *label;
GtkWidget *combo;
GtkStringList *strings;
label = gtk_label_new ("Instance");
gtk_label_set_xalign (GTK_LABEL (label), 0);
@@ -1527,26 +1578,28 @@ update_font_variations (void)
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
gtk_grid_attach (GTK_GRID (demo->variations_grid), label, 0, -1, 1, 1);
combo = gtk_combo_box_text_new ();
strings = gtk_string_list_new (NULL);
combo = gtk_drop_down_new (G_LIST_MODEL (strings), NULL);
gtk_widget_set_halign (combo, GTK_ALIGN_START);
gtk_widget_set_valign (combo, GTK_ALIGN_BASELINE);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "");
gtk_string_list_append (strings, "");
for (i = 0; i < hb_ot_var_get_named_instance_count (hb_face); i++)
add_instance (hb_face, i, combo, i);
add_instance (hb_face, i, strings);
for (i = 0; i < hb_ot_var_get_named_instance_count (hb_face); i++)
{
if (matches_instance (hb_face, i, n_axes, design_coords))
{
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), i + 1);
gtk_drop_down_set_selected (GTK_DROP_DOWN (combo), i + 1);
break;
}
}
gtk_grid_attach (GTK_GRID (demo->variations_grid), combo, 1, -1, 3, 1);
g_signal_connect (combo, "changed", G_CALLBACK (instance_changed), NULL);
g_signal_connect (combo, "notify::selecte", G_CALLBACK (instance_changed), NULL);
demo->instance_combo = combo;
}
@@ -1693,6 +1746,7 @@ do_font_features (GtkWidget *do_widget)
GtkBuilder *builder;
GtkBuilderScope *scope;
GtkEventController *controller;
GtkExpression *expression;
builder = gtk_builder_new ();
@@ -1726,6 +1780,9 @@ do_font_features (GtkWidget *do_widget)
demo->description = GTK_WIDGET (gtk_builder_get_object (builder, "description"));
demo->font = GTK_WIDGET (gtk_builder_get_object (builder, "font"));
demo->script_lang = GTK_WIDGET (gtk_builder_get_object (builder, "script_lang"));
expression = gtk_cclosure_expression_new (G_TYPE_STRING, NULL, 0, NULL, G_CALLBACK (script_lang_get_langname), NULL, NULL);
gtk_drop_down_set_expression (GTK_DROP_DOWN (demo->script_lang), expression);
gtk_expression_unref (expression);
demo->feature_list = GTK_WIDGET (gtk_builder_get_object (builder, "feature_list"));
demo->stack = GTK_WIDGET (gtk_builder_get_object (builder, "stack"));
demo->entry = GTK_WIDGET (gtk_builder_get_object (builder, "entry"));
@@ -1744,8 +1801,8 @@ do_font_features (GtkWidget *do_widget)
demo->swin = GTK_WIDGET (gtk_builder_get_object (builder, "swin"));
demo->provider = gtk_css_provider_new ();
gtk_style_context_add_provider (gtk_widget_get_style_context (demo->swin),
GTK_STYLE_PROVIDER (demo->provider), 800);
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (demo->provider), 800);
basic_value_changed (demo->size_adjustment, demo->size_entry);
basic_value_changed (demo->letterspacing_adjustment, demo->letterspacing_entry);
@@ -1823,3 +1880,5 @@ do_font_features (GtkWidget *do_widget)
return window;
}
/* vim:set foldmethod=marker expandtab: */

View File

@@ -259,16 +259,10 @@
<object class="GtkBox" id="feature_list">
<property name="orientation">vertical</property>
<child>
<object class="GtkComboBox" id="script_lang">
<object class="GtkDropDown" id="script_lang">
<property name="tooltip-text" translatable="yes">Language System</property>
<property name="margin-top">10</property>
<signal name="changed" handler="font_features_script_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
<signal name="notify::selected" handler="font_features_script_changed" swapped="no"/>
</object>
</child>
</object>

View File

@@ -43,7 +43,6 @@ update_image (void)
cairo_t *cr;
GdkPixbuf *pixbuf;
GdkPixbuf *pixbuf2;
const char *hint;
cairo_font_options_t *fopt;
cairo_hint_style_t hintstyle;
cairo_hint_metrics_t hintmetrics;
@@ -58,18 +57,23 @@ update_image (void)
fopt = cairo_font_options_copy (pango_cairo_context_get_font_options (context));
hint = gtk_combo_box_get_active_id (GTK_COMBO_BOX (hinting));
hintstyle = CAIRO_HINT_STYLE_DEFAULT;
if (hint)
switch (gtk_drop_down_get_selected (GTK_DROP_DOWN (hinting)))
{
if (strcmp (hint, "none") == 0)
hintstyle = CAIRO_HINT_STYLE_NONE;
else if (strcmp (hint, "slight") == 0)
hintstyle = CAIRO_HINT_STYLE_SLIGHT;
else if (strcmp (hint, "medium") == 0)
hintstyle = CAIRO_HINT_STYLE_MEDIUM;
else if (strcmp (hint, "full") == 0)
hintstyle = CAIRO_HINT_STYLE_FULL;
case 0:
hintstyle = CAIRO_HINT_STYLE_NONE;
break;
case 1:
hintstyle = CAIRO_HINT_STYLE_SLIGHT;
break;
case 2:
hintstyle = CAIRO_HINT_STYLE_MEDIUM;
break;
case 3:
hintstyle = CAIRO_HINT_STYLE_FULL;
break;
default:
hintstyle = CAIRO_HINT_STYLE_DEFAULT;
break;
}
cairo_font_options_set_hint_style (fopt, hintstyle);
@@ -418,7 +422,7 @@ do_fontrendering (GtkWidget *do_widget)
g_signal_connect (down_button, "clicked", G_CALLBACK (scale_down), NULL);
g_signal_connect (entry, "notify::text", G_CALLBACK (update_image), NULL);
g_signal_connect (font_button, "notify::font-desc", G_CALLBACK (update_image), NULL);
g_signal_connect (hinting, "notify::active", G_CALLBACK (update_image), NULL);
g_signal_connect (hinting, "notify::selected", G_CALLBACK (update_image), NULL);
g_signal_connect (anti_alias, "notify::active", G_CALLBACK (update_image), NULL);
g_signal_connect (hint_metrics, "notify::active", G_CALLBACK (update_image), NULL);
g_signal_connect (text_radio, "notify::active", G_CALLBACK (update_image), NULL);

View File

@@ -116,15 +116,18 @@
</object>
</child>
<child>
<object class="GtkComboBoxText" id="hinting">
<property name="active">0</property>
<object class="GtkDropDown" id="hinting">
<property name="valign">center</property>
<items>
<item translatable="yes" id="none">None</item>
<item translatable="yes" id="slight">Slight</item>
<item translatable="yes" id="medium">Medium</item>
<item translatable="yes" id="full">Full</item>
</items>
<property name="model">
<object class="GtkStringList">
<items>
<item translatable="yes">None</item>
<item translatable="yes">Slight</item>
<item translatable="yes">Medium</item>
<item translatable="yes">Full</item>
</items>
</object>
</property>
</object>
</child>
<layout>

View File

@@ -144,7 +144,6 @@ make_shader_stack (const char *name,
GtkTextBuffer *buffer;
GBytes *bytes;
GtkEventController *controller;
GtkCssProvider *provider;
GdkPaintable *paintable;
stack = gtk_shader_stack_new ();
@@ -235,12 +234,6 @@ make_shader_stack (const char *name,
g_signal_connect (buffer, "changed", G_CALLBACK (text_changed), button);
g_object_set_data (G_OBJECT (button), "the-stack", stack);
g_signal_connect (button, "clicked", G_CALLBACK (apply_text), buffer);
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, "button.small { padding: 0; }", -1);
gtk_style_context_add_provider (gtk_widget_get_style_context (button),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (provider);
gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_widget_add_css_class (button, "small");
@@ -274,11 +267,21 @@ make_shader_stack (const char *name,
return vbox;
}
static void
remove_provider (gpointer data)
{
GtkStyleProvider *provider = GTK_STYLE_PROVIDER (data);
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
g_object_unref (provider);
}
static GtkWidget *
create_gltransition_window (GtkWidget *do_widget)
{
GtkWidget *window, *headerbar, *scale, *outer_grid, *grid, *background;
GdkPaintable *paintable;
GtkCssProvider *provider;
window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
@@ -333,6 +336,14 @@ create_gltransition_window (GtkWidget *do_widget)
make_shader_stack ("Kaleidoscope", "/gltransition/kaleidoscope.glsl", 3, scale),
1, 1, 1, 1);
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, "button.small { padding: 0; }", -1);
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_set_data_full (G_OBJECT (window), "provider", provider, remove_provider);
return window;
}

View File

@@ -9,6 +9,8 @@
#include <gtk/gtk.h>
#include <string.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static GtkWidget *window = NULL;
#define FOLDER_NAME "/iconview/gnome-fs-directory.png"

View File

@@ -8,6 +8,8 @@
#include <gtk/gtk.h>
#include <string.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
enum
{
COL_TEXT,

View File

@@ -7,6 +7,8 @@
#include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static GtkWidget *window = NULL;
static GtkTreeModel *model = NULL;
static guint timeout = 0;

View File

@@ -422,6 +422,10 @@ do_listview_settings (GtkWidget *do_widget)
gtk_column_view_column_set_sorter (name_column, sorter);
g_object_unref (sorter);
sorter = GTK_SORTER (gtk_string_sorter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "type")));
gtk_column_view_column_set_sorter (type_column, sorter);
g_object_unref (sorter);
g_object_unref (builder);
}

View File

@@ -10,7 +10,6 @@
#include "script-names.h"
#include "unicode-names.h"
#define UCD_TYPE_ITEM (ucd_item_get_type ())
G_DECLARE_FINAL_TYPE (UcdItem, ucd_item, UCD, ITEM, GObject)
@@ -338,6 +337,15 @@ create_ucd_view (GtkWidget *label)
static GtkWidget *window;
static void
remove_provider (gpointer data)
{
GtkStyleProvider *provider = GTK_STYLE_PROVIDER (data);
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
g_object_unref (provider);
}
GtkWidget *
do_listview_ucd (GtkWidget *do_widget)
{
@@ -360,7 +368,7 @@ do_listview_ucd (GtkWidget *do_widget)
gtk_widget_add_css_class (label, "enormous");
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, "label.enormous { font-size: 80px; }", -1);
gtk_style_context_add_provider (gtk_widget_get_style_context (label), GTK_STYLE_PROVIDER (provider), 800);
gtk_style_context_add_provider_for_display (gdk_display_get_default (), GTK_STYLE_PROVIDER (provider), 800);
gtk_widget_set_hexpand (label, TRUE);
gtk_box_append (GTK_BOX (box), label);
@@ -370,6 +378,8 @@ do_listview_ucd (GtkWidget *do_widget)
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), listview);
gtk_box_prepend (GTK_BOX (box), sw);
gtk_window_set_child (GTK_WINDOW (window), box);
g_object_set_data_full (G_OBJECT (window), "provider", provider, remove_provider);
}
if (!gtk_widget_get_visible (window))

View File

@@ -8,6 +8,7 @@
#include "config.h"
#include <gtk/gtk.h>
/* Create an object for the pegs that get moved around in the game.
*
* We implement the GdkPaintable interface for them, so we can use GtkPicture
@@ -359,6 +360,15 @@ drop_drop (GtkDropTarget *target,
return TRUE;
}
static void
remove_provider (gpointer data)
{
GtkStyleProvider *provider = GTK_STYLE_PROVIDER (data);
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
g_object_unref (provider);
}
static void
create_board (GtkWidget *window)
{
@@ -375,6 +385,9 @@ create_board (GtkWidget *window)
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, css, -1);
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (provider),
800);
grid = gtk_grid_new ();
gtk_widget_set_halign (grid, GTK_ALIGN_CENTER);
@@ -393,9 +406,6 @@ create_board (GtkWidget *window)
continue;
image = gtk_image_new ();
gtk_style_context_add_provider (gtk_widget_get_style_context (image),
GTK_STYLE_PROVIDER (provider),
800);
gtk_widget_add_css_class (image, "solitaire-field");
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
if (x != 3 || y != 3)
@@ -439,7 +449,7 @@ create_board (GtkWidget *window)
}
}
g_object_unref (provider);
g_object_set_data_full (G_OBJECT (window), "provider", provider, remove_provider);
}
static void

View File

@@ -123,8 +123,14 @@ do_pickers (GtkWidget *do_widget)
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_widget_set_hexpand (label, TRUE);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
picker = gtk_app_chooser_button_new ("x-scheme-handler/mailto");
gtk_app_chooser_button_set_show_dialog_item (GTK_APP_CHOOSER_BUTTON (picker), TRUE);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_grid_attach (GTK_GRID (table), label, 0, 3, 1, 1);
gtk_grid_attach (GTK_GRID (table), picker, 1, 3, 1, 1);
}

View File

@@ -16,7 +16,6 @@ enum {
NUM_PROPERTIES
};
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
static void
pixbuf_paintable_snapshot (GdkPaintable *paintable,
GdkSnapshot *snapshot,
@@ -37,7 +36,6 @@ pixbuf_paintable_snapshot (GdkPaintable *paintable,
g_object_unref (texture);
}
G_GNUC_END_IGNORE_DEPRECATIONS;
static int
pixbuf_paintable_get_intrinsic_width (GdkPaintable *paintable)

View File

@@ -16,24 +16,6 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
/* Convenience function to create a combo box holding a number of strings
*/
GtkWidget *
create_combo_box (const char **strings)
{
GtkWidget *combo_box;
const char **str;
combo_box = gtk_combo_box_text_new ();
for (str = strings; *str; str++)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), *str);
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
return combo_box;
}
static void
add_row (GtkGrid *table,
int row,
@@ -41,7 +23,7 @@ add_row (GtkGrid *table,
const char *label_text,
const char **options)
{
GtkWidget *combo_box;
GtkWidget *dropdown;
GtkWidget *label;
label = gtk_label_new_with_mnemonic (label_text);
@@ -50,12 +32,12 @@ add_row (GtkGrid *table,
gtk_widget_set_hexpand (label, TRUE);
gtk_grid_attach (table, label, 0, row, 1, 1);
combo_box = create_combo_box (options);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo_box);
gtk_widget_set_halign (combo_box, GTK_ALIGN_END);
gtk_widget_set_valign (combo_box, GTK_ALIGN_BASELINE);
gtk_size_group_add_widget (size_group, combo_box);
gtk_grid_attach (table, combo_box, 1, row, 1, 1);
dropdown = gtk_drop_down_new_from_strings (options);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), dropdown);
gtk_widget_set_halign (dropdown, GTK_ALIGN_END);
gtk_widget_set_valign (dropdown, GTK_ALIGN_BASELINE);
gtk_size_group_add_widget (size_group, dropdown);
gtk_grid_attach (table, dropdown, 1, row, 1, 1);
}
static void

View File

@@ -11,6 +11,7 @@
#include <stdlib.h> /* for exit() */
#include "paintable.h"
static void easter_egg_callback (GtkWidget *button, gpointer data);
static void
@@ -429,11 +430,11 @@ attach_widgets (GtkTextView *text_view)
}
else if (i == 1)
{
widget = gtk_combo_box_text_new ();
const char *options[] = {
"Option 1", "Option 2", "Option 3", NULL
};
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 1");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 2");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 3");
widget = gtk_drop_down_new_from_strings (options);
}
else if (i == 2)
{

View File

@@ -10,6 +10,8 @@
#include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* TreeItem structure */
typedef struct _TreeItem TreeItem;
struct _TreeItem

View File

@@ -664,6 +664,7 @@ on_record_button_toggled (GtkToggleButton *button,
gtk_widget_add_css_class (GTK_WIDGET (button), "destructive-action");
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
on_page_combo_changed (GtkComboBox *combo,
gpointer user_data)
@@ -705,6 +706,7 @@ on_page_combo_changed (GtkComboBox *combo,
default:;
}
}
G_GNUC_END_IGNORE_DEPRECATIONS
static void
on_range_from_changed (GtkSpinButton *from)
@@ -843,6 +845,7 @@ page_changed_cb (GtkWidget *stack, GParamSpec *pspec, gpointer data)
}
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
populate_model (GtkTreeStore *store)
{
@@ -960,6 +963,7 @@ row_separator_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
return is_sep;
}
G_GNUC_END_IGNORE_DEPRECATIONS
static void
update_title_header (GtkListBoxRow *row,
@@ -1578,6 +1582,7 @@ osd_frame_pressed (GtkGestureClick *gesture,
return GDK_EVENT_STOP;
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static gboolean
page_combo_separator_func (GtkTreeModel *model,
GtkTreeIter *iter,
@@ -1592,6 +1597,7 @@ page_combo_separator_func (GtkTreeModel *model,
return res;
}
G_GNUC_END_IGNORE_DEPRECATIONS
static void
toggle_format (GSimpleAction *action,
@@ -1844,6 +1850,7 @@ update_buttons (GtkWidget *iv, GtkIconSize size)
gtk_widget_set_sensitive (button, size != GTK_ICON_SIZE_INHERIT);
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
increase_icon_size (GtkWidget *iv)
{
@@ -1894,6 +1901,7 @@ reset_icon_size (GtkWidget *iv)
gtk_widget_queue_resize (iv);
}
G_GNUC_END_IGNORE_DEPRECATIONS
static char *
scale_format_value_blank (GtkScale *scale, double value, gpointer user_data)
@@ -2270,10 +2278,12 @@ activate (GApplication *app)
g_object_set_data (G_OBJECT (window), "selection_flowbox", widget2);
g_signal_connect_swapped (widget, "clicked", G_CALLBACK (populate_flowbox), widget2);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
widget = (GtkWidget *)gtk_builder_get_object (builder, "charletree");
populate_model ((GtkTreeStore *)gtk_tree_view_get_model (GTK_TREE_VIEW (widget)));
gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (widget), row_separator_func, NULL, NULL);
gtk_tree_view_expand_all (GTK_TREE_VIEW (widget));
G_GNUC_END_IGNORE_DEPRECATIONS
widget = GTK_WIDGET (gtk_builder_get_object (builder, "munsell"));
widget2 = GTK_WIDGET (gtk_builder_get_object (builder, "cchooser"));
@@ -2281,6 +2291,7 @@ activate (GApplication *app)
populate_colors (widget, widget2);
g_signal_connect (widget2, "notify::rgba", G_CALLBACK (rgba_changed), widget);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
widget = (GtkWidget *)gtk_builder_get_object (builder, "page_combo");
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (widget), page_combo_separator_func, NULL, NULL);
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "range_from_spin");
@@ -2291,6 +2302,7 @@ activate (GApplication *app)
g_object_set_data (G_OBJECT (widget), "range_to_spin", widget3);
g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3);
g_object_set_data (G_OBJECT (widget), "print_button", widget4);
G_GNUC_END_IGNORE_DEPRECATIONS
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "tooltextview");

View File

@@ -3345,10 +3345,12 @@ bad things might happen.</property>
<attribute name="display-hint">circular-buttons</attribute>
<item>
<attribute name="verb-icon">printer-symbolic</attribute>
<attribute name="label" translatable="yes">Print all the things!</attribute>
<attribute name="action">win.print</attribute>
</item>
<item>
<attribute name="verb-icon">emblem-shared-symbolic</attribute>
<attribute name="label" translatable="yes">Share all the things!</attribute>
<attribute name="action">app.share</attribute>
</item>
</section>
@@ -3363,14 +3365,17 @@ bad things might happen.</property>
<attribute name="label" translatable="yes">Edit</attribute>
<item>
<attribute name="verb-icon">edit-cut-symbolic</attribute>
<attribute name="label" translatable="yes">Cut</attribute>
<attribute name="action">app.cut</attribute>
</item>
<item>
<attribute name="verb-icon">edit-copy-symbolic</attribute>
<attribute name="label" translatable="yes">Copy</attribute>
<attribute name="action">app.copy</attribute>
</item>
<item>
<attribute name="verb-icon">edit-paste-symbolic</attribute>
<attribute name="label" translatable="yes">Paste</attribute>
<attribute name="action">app.paste</attribute>
</item>
</section>

View File

@@ -12,8 +12,8 @@ SYNOPSIS
--------
| **gtk4-builder-tool** <COMMAND> [OPTIONS...] <FILE>
|
| **gtk4-builder-tool** validate <FILE>
| **gtk4-builder-tool** enumerate <FILE>
| **gtk4-builder-tool** validate [OPTIONS...] <FILE>
| **gtk4-builder-tool** enumerate [OPTIONS...] <FILE>
| **gtk4-builder-tool** simplify [OPTIONS...] <FILE>
| **gtk4-builder-tool** preview [OPTIONS...] <FILE>
| **gtk4-builder-tool** screenshot [OPTIONS...] <FILE>
@@ -33,12 +33,20 @@ Validation
The ``validate`` command validates the given UI definition file and reports
errors to ``stderr``.
``--deprecations``
Warn about uses of deprecated types in the UI definition file.
Enumeration
^^^^^^^^^^^
The ``enumerate`` command lists all the named objects that are present in the UI
The ``enumerate`` command prints all the named objects that are present in the UI
definition file.
``--callbacks``
Print the names of callbacks as well.
Preview
^^^^^^^

View File

@@ -0,0 +1,74 @@
Title: Preparing for GTK 5
Slug: gtk-migrating-4-to-5
GTK 5 will be a major new version of GTK that breaks both API and
ABI compared to GTK 4.x. GTK 5 does not exist yet, so we cannot
be entirely sure what will be involved in a migration from GTK 4
to GTK 5. But we can already give some preliminary hints about
the likely changes, and how to prepare for them in code that is
using GTK 4.
### Do not use deprecated symbols
As always, functions and types that are known to go away in the
next major version of GTK are being marked as deprecated in GTK 4.
Removing the use of deprecated APIs is the most important step
to prepare your code for the next major version of GTK. Often,
deprecation notes will include hints about replacement APIs to
help you with this.
Sometimes, it is helpful to have some background information about
the motivation and goals of larger API changes.
## Cell renderers are going away
Cell renderers were introduced in GTK 2 to support rendering of
"big data" UIs, in particular treeviews. Over the years, more
"data-like" widgets have started to use them, and cell renderers
have grown into a shadowy, alternative rendering infrastructure
that duplicates much of what widgets do, while duplicating the
code and adding their own dose of bugs.
In GTK 4, replacement widgets for GtkTreeView, GtkIconView and
GtkComboBox have appeared: GtkListView, GtkColumnView, GtkGridView
and GtkDropDown. For GTK 5, we will take the next step and remove
all cell renderer-based widgets.
## Themed rendering APIs are going away
The old GTK 2 era rendering APIs for theme components like
gtk_render_frame() or gtk_render_check() have not been used by
GTK itself even in later GTK 3, but they have been kepy around
for the benefit of "external drawing" users - applications that
want their controls to look like GTK without using widgets.
Supporting this is increasingly getting in the way of making
the GTK CSS machinery fast and correct. One notable problem is
that temporary style changes (using gtk_style_context_save())
is breaking animations. Therefore, these APIs will be going away
in GTK 5, together with their more modern GtkSnapshot variants
like gtk_snapshot_render_background() or gtk_snapshot_render_focus().
The best way to render parts of your widget using CSS styling
is to use subwidgets. For example, to show a piece of text with
fonts, effects and shadows according to the current CSS style,
use a GtkLabel.
If you have a need for custom drawing that fits into the current
(dark or light) theme, e.g. for rendering a graph, you can still
get the current style foreground color, using
[method@Gtk.Widget.get_style_color].
## Local stylesheets are going away
The cascading part of GTK's CSS implementation is complicated by
the existence of local stylesheets (i.e. those added with
gtk_style_context_add_provider()). And local stylesheets are
unintuitive in that they do not apply to the whole subtree of
widgets, but just to the one widget where the stylesheet was
added.
GTK 5 will no longer provide this functionality. The recommendations
is to use a global stylesheet (i.e. gtk_style_context_add_provider_for_display())
and rely on style classes to make your CSS apply only where desired.

View File

@@ -10,6 +10,10 @@ to determine paths to look for certain files. The [X11](#x11-envar),
[Broadway](#broadway-envar) GDK backends use some additional
environment variables.
Note that environment variables are generally used for debugging
purposes. They are not guaranteed to be API stable, and should not
be used for end-user configuration and customization.
### `GTK_DEBUG`
This variable can be set to a list of debug options, which cause GTK to
@@ -75,6 +79,9 @@ A number of keys are influencing behavior instead of just logging:
`snapshot`
: Include debug render nodes in the generated snapshots
`invert-text-dir`
: Invert the text direction, compared to the locale
The special value `all` can be used to turn on all debug options.
The special value `help` can be used to obtain a list of all
supported debug options.
@@ -85,8 +92,7 @@ Specifies a list of directories to search when GTK is looking for
dynamically loaded objects such as input method modules and print
backends. If the path to the dynamically loaded object is given as
an absolute path name, then GTK loads it directly. Otherwise, GTK
goes in turn through the directories in `GTK_PATH`, followed by
the directory `.gtk-4.0` in the user's home directory, followed
goes in turn through the directories in `GTK_PATH`, followed
by the system default directory, which is `libdir/gtk-4.0/modules`.
(If `GTK_EXE_PREFIX` is defined, `libdir` is `$GTK_EXE_PREFIX/lib`.
Otherwise it is the libdir specified when GTK was configured, usually
@@ -205,24 +211,33 @@ A number of options affect behavior instead of logging:
`gl-disable`
: Disable OpenGL support
`gl-software`
: Force OpenGL software rendering
`gl-texture-rect`
: Use the OpenGL texture rectangle extension, if available
`gl-legacy`
: Use a legacy OpenGL context
`gl-gles`
: Use a GLES OpenGL context
`gl-egl`
: Use an EGL context on X11 or Windows
`gl-glx`
: Use GLX on X11
`gl-wgl`
: Use WGL on Windows
`vulkan-disable`
: Disable Vulkan support
`vulkan-validate`
: Load the Vulkan validation layer, if available
`default-settings`
: Force default values for xsettings
`high-depth`
: Use high bit depth rendering if possible
The special value `all` can be used to turn on all debug options. The special
value `help` can be used to obtain a list of all supported debug options.

View File

@@ -1,6 +1,13 @@
Title: Tree and List Widget Overview
Slug: gtk-treeview
This document describes the `GtkTreeView` widget and auxiliary
classes, like tree models and cell renderers. All of these have
been deprecated and will be removed in GTK 5. Their replacements
are described in the [List Widget Overview](section-list-widget.html).
## Introduction
To create a tree or list in GTK, use the `GtkTreeModel` interface in
conjunction with the `GtkTreeView` widget. This widget is designed around
a _Model/View/Controller_ design and consists of four major parts:

View File

@@ -7,7 +7,7 @@ the default.
More information about GTK on Windows, including detailed build
instructions, binary downloads, etc, can be found
[online](https://wiki.gnome.org/Projects/GTK/Win32).
[online](https://www.gtk.org/docs/installations/windows/).
## Windows-specific environment variables

View File

@@ -350,7 +350,8 @@ quit_activated (GSimpleAction *action,
}
static void
combo_changed (GtkComboBox *combo,
combo_changed (GtkDropDown *combo,
GParamSpec *pspec,
gpointer user_data)
{
GtkDialog *dialog = user_data;
@@ -359,7 +360,7 @@ combo_changed (GtkComboBox *combo,
char **accels;
char *str;
action = gtk_combo_box_get_active_id (combo);
action = gtk_string_object_get_string (GTK_STRING_OBJECT (gtk_drop_down_get_selected_item (combo)));
if (!action)
return;
@@ -388,7 +389,7 @@ response (GtkDialog *dialog,
gpointer user_data)
{
GtkEntry *entry = g_object_get_data (user_data, "entry");
GtkComboBox *combo = g_object_get_data (user_data, "combo");
GtkDropDown *combo = g_object_get_data (user_data, "combo");
const char *action;
const char *str;
char **accels;
@@ -399,7 +400,7 @@ response (GtkDialog *dialog,
return;
}
action = gtk_combo_box_get_active_id (combo);
action = gtk_string_object_get_string (GTK_STRING_OBJECT (gtk_drop_down_get_selected_item (combo)));
if (!action)
return;
@@ -424,6 +425,7 @@ edit_accels (GSimpleAction *action,
char **actions;
GtkWidget *dialog;
int i;
GtkStringList *strings;
dialog = gtk_dialog_new_with_buttons ("Accelerators",
NULL,
@@ -435,7 +437,8 @@ edit_accels (GSimpleAction *action,
gtk_window_set_application (GTK_WINDOW (dialog), app);
actions = gtk_application_list_action_descriptions (app);
combo = gtk_combo_box_text_new ();
strings = gtk_string_list_new (NULL);
combo = gtk_drop_down_new (G_LIST_MODEL (strings), NULL);
g_object_set (gtk_dialog_get_content_area (GTK_DIALOG (dialog)),
"margin-top", 10,
"margin-bottom", 10,
@@ -446,8 +449,8 @@ edit_accels (GSimpleAction *action,
gtk_box_append (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), combo);
for (i = 0; actions[i]; i++)
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), actions[i], actions[i]);
g_signal_connect (combo, "changed", G_CALLBACK (combo_changed), dialog);
gtk_string_list_append (strings, actions[i]);
g_signal_connect (combo, "notify::selected", G_CALLBACK (combo_changed), dialog);
entry = gtk_entry_new ();
gtk_widget_set_hexpand (entry, TRUE);
@@ -458,7 +461,7 @@ edit_accels (GSimpleAction *action,
g_object_set_data (G_OBJECT (dialog), "combo", combo);
g_object_set_data (G_OBJECT (dialog), "entry", entry);
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
gtk_drop_down_set_selected (GTK_DROP_DOWN (combo), 0);
gtk_widget_show (dialog);
}

View File

@@ -13,7 +13,7 @@
#include "gdkbroadway-server.h"
#include "gdkprivate-broadway.h"
#include "gdk-private.h"
#include "gdkprivate.h"
#include <gdk/gdktextureprivate.h>
@@ -34,7 +34,7 @@
#ifdef G_OS_WIN32
#include <windows.h>
#endif
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
typedef struct BroadwayInput BroadwayInput;

View File

@@ -84,6 +84,7 @@ gdk_broadway_device_query_state (GdkDevice *device,
gint32 device_root_x, device_root_y;
guint32 mouse_toplevel_id;
guint32 mask32;
int origin_x, origin_y;
if (gdk_device_get_source (device) != GDK_SOURCE_MOUSE)
return;
@@ -97,10 +98,12 @@ gdk_broadway_device_query_state (GdkDevice *device,
&device_root_y,
&mask32);
gdk_surface_get_origin (surface, &origin_x, &origin_y);
if (win_x)
*win_x = device_root_x;
*win_x = device_root_x - origin_x;
if (win_y)
*win_y = device_root_y;
*win_y = device_root_y - origin_y;
if (mask)
*mask = mask32;
}

View File

@@ -32,7 +32,7 @@
#include "gdkdevice-broadway.h"
#include "gdkdeviceprivate.h"
#include <gdk/gdktextureprivate.h>
#include "gdk-private.h"
#include "gdkprivate.h"
#include <glib.h>
#include <glib/gprintf.h>
@@ -213,7 +213,7 @@ _gdk_broadway_display_open (const char *display_name)
broadway_display->server = _gdk_broadway_server_new (display, display_name, &error);
if (broadway_display->server == NULL)
{
GDK_NOTE (MISC, g_message ("Unable to init Broadway server: %s\n", error->message));
GDK_DEBUG (MISC, "Unable to init Broadway server: %s", error->message);
g_error_free (error);
return NULL;
}

View File

@@ -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);

View File

@@ -483,6 +483,34 @@ connection_closed (GDBusConnection *connection,
static void
finish_registration (void)
{
gdk_content_register_serializer (G_TYPE_FILE,
"application/vnd.portal.filetransfer",
portal_file_serializer,
NULL,
NULL);
gdk_content_register_serializer (GDK_TYPE_FILE_LIST,
"application/vnd.portal.filetransfer",
portal_file_serializer,
NULL,
NULL);
gdk_content_register_deserializer ("application/vnd.portal.filetransfer",
GDK_TYPE_FILE_LIST,
portal_file_deserializer,
NULL,
NULL);
gdk_content_register_deserializer ("application/vnd.portal.filetransfer",
G_TYPE_FILE,
portal_file_deserializer,
NULL,
NULL);
/* FIXME: I missed up and used the wrong mime type here when
* I implemented my own protocol. Keep these around for a while
* so we can interoperate with existing flatpaks using GTK 4.6
*/
gdk_content_register_serializer (G_TYPE_FILE,
"application/vnd.portal.files",
portal_file_serializer,

View File

@@ -1,45 +0,0 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly."
#endif
#ifndef __GI_SCANNER__
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkAppLaunchContext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkClipboard, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentProvider, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkCursor, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDevice, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplay, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplayManager, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrag, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrawContext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameClock, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLContext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkMonitor, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSeat, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkPopupLayout, gdk_popup_layout_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkVulkanContext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentFormats, gdk_content_formats_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameTimings, gdk_frame_timings_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkRGBA, gdk_rgba_free)
#endif

View File

@@ -28,12 +28,13 @@
#include "gdkresources.h"
#include "gdkconstructor.h"
#include "gdkdebug.h"
#include "gdkconstructorprivate.h"
#include "gdkdebugprivate.h"
#include "gdkdisplay.h"
#include "gdkglcontextprivate.h"
#include "gdkintl.h"
#include "gdk-private.h"
#include <glib/gi18n-lib.h>
#include "gdkprivate.h"
#include <glib/gprintf.h>
#include <string.h>
#include <stdlib.h>
@@ -116,19 +117,17 @@ static const GdkDebugKey gdk_debug_keys[] = {
{ "vulkan", GDK_DEBUG_VULKAN, "Information about Vulkan" },
{ "selection", GDK_DEBUG_SELECTION, "Information about selections" },
{ "clipboard", GDK_DEBUG_CLIPBOARD, "Information about clipboards" },
{ "nograbs", GDK_DEBUG_NOGRABS, "Disable pointer and keyboard grabs (X11)" },
{ "portals", GDK_DEBUG_PORTALS, "Force the use of portals" },
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support" },
{ "gl-software", GDK_DEBUG_GL_SOFTWARE, "Force OpenGL software rendering" },
{ "gl-texture-rect", GDK_DEBUG_GL_TEXTURE_RECT, "Use OpenGL texture rectangle extension" },
{ "gl-legacy", GDK_DEBUG_GL_LEGACY, "Use a legacy OpenGL context" },
{ "gl-gles", GDK_DEBUG_GL_GLES, "Only allow OpenGL GLES API" },
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
{ "gl-egl", GDK_DEBUG_GL_EGL, "Use EGL on X11 or Windows" },
{ "gl-glx", GDK_DEBUG_GL_GLX, "Use GLX on X11" },
{ "gl-wgl", GDK_DEBUG_GL_WGL, "Use WGL on Windows" },
{ "vulkan-disable", GDK_DEBUG_VULKAN_DISABLE, "Disable Vulkan support" },
{ "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE, "Load the Vulkan validation layer" },
{ "nograbs", GDK_DEBUG_NOGRABS, "Disable pointer and keyboard grabs (X11)", TRUE },
{ "portals", GDK_DEBUG_PORTALS, "Force the use of portals", TRUE },
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support", TRUE },
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL", TRUE },
{ "gl-legacy", GDK_DEBUG_GL_LEGACY, "Use a legacy OpenGL context", TRUE },
{ "gl-gles", GDK_DEBUG_GL_GLES, "Only allow OpenGL GLES API", TRUE },
{ "gl-egl", GDK_DEBUG_GL_EGL, "Use EGL on X11 or Windows", TRUE },
{ "gl-glx", GDK_DEBUG_GL_GLX, "Use GLX on X11", TRUE },
{ "gl-wgl", GDK_DEBUG_GL_WGL, "Use WGL on Windows", TRUE },
{ "vulkan-disable", GDK_DEBUG_VULKAN_DISABLE, "Disable Vulkan support", TRUE },
{ "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE, "Load the Vulkan validation layer", TRUE },
{ "default-settings",GDK_DEBUG_DEFAULT_SETTINGS, "Force default values for xsettings", TRUE },
{ "high-depth", GDK_DEBUG_HIGH_DEPTH, "Use high bit depth rendering if possible", TRUE },
};
@@ -258,16 +257,12 @@ gdk_parse_debug_var (const char *variable,
fprintf (stderr, "Supported %s values:\n", variable);
for (i = 0; i < nkeys; i++) {
fprintf (stderr, " %s%*s%s", keys[i].key, (int)(max_width - strlen (keys[i].key)), " ", keys[i].help);
if (!debug_enabled && !keys[i].always_enabled)
fprintf (stderr, " [unavailable]");
fprintf (stderr, "\n");
if (debug_enabled || keys[i].always_enabled)
fprintf (stderr, " %s%*s%s\n", keys[i].key, (int)(max_width - strlen (keys[i].key)), " ", keys[i].help);
}
fprintf (stderr, " %s%*s%s\n", "all", max_width - 3, " ", "Enable all values");
fprintf (stderr, " %s%*s%s\n", "help", max_width - 4, " ", "Print this help");
fprintf (stderr, "\nMultiple values can be given, separated by : or space.\n");
if (!debug_enabled)
fprintf (stderr, "Values marked as [unavailable] are only accessible if GTK is built with G_ENABLE_DEBUG.\n");
}
if (invert)
@@ -298,11 +293,11 @@ gdk_pre_parse (void)
G_N_ELEMENTS (gdk_debug_keys));
/* These are global */
if (GDK_DEBUG_CHECK (GL_EGL))
if (_gdk_debug_flags & GDK_DEBUG_GL_EGL)
gdk_gl_backend_use (GDK_GL_EGL);
else if (GDK_DEBUG_CHECK (GL_GLX))
else if (_gdk_debug_flags & GDK_DEBUG_GL_GLX)
gdk_gl_backend_use (GDK_GL_GLX);
else if (GDK_DEBUG_CHECK (GL_WGL))
else if (_gdk_debug_flags & GDK_DEBUG_GL_WGL)
gdk_gl_backend_use (GDK_GL_WGL);
#ifndef G_HAS_CONSTRUCTORS
@@ -361,7 +356,7 @@ gdk_running_in_sandbox (void)
gboolean
gdk_should_use_portal (void)
{
if (GDK_DISPLAY_DEBUG_CHECK (NULL, PORTALS))
if (gdk_display_get_debug_flags (NULL) & GDK_DEBUG_PORTALS)
return TRUE;
if (gdk_running_in_sandbox ())

View File

@@ -76,8 +76,6 @@
#include <gdk/gdkversionmacros.h>
#include <gdk/gdkvulkancontext.h>
#include <gdk/gdk-autocleanup.h>
#undef __GDK_H_INSIDE__
#endif /* __GDK_H__ */

View File

@@ -22,7 +22,7 @@
#include "gdkapplaunchcontextprivate.h"
#include "gdkdisplay.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
/**

View File

@@ -54,6 +54,7 @@ GDK_AVAILABLE_IN_ALL
void gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context,
const char *icon_name);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkAppLaunchContext, g_object_unref)
G_END_DECLS

View File

@@ -26,10 +26,10 @@
#include "gdkcontentproviderprivate.h"
#include "gdkcontentserializer.h"
#include "gdkdisplay.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
#include "gdkpipeiostreamprivate.h"
#include "gdktexture.h"
#include "gdk-private.h"
#include "gdkprivate.h"
#include <gobject/gvaluecollector.h>

View File

@@ -120,6 +120,8 @@ GDK_AVAILABLE_IN_ALL
void gdk_clipboard_set_texture (GdkClipboard *clipboard,
GdkTexture *texture);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkClipboard, g_object_unref)
G_END_DECLS
#endif /* __GDK_CLIPBOARD_H__ */

View File

@@ -16,6 +16,8 @@ G_BEGIN_DECLS
#mesondefine GDK_WINDOWING_WAYLAND
#mesondefine GDK_WINDOWING_WIN32
#mesondefine GDK_RENDERING_CAIRO
#mesondefine GDK_RENDERING_GL
#mesondefine GDK_RENDERING_VULKAN
G_END_DECLS

View File

@@ -25,6 +25,7 @@
#include "filetransferportalprivate.h"
#include "gdktexture.h"
#include "gdkrgbaprivate.h"
#include "gdkprivate.h"
#include "loaders/gdkpngprivate.h"
#include "loaders/gdktiffprivate.h"
@@ -354,12 +355,14 @@ gdk_content_deserializer_return_success (GdkContentDeserializer *deserializer)
{
g_return_if_fail (GDK_IS_CONTENT_DESERIALIZER (deserializer));
g_return_if_fail (!deserializer->returned);
guint source_id;
deserializer->returned = TRUE;
g_idle_add_full (deserializer->priority,
gdk_content_deserializer_emit_callback,
deserializer,
g_object_unref);
source_id = g_idle_add_full (deserializer->priority,
gdk_content_deserializer_emit_callback,
deserializer,
g_object_unref);
gdk_source_set_static_name_by_id (source_id, "[gtk] gdk_content_deserializer_emit_callback");
/* NB: the idle will destroy our reference */
}

View File

@@ -106,6 +106,8 @@ GDK_AVAILABLE_IN_ALL
void gdk_content_formats_builder_add_gtype (GdkContentFormatsBuilder *builder,
GType type);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentFormats, gdk_content_formats_unref)
/* dunno where else to put this */
#define GDK_TYPE_FILE_LIST (gdk_file_list_get_type ())
GDK_AVAILABLE_IN_ALL

View File

@@ -22,8 +22,8 @@
#include "gdkclipboard.h"
#include "gdkcontentformats.h"
#include "gdkintl.h"
#include "gdk-private.h"
#include <glib/gi18n-lib.h>
#include "gdkprivate.h"
/**
* GdkContentProvider:

View File

@@ -111,6 +111,9 @@ GDK_AVAILABLE_IN_ALL
gboolean gdk_content_provider_get_value (GdkContentProvider *provider,
GValue *value,
GError **error);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentProvider, g_object_unref)
G_END_DECLS
#endif /* __GDK_CONTENT_PROVIDER_H__ */

View File

@@ -24,10 +24,10 @@
#include "gdkcontentformats.h"
#include "gdkcontentserializer.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
#include "gdkcontentproviderimpl.h"
#include "gdk-private.h"
#include "gdkprivate.h"
#define GDK_TYPE_CONTENT_PROVIDER_VALUE (gdk_content_provider_value_get_type ())
#define GDK_CONTENT_PROVIDER_VALUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_CONTENT_PROVIDER_VALUE, GdkContentProviderValue))

View File

@@ -30,6 +30,7 @@
#include "loaders/gdktiffprivate.h"
#include "loaders/gdkjpegprivate.h"
#include "gdkmemorytextureprivate.h"
#include "gdkprivate.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <string.h>
@@ -360,12 +361,14 @@ gdk_content_serializer_return_success (GdkContentSerializer *serializer)
{
g_return_if_fail (GDK_IS_CONTENT_SERIALIZER (serializer));
g_return_if_fail (!serializer->returned);
guint source_id;
serializer->returned = TRUE;
g_idle_add_full (serializer->priority,
gdk_content_serializer_emit_callback,
serializer,
g_object_unref);
source_id = g_idle_add_full (serializer->priority,
gdk_content_serializer_emit_callback,
serializer,
g_object_unref);
gdk_source_set_static_name_by_id (source_id, "[gtk] gdk_content_serializer_emit_callback");
/* NB: the idle will destroy our reference */
}
@@ -876,7 +879,7 @@ file_text_serializer (GdkContentSerializer *serializer)
g_string_append (str, path);
g_free (path);
if (l->next)
g_string_append (str, " ");
g_string_append (str, "\n");
}
path = g_string_free (str, FALSE);
}

View File

@@ -30,7 +30,7 @@
#include "gdkcursor.h"
#include "gdkcursorprivate.h"
#include "gdktexture.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
#include <math.h>
#include <errno.h>

View File

@@ -64,6 +64,7 @@ int gdk_cursor_get_hotspot_x (GdkCursor *cursor);
GDK_AVAILABLE_IN_ALL
int gdk_cursor_get_hotspot_y (GdkCursor *cursor);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkCursor, g_object_unref)
G_END_DECLS

View File

@@ -21,6 +21,7 @@
#include <glib.h>
#include "gdktypes.h"
#include <glib/gstdio.h>
G_BEGIN_DECLS
@@ -40,8 +41,6 @@ typedef enum {
GDK_DEBUG_NOGRABS = 1 << 11,
GDK_DEBUG_PORTALS = 1 << 12,
GDK_DEBUG_GL_DISABLE = 1 << 13,
GDK_DEBUG_GL_SOFTWARE = 1 << 14,
GDK_DEBUG_GL_TEXTURE_RECT = 1 << 15,
GDK_DEBUG_GL_LEGACY = 1 << 16,
GDK_DEBUG_GL_GLES = 1 << 17,
GDK_DEBUG_GL_DEBUG = 1 << 18,
@@ -60,22 +59,27 @@ GdkDebugFlags gdk_display_get_debug_flags (GdkDisplay *display);
void gdk_display_set_debug_flags (GdkDisplay *display,
GdkDebugFlags flags);
#define gdk_debug_message(format, ...) g_fprintf (stderr, format "\n", ##__VA_ARGS__)
#ifdef G_ENABLE_DEBUG
#define GDK_DISPLAY_DEBUG_CHECK(display,type) \
G_UNLIKELY (gdk_display_get_debug_flags (display) & GDK_DEBUG_##type)
#define GDK_DISPLAY_NOTE(display,type,action) G_STMT_START { \
#define GDK_DISPLAY_DEBUG(display,type,...) \
G_STMT_START { \
if (GDK_DISPLAY_DEBUG_CHECK (display,type)) \
{ action; }; } G_STMT_END
gdk_debug_message (__VA_ARGS__); \
} G_STMT_END
#else /* !G_ENABLE_DEBUG */
#define GDK_DISPLAY_DEBUG_CHECK(display,type) 0
#define GDK_DISPLAY_NOTE(display,type,action)
#define GDK_DISPLAY_DEBUG(display,type,...)
#endif /* G_ENABLE_DEBUG */
#define GDK_DEBUG_CHECK(type) GDK_DISPLAY_DEBUG_CHECK (NULL,type)
#define GDK_NOTE(type,action) GDK_DISPLAY_NOTE (NULL,type,action)
#define GDK_DEBUG(type,...) GDK_DISPLAY_DEBUG (NULL,type,__VA_ARGS__)
#endif

View File

@@ -22,7 +22,7 @@
#include "gdkdeviceprivate.h"
#include "gdkdevicetool.h"
#include "gdkdisplayprivate.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
#include "gdkkeysprivate.h"
/**

View File

@@ -126,6 +126,9 @@ GdkSurface * gdk_device_get_surface_at_position (GdkDevice *device,
GDK_AVAILABLE_IN_4_2
guint32 gdk_device_get_timestamp (GdkDevice *device);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDevice, g_object_unref)
G_END_DECLS
#endif /* __GDK_DEVICE_H__ */

View File

@@ -21,7 +21,7 @@
#include "gdkdevicetoolprivate.h"
#include "gdkenumtypes.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
/**
* GdkDeviceTool:

View File

@@ -24,8 +24,8 @@
#include "gdkdisplay.h"
#include "gdkdisplayprivate.h"
#include "gdkintl.h"
#include "gdk-private.h"
#include <glib/gi18n-lib.h>
#include "gdkprivate.h"
#include "gdkapplaunchcontext.h"
#include "gdkclipboardprivate.h"
@@ -1233,7 +1233,7 @@ gdk_display_init_gl (GdkDisplay *self)
before = GDK_PROFILER_CURRENT_TIME;
if (GDK_DISPLAY_DEBUG_CHECK (self, GL_DISABLE))
if (gdk_display_get_debug_flags (self) & GDK_DEBUG_GL_DISABLE)
{
g_set_error_literal (&priv->gl_error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
@@ -1729,28 +1729,31 @@ gdk_display_init_egl (GdkDisplay *self,
if (priv->egl_config_high_depth == NULL)
priv->egl_config_high_depth = priv->egl_config;
GDK_DISPLAY_NOTE (self, OPENGL, {
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (self, OPENGL))
{
char *ext = describe_extensions (priv->egl_display);
char *std_cfg = describe_egl_config (priv->egl_display, priv->egl_config);
char *hd_cfg = describe_egl_config (priv->egl_display, priv->egl_config_high_depth);
g_message ("EGL API version %d.%d found\n"
" - Vendor: %s\n"
" - Version: %s\n"
" - Client APIs: %s\n"
" - Extensions:\n"
"\t%s\n"
" - Selected fbconfig: %s\n"
" high depth: %s",
major, minor,
eglQueryString (priv->egl_display, EGL_VENDOR),
eglQueryString (priv->egl_display, EGL_VERSION),
eglQueryString (priv->egl_display, EGL_CLIENT_APIS),
ext, std_cfg,
priv->egl_config_high_depth == priv->egl_config ? "none" : hd_cfg);
gdk_debug_message ("EGL API version %d.%d found\n"
" - Vendor: %s\n"
" - Version: %s\n"
" - Client APIs: %s\n"
" - Extensions:\n"
"\t%s\n"
" - Selected fbconfig: %s\n"
" high depth: %s",
major, minor,
eglQueryString (priv->egl_display, EGL_VENDOR),
eglQueryString (priv->egl_display, EGL_VERSION),
eglQueryString (priv->egl_display, EGL_CLIENT_APIS),
ext, std_cfg,
priv->egl_config_high_depth == priv->egl_config ? "none" : hd_cfg);
g_free (hd_cfg);
g_free (std_cfg);
g_free (ext);
});
}
#endif
gdk_profiler_end_mark (start_time, "init EGL", NULL);

View File

@@ -136,7 +136,7 @@ gboolean gdk_display_get_setting (GdkDisplay *display,
const char *name,
GValue *value);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplay, g_object_unref)
G_END_DECLS

View File

@@ -28,7 +28,7 @@
#include "gdkdisplaymanagerprivate.h"
#include "gdkdisplayprivate.h"
#include "gdkkeysprivate.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
#ifdef GDK_WINDOWING_X11
#include "x11/gdkx.h"
@@ -420,7 +420,7 @@ gdk_display_manager_open_display (GdkDisplayManager *manager,
(any && strstr (allowed_backends, gdk_backends[j].name)) ||
g_str_equal (backend, gdk_backends[j].name))
{
GDK_NOTE (MISC, g_message ("Trying %s backend", gdk_backends[j].name));
GDK_DEBUG (MISC, "Trying %s backend", gdk_backends[j].name);
display = gdk_backends[j].open_display (name);
if (display)
break;

View File

@@ -34,7 +34,6 @@
G_BEGIN_DECLS
#define GDK_TYPE_DISPLAY_MANAGER (gdk_display_manager_get_type ())
#define GDK_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY_MANAGER, GdkDisplayManager))
#define GDK_IS_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY_MANAGER))
@@ -58,6 +57,7 @@ GdkDisplay * gdk_display_manager_open_display (GdkDisplayManager *m
GDK_AVAILABLE_IN_ALL
void gdk_set_allowed_backends (const char *backends);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplayManager, g_object_unref)
G_END_DECLS

View File

@@ -22,7 +22,7 @@
#include "gdksurface.h"
#include "gdkcursor.h"
#include "gdkmonitor.h"
#include "gdkdebug.h"
#include "gdkdebugprivate.h"
#include "gdksurfaceprivate.h"
#include "gdkkeysprivate.h"
#include "gdkdeviceprivate.h"

View File

@@ -42,7 +42,7 @@
#include "gdkdragprivate.h"
#include "gdkdisplay.h"
#include "gdksurface.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
#include "gdkcontentformats.h"
#include "gdkcontentprovider.h"
#include "gdkcontentserializer.h"

View File

@@ -99,6 +99,8 @@ GdkContentProvider *
GDK_AVAILABLE_IN_ALL
GdkSurface * gdk_drag_get_surface (GdkDrag *drag);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrag, g_object_unref)
G_END_DECLS
#endif /* __GDK_DND_H__ */

View File

@@ -19,9 +19,9 @@
#include "config.h"
#include "gdk-private.h"
#include "gdkprivate.h"
#include "gdkdragsurfaceprivate.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
/**
* GdkDragSurface:

View File

@@ -22,8 +22,8 @@
#include "gdkdrawcontextprivate.h"
#include "gdkdebug.h"
#include "gdkintl.h"
#include "gdkdebugprivate.h"
#include <glib/gi18n-lib.h>
#include "gdkprofilerprivate.h"
#include "gdksurfaceprivate.h"
@@ -364,7 +364,7 @@ gdk_draw_context_begin_frame_full (GdkDrawContext *context,
return;
}
if (GDK_DISPLAY_DEBUG_CHECK (priv->display, HIGH_DEPTH))
if (gdk_display_get_debug_flags (priv->display) & GDK_DEBUG_HIGH_DEPTH)
prefers_high_depth = TRUE;
priv->frame_region = cairo_region_copy (region);

View File

@@ -52,6 +52,8 @@ gboolean gdk_draw_context_is_in_frame (GdkDrawContext
GDK_AVAILABLE_IN_ALL
const cairo_region_t * gdk_draw_context_get_frame_region (GdkDrawContext *context);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrawContext, g_object_unref)
G_END_DECLS
#endif /* __GDK_DRAW_CONTEXT__ */

View File

@@ -49,7 +49,7 @@
#include "gdkdragprivate.h"
#include "gdkenumtypes.h"
#include "gdkeventsprivate.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
#include "gdkpipeiostreamprivate.h"
#include "gdksurface.h"

View File

@@ -31,8 +31,6 @@
G_BEGIN_DECLS
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrop, g_object_unref)
#define GDK_TYPE_DROP (gdk_drop_get_type ())
#define GDK_DROP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DROP, GdkDrop))
#define GDK_IS_DROP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DROP))
@@ -85,6 +83,8 @@ const GValue * gdk_drop_read_value_finish (GdkDrop
GAsyncResult *result,
GError **error);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrop, g_object_unref)
G_END_DECLS
#endif /* __GDK_DROP_H__ */

View File

@@ -1,41 +0,0 @@
/*** BEGIN file-header ***/
#include "config.h"
#include "gdk.h"
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@basename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
GType
@enum_name@_get_type (void)
{
static gsize g_define_type_id__volatile = 0;
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const G@Type@Value values[] = {
/*** END value-header ***/
/*** BEGIN value-production ***/
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
/*** END value-production ***/
/*** BEGIN value-tail ***/
{ 0, NULL, NULL }
};
GType g_define_type_id =
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return g_define_type_id__volatile;
}
/*** END value-tail ***/
/*** BEGIN file-tail ***/
/**/
/*** END file-tail ***/

View File

@@ -1,29 +0,0 @@
/*** BEGIN file-header ***/
#ifndef __GDK_ENUM_TYPES_H__
#define __GDK_ENUM_TYPES_H__
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly."
#endif
#include <glib-object.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@basename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
GDK_AVAILABLE_IN_ALL GType @enum_name@_get_type (void) G_GNUC_CONST;
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
/*** END value-header ***/
/*** BEGIN file-tail ***/
G_END_DECLS
#endif /* __GDK_ENUM_TYPES_H__ */
/*** END file-tail ***/

View File

@@ -28,10 +28,10 @@
#include "gdkdragprivate.h"
#include "gdkdropprivate.h"
#include "gdkeventsprivate.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
#include "gdkkeysprivate.h"
#include "gdkkeysyms.h"
#include "gdk-private.h"
#include "gdkprivate.h"
#include <gobject/gvaluecollector.h>
@@ -402,12 +402,15 @@ gdk_event_alloc (GdkEventType event_type,
GdkEvent *event = (GdkEvent *) g_type_create_instance (gdk_event_types[event_type]);
GDK_NOTE (EVENTS, {
char *str = g_enum_to_string (GDK_TYPE_EVENT_TYPE, event_type);
g_message ("Allocating a new %s for event type %s",
g_type_name (gdk_event_types[event_type]), str);
g_free (str);
});
#ifdef G_ENABLE_DEBUG
if (GDK_DEBUG_CHECK (EVENTS))
{
char *str = g_enum_to_string (GDK_TYPE_EVENT_TYPE, event_type);
gdk_debug_message ("Allocating a new %s for event type %s",
g_type_name (gdk_event_types[event_type]), str);
g_free (str);
}
#endif
event->event_type = event_type;
event->surface = surface != NULL ? g_object_ref (surface) : NULL;
@@ -1514,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)
{
@@ -1525,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,
@@ -1549,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`.
*
@@ -1563,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);
@@ -1576,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;
}
@@ -1606,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
@@ -1773,7 +1812,7 @@ gdk_key_event_matches (GdkEvent *event,
guint ev_keyval;
int layout;
int level;
GdkModifierType consumed_modifiers;
GdkModifierType ignored_modifiers;
GdkModifierType shift_group_mask;
gboolean group_mod_is_accel_mod = FALSE;
const GdkModifierType mask = GDK_CONTROL_MASK |
@@ -1792,7 +1831,23 @@ gdk_key_event_matches (GdkEvent *event,
ev_keyval = self->translated[1].keyval;
layout = self->translated[1].layout;
level = self->translated[1].level;
consumed_modifiers = self->translated[1].consumed;
/*
* If a modifier is currently active (e.g. Shift is pressed) and was marked
* as consumed, we ignore it for the purposes of matching shortcuts.
* For example, when Ctrl+Shift+[plus/equals key] is translated into
* Ctrl+plus on a keyboard where Shift+equals is the plus sign, we want
* shortcuts for either <Control><Shift>plus or <Control>plus to match.
* (See https://bugzilla.gnome.org/show_bug.cgi?id=100439)
*
* If a modifier is *not* currently active, the X11 backend can sometimes
* mark it as consumed where the Wayland and Windows backends do not.
* In this case, we still want to pay attention to its state.
* For example, when Ctrl+x is translated into Ctrl+x, we only want to
* trigger shortcuts for <Control>x, not for <Control><Shift>x.
* (See https://gitlab.gnome.org/GNOME/gtk/-/issues/5095)
*/
ignored_modifiers = (self->translated[1].consumed & state);
/* if the group-toggling modifier is part of the default accel mod
* mask, and it is active, disable it for matching
@@ -1804,7 +1859,7 @@ gdk_key_event_matches (GdkEvent *event,
if (mask & shift_group_mask)
group_mod_is_accel_mod = TRUE;
if ((modifiers & ~consumed_modifiers & mask) == (state & ~consumed_modifiers & mask))
if ((modifiers & ~ignored_modifiers & mask) == (state & ~ignored_modifiers & mask))
{
/* modifier match */
GdkKeymapKey *keys;

View File

@@ -38,7 +38,6 @@
G_BEGIN_DECLS
#define GDK_TYPE_EVENT (gdk_event_get_type ())
#define GDK_TYPE_EVENT_SEQUENCE (gdk_event_sequence_get_type ())
@@ -551,6 +550,9 @@ gboolean gdk_key_event_get_match (GdkEvent *event,
guint *keyval,
GdkModifierType *modifiers);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, gdk_event_unref)
G_END_DECLS
#endif /* __GDK_EVENTS_H__ */

View File

@@ -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__ */

View File

@@ -106,6 +106,8 @@ void gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock,
GDK_AVAILABLE_IN_ALL
double gdk_frame_clock_get_fps (GdkFrameClock *frame_clock);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameClock, g_object_unref)
G_END_DECLS
#endif /* __GDK_FRAME_CLOCK_H__ */

View File

@@ -26,9 +26,9 @@
#include "gdkframeclockidleprivate.h"
#include "gdkdebug.h"
#include "gdkdebugprivate.h"
#include "gdkframeclockprivate.h"
#include "gdk-private.h"
#include "gdkprivate.h"
#include "gdkprofilerprivate.h"
#ifdef G_OS_WIN32
@@ -123,6 +123,7 @@ get_sleep_serial (void)
{
sleep_source = g_source_new (&sleep_source_funcs, sizeof (GSource));
g_source_set_static_name (sleep_source, "[gtk] sleep serial");
g_source_set_priority (sleep_source, G_PRIORITY_HIGH);
g_source_attach (sleep_source, NULL);
g_source_unref (sleep_source);

View File

@@ -51,6 +51,8 @@ gint64 gdk_frame_timings_get_refresh_interval (GdkFrameTimings *timin
GDK_AVAILABLE_IN_ALL
gint64 gdk_frame_timings_get_predicted_presentation_time (GdkFrameTimings *timings);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameTimings, gdk_frame_timings_unref)
G_END_DECLS
#endif /* __GDK_FRAME_TIMINGS_H__ */

View File

@@ -76,14 +76,14 @@
#include "gdkglcontextprivate.h"
#include "gdkdebug.h"
#include "gdkdebugprivate.h"
#include "gdkdisplayprivate.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
#include "gdkmemoryformatprivate.h"
#include "gdkmemorytextureprivate.h"
#include "gdkprofilerprivate.h"
#include "gdk-private.h"
#include "gdkprivate.h"
#ifdef GDK_WINDOWING_WIN32
# include "gdk/win32/gdkwin32.h"
@@ -193,7 +193,7 @@ gdk_gl_context_dispose (GObject *gobject)
if (eglGetCurrentContext () == priv->egl_context)
eglMakeCurrent(egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Destroying EGL context"));
GDK_DISPLAY_DEBUG (display, OPENGL, "Destroying EGL context");
eglDestroyContext (egl_display, priv->egl_context);
priv->egl_context = NULL;
@@ -339,13 +339,13 @@ gdk_gl_context_create_egl_context (GdkGLContext *context,
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
major, minor,
debug_bit ? "yes" : "no",
forward_bit ? "yes" : "no",
legacy ? "yes" : "no",
api == GDK_GL_API_GLES ? "yes" : "no"));
GDK_DISPLAY_DEBUG (display, OPENGL,
"Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
major, minor,
debug_bit ? "yes" : "no",
forward_bit ? "yes" : "no",
legacy ? "yes" : "no",
api == GDK_GL_API_GLES ? "yes" : "no");
ctx = eglCreateContext (egl_display,
egl_config,
@@ -355,7 +355,7 @@ gdk_gl_context_create_egl_context (GdkGLContext *context,
if (ctx == NULL)
return 0;
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Created EGL context[%p]", ctx));
GDK_DISPLAY_DEBUG (display, OPENGL, "Created EGL context[%p]", ctx);
priv->egl_context = ctx;
gdk_gl_context_set_is_legacy (context, legacy);
@@ -395,8 +395,8 @@ gdk_gl_context_realize_egl (GdkGLContext *context,
return 0;
}
prefer_legacy = (GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ||
(share != NULL && gdk_gl_context_is_legacy (share)));
prefer_legacy = (gdk_display_get_debug_flags(display) & GDK_DEBUG_GL_LEGACY) ||
(share != NULL && gdk_gl_context_is_legacy (share));
if (preferred_api == GDK_GL_API_GL)
{
@@ -1265,7 +1265,7 @@ gdk_gl_context_is_api_allowed (GdkGLContext *self,
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (self);
if (GDK_DISPLAY_DEBUG_CHECK (gdk_gl_context_get_display (self), GL_GLES))
if (gdk_display_get_debug_flags (gdk_gl_context_get_display (self)) & GDK_DEBUG_GL_GLES)
{
if (!(api & GDK_GL_API_GLES))
{
@@ -1485,9 +1485,7 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
gboolean gl_debug = FALSE;
#ifdef G_ENABLE_DEBUG
GdkDisplay *display;
#endif
if (!gdk_gl_context_is_realized (context))
return;
@@ -1500,16 +1498,10 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
priv->has_debug_output = epoxy_has_gl_extension ("GL_ARB_debug_output") ||
epoxy_has_gl_extension ("GL_KHR_debug");
#ifdef G_ENABLE_DEBUG
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
gl_debug = GDK_DISPLAY_DEBUG_CHECK (display, GL_DEBUG);
#endif
gl_debug = (gdk_display_get_debug_flags (display) & GDK_DEBUG_GL_DEBUG) != 0;
if (priv->has_debug_output
#ifndef G_ENABLE_CONSISTENCY_CHECKS
&& gl_debug
#endif
)
if (priv->has_debug_output && gl_debug)
{
gdk_gl_context_make_current (context);
glEnable (GL_DEBUG_OUTPUT);
@@ -1541,20 +1533,20 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
priv->has_half_float = gdk_gl_context_check_version (context, 3, 0, 3, 0) ||
epoxy_has_gl_extension ("OES_vertex_half_float");
GDK_DISPLAY_NOTE (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), OPENGL,
g_message ("%s version: %d.%d (%s)\n"
"* GLSL version: %s\n"
"* Extensions checked:\n"
" - GL_KHR_debug: %s\n"
" - GL_EXT_unpack_subimage: %s\n"
" - OES_vertex_half_float: %s",
gdk_gl_context_get_use_es (context) ? "OpenGL ES" : "OpenGL",
priv->gl_version / 10, priv->gl_version % 10,
priv->is_legacy ? "legacy" : "core",
glGetString (GL_SHADING_LANGUAGE_VERSION),
priv->has_khr_debug ? "yes" : "no",
priv->has_unpack_subimage ? "yes" : "no",
priv->has_half_float ? "yes" : "no"));
GDK_DISPLAY_DEBUG (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), OPENGL,
"%s version: %d.%d (%s)\n"
"* GLSL version: %s\n"
"* Extensions checked:\n"
" - GL_KHR_debug: %s\n"
" - GL_EXT_unpack_subimage: %s\n"
" - OES_vertex_half_float: %s",
gdk_gl_context_get_use_es (context) ? "OpenGL ES" : "OpenGL",
priv->gl_version / 10, priv->gl_version % 10,
priv->is_legacy ? "legacy" : "core",
glGetString (GL_SHADING_LANGUAGE_VERSION),
priv->has_khr_debug ? "yes" : "no",
priv->has_unpack_subimage ? "yes" : "no",
priv->has_half_float ? "yes" : "no");
priv->extensions_checked = TRUE;
}
@@ -1844,8 +1836,8 @@ gdk_gl_backend_use (GdkGLBackend backend_type)
the_gl_backend_type = backend_type;
/* This is important!!!11eleven
* (But really: How do I print a message in 2 categories?) */
GDK_NOTE (OPENGL, g_print ("Using OpenGL backend %s\n", gl_backend_names[the_gl_backend_type]));
GDK_NOTE (MISC, g_message ("Using Opengl backend %s", gl_backend_names[the_gl_backend_type]));
GDK_DEBUG (OPENGL, "Using OpenGL backend %s", gl_backend_names[the_gl_backend_type]);
GDK_DEBUG (MISC, "Using OpenGL backend %s", gl_backend_names[the_gl_backend_type]);
}
g_assert (the_gl_backend_type == backend_type);

View File

@@ -114,6 +114,8 @@ GdkGLContext * gdk_gl_context_get_current (void);
GDK_AVAILABLE_IN_ALL
void gdk_gl_context_clear_current (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLContext, g_object_unref)
G_END_DECLS
#endif /* __GDK_GL_CONTEXT_H__ */

View File

@@ -36,8 +36,6 @@ G_BEGIN_DECLS
typedef struct _GdkGLTexture GdkGLTexture;
typedef struct _GdkGLTextureClass GdkGLTextureClass;
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLTexture, g_object_unref)
GDK_AVAILABLE_IN_ALL
GType gdk_gl_texture_get_type (void) G_GNUC_CONST;
@@ -52,6 +50,7 @@ GdkTexture * gdk_gl_texture_new (GdkGLContext
GDK_AVAILABLE_IN_ALL
void gdk_gl_texture_release (GdkGLTexture *self);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLTexture, g_object_unref)
G_END_DECLS

View File

@@ -1,103 +0,0 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include "gdkkeysyms.h"
/* Key handling not part of the keymap */
#include "keyname-table.h"
#include <glib/gprintf.h>
#include <stdlib.h>
#include <string.h>
#define GDK_NUM_KEYS G_N_ELEMENTS (gdk_keys_by_keyval)
static int
gdk_keys_keyval_compare (const void *pkey, const void *pbase)
{
return (*(int *) pkey) - ((gdk_key *) pbase)->keyval;
}
static char *
_gdk_keyval_name (guint keyval)
{
static char buf[100];
gdk_key *found;
/* Check for directly encoded 24-bit UCS characters: */
if ((keyval & 0xff000000) == 0x01000000)
{
g_sprintf (buf, "U+%.04X", (keyval & 0x00ffffff));
return buf;
}
found = bsearch (&keyval, gdk_keys_by_keyval,
GDK_NUM_KEYS, sizeof (gdk_key),
gdk_keys_keyval_compare);
if (found != NULL)
{
while ((found > gdk_keys_by_keyval) &&
((found - 1)->keyval == keyval))
found--;
return (char *) (keynames + found->offset);
}
else if (keyval != 0)
{
g_sprintf (buf, "%#x", keyval);
return buf;
}
return NULL;
}
static int
gdk_keys_name_compare (const void *pkey, const void *pbase)
{
return strcmp ((const char *) pkey,
(const char *) (keynames + ((const gdk_key *) pbase)->offset));
}
static guint
_gdk_keyval_from_name (const char *keyval_name)
{
gdk_key *found;
g_return_val_if_fail (keyval_name != NULL, 0);
if (strncmp (keyval_name,"XF86", 4) == 0)
keyval_name += 4;
found = bsearch (keyval_name, gdk_keys_by_name,
GDK_NUM_KEYS, sizeof (gdk_key),
gdk_keys_name_compare);
if (found != NULL)
return found->keyval;
else
return GDK_KEY_VoidSymbol;
}

View File

@@ -29,6 +29,11 @@
#include "gdkdisplay.h"
#include "gdkdisplaymanagerprivate.h"
#include "keynamesprivate.h"
#include <glib/gprintf.h>
#include <stdlib.h>
#include <string.h>
enum {
PROP_0,
PROP_DISPLAY,
@@ -614,7 +619,73 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
consumed_modifiers);
}
#include "gdkkeynames.c"
static int
gdk_keys_keyval_compare (const void *pkey, const void *pbase)
{
return (*(int *) pkey) - ((gdk_key *) pbase)->keyval;
}
static char *
_gdk_keyval_name (guint keyval)
{
static char buf[100];
gdk_key *found;
/* Check for directly encoded 24-bit UCS characters: */
if ((keyval & 0xff000000) == 0x01000000)
{
g_sprintf (buf, "U+%.04X", (keyval & 0x00ffffff));
return buf;
}
found = bsearch (&keyval,
gdk_keys_by_keyval, G_N_ELEMENTS (gdk_keys_by_keyval),
sizeof (gdk_key),
gdk_keys_keyval_compare);
if (found != NULL)
{
while ((found > gdk_keys_by_keyval) &&
((found - 1)->keyval == keyval))
found--;
return (char *) (keynames + found->offset);
}
else if (keyval != 0)
{
g_sprintf (buf, "%#x", keyval);
return buf;
}
return NULL;
}
static int
gdk_keys_name_compare (const void *pkey, const void *pbase)
{
return strcmp ((const char *) pkey,
(const char *) (keynames + ((const gdk_key *) pbase)->offset));
}
static guint
_gdk_keyval_from_name (const char *keyval_name)
{
gdk_key *found;
g_return_val_if_fail (keyval_name != NULL, 0);
if (strncmp (keyval_name,"XF86", 4) == 0)
keyval_name += 4;
found = bsearch (keyval_name,
gdk_keys_by_name, G_N_ELEMENTS (gdk_keys_by_name),
sizeof (gdk_key),
gdk_keys_name_compare);
if (found != NULL)
return found->keyval;
else
return GDK_KEY_VoidSymbol;
}
/**
* gdk_keyval_name:

View File

@@ -87,6 +87,8 @@ GdkSubpixelLayout gdk_monitor_get_subpixel_layout (GdkMonitor *monitor);
GDK_AVAILABLE_IN_ALL
gboolean gdk_monitor_is_valid (GdkMonitor *monitor);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkMonitor, g_object_unref)
G_END_DECLS
#endif /* __GDK_MONITOR_H__ */

View File

@@ -22,7 +22,7 @@
#include "gdkpaintable.h"
#include "gdksnapshotprivate.h"
#include "gdk-private.h"
#include "gdkprivate.h"
/* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */
void gtk_snapshot_push_debug (GdkSnapshot *snapshot,

View File

@@ -19,7 +19,7 @@
#include "gdkpango.h"
#include "gdkintl.h"
#include <glib/gi18n-lib.h>
#include <math.h>
#include <pango/pangocairo.h>

View File

@@ -19,8 +19,8 @@
#include "config.h"
#include "gdk-private.h"
#include "gdkintl.h"
#include "gdkprivate.h"
#include <glib/gi18n-lib.h>
#include "gdkpopupprivate.h"
/**

View File

@@ -146,6 +146,7 @@ void gdk_popup_layout_get_shadow_width (GdkPopupLayout
int *top,
int *bottom);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkPopupLayout, gdk_popup_layout_unref)
G_END_DECLS

View File

@@ -69,6 +69,7 @@ gboolean gdk_rgba_parse (GdkRGBA *rgba,
GDK_AVAILABLE_IN_ALL
char * gdk_rgba_to_string (const GdkRGBA *rgba) G_GNUC_MALLOC;
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkRGBA, gdk_rgba_free)
G_END_DECLS

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