summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* general: Add libportal-gtk3 dependencyabderrahim/libportalAntónio Fernandes2021-12-255-5/+10
| | | | | | | The portal-gtk3.h header has been moved into a separate library which binds gtk3 explicitly. https://github.com/flatpak/libportal/pull/53
* Stop using gtk_widget_new()António Fernandes2021-12-243-4/+4
| | | | Gone in GTK 4. Just use g_object_new() and cast as necessary.
* shell-search-provider: Prepare for gtk_show_uri_full()António Fernandes2021-12-241-8/+31
| | | | | | | | gtk_show_uri_on_window() is gone in GTK 4. Instead, we are going to need gtk_show_uri_full(), which uses an async result API. Split the code in advance, to reduce the necessary changes at the time of the GTK 3 to 4 switch.
* compress-dialog-controller: Drop signals from UI fileAntónio Fernandes2021-12-242-27/+16
| | | | | | | | | | | | | | | | | | We have signals defined in the GtkBuilder UI XML file. However, as we are not using it as a template (we are not subclassing GtkDialog), we still need to manually bind the callback symbols and even explicitly bind them with gtk_builder_connect_signals(). In GTK 4 gtk_builder_connect_signals() is gone and the alternative is setting the signal data (in this case, 'self') before loading the UI definition. However, we need to load the UI definition before we create 'self', because some widgets are requires as construct-only properties. Given this circular dependency, doing it the GTK 4 way is impossibile. Therefore, just connect signals in code and remove them from the UI file. This is compatible with GTK 4. And even under GTK 3 its simpler!
* Update Indonesian translationKukuh Syafaat2021-12-241-450/+366
|
* batch-rename-dialog: Replace ::event handlers with controllersErnestas Kulik2021-12-221-52/+33
| | | | Rebased and ammended by António Fernandes <antoniof@gnome.org>
* rename-file-popover-controller: Use controller for key eventsErnestas Kulik2021-12-221-23/+16
| | | | Rebased and ammended by António Fernandes <antoniof@gnome.org>
* window-slot: Don't forward Escape and BackSpaceAntónio Fernandes2021-12-221-2/+8
| | | | | | | | Unless it is already visible. This fixes a regression caused by the previous commit. Making it a separate commit because I'm not sure why this is needed now if it wasn't before.
* query-editor: Drop gtk_search_entry_handle_event()António Fernandes2021-12-225-28/+58
| | | | | | | | | It's going away in GTK4. Also, as we use a key event controller now, we can use gtk_event_controller_key_forward() instead. This is how GTK4 implements gtk_search_entry_set_key_capture_widget(), so reimplement it here. We were not going to inherit anyway, because we need a custom widget for a tagged entry in GTK4.
* window: Drop usage of gtk_window_propagate_key_eventAntónio Fernandes2021-12-221-4/+1
| | | | | It's going away in GTK4. Also, as we use a key event controller now, we can use gtk_event_controller_key_forward() instead.
* window: Use controller for handling key eventsAntónio Fernandes2021-12-221-15/+49
| | | | | | | | | | | | | | When overriding the ::key-press-event we are able to do things both before and after chaining up in a single funtion. As the ::event-press-event is going away with GTK4, we are porting to event controllers. However, they don't have a chaining up mechanism. Instead, split the logic into two event controller signal handlers, one for "before" (capture phase) and one for "after" (bubble phase). This ensures behavior is preserved with relation to accelerators. Inspired by Ernestas Kulik's earlier port.
* window: Set media keys as regular accelsAntónio Fernandes2021-12-221-49/+7
| | | | | | | Media keys are handled in the ::key-press-event signal. This signal is going away in GTK4 and there is no reason not to set these keyboard shortcuts the same way as all other accels.
* window: Inline accels arrayAntónio Fernandes2021-12-221-21/+7
| | | | | This is more readable and prepares for next commit where even more arrays are to be introduced.
* window: Add media key shortcut to StarredAntónio Fernandes2021-12-221-1/+16
| | | | | | | | The Favorites media key is set as an accel for the "win.bookmarks" action, which has been removed many years ago along with the bookmarks editor. But now we have a Starred view, which fits nicely.
* window-slot: Add media key accel for searchAntónio Fernandes2021-12-222-2/+8
| | | | | | | This accelerator has been set for a "win.search" action which presumably used to exist in the past, but doesn't anymore. Move it to the "slot.search-active" action.
* files-view: Stop handling ::eventAntónio Fernandes2021-12-221-55/+0
| | | | | | | | | | | | The signal is gone in GTK4. Here, it's used to trigger the zoom actions when the zoom media keys are pressed. However, the zoom media keys are also already set as accelerators, since commit 593008d00d3777c44f3f41247ce0303aee447631 Therefore, we can just drop this redundant code.
* location-entry: Use event controller for key eventsAntónio Fernandes2021-12-221-46/+21
| | | | Preparing for GTK4, where the ::event signal will be gone.
* location-entry: Track text changes through GtkEditableAntónio Fernandes2021-12-221-64/+40
| | | | | | | | | | | | | We have been keeping a copy of GtkEntry code to guess whether a key event would insert text into the entry. Not only is this a hack, it also relies on overriding the ::event signal and chaining it up, which won't be possible in GTK4 where the ::event signal is gone. Instead of guessing, we can know for sure whether characters have been inserted or deleted by listening to GtkEditable::insert-text and GtkEditable::delete-text.
* location-entry: Set :inline-completion to FALSEAntónio Fernandes2021-12-221-1/+1
| | | | | | | | | We already do the prefix completion manually by calling gtk_entry_completion_insert_prefix(), because we want full control of when we do that. So, disable the automatic prefix completion. Also, this is necessary to prevent a regression in the next commit.
* location-entry: Check position on idleAntónio Fernandes2021-12-221-44/+34
| | | | | | | | | | We only want to do completions when we are typing at the end of the text. So, we schedule completions on idle depending on this condition. But we can achieve the same by checking scheduling unconditionally and check for the condition on idle instead. This leads to simpler code, resolves a FIXME, and takes code out of the ::event handler, which will enable the port to event controllers in preparation for GTK4.
* list-view: Cleanup long press gesture at ::finalizeAntónio Fernandes2021-12-222-16/+21
| | | | Also, restyle code to make it more readable.
* list-view: Stop connecting to header button ::eventAntónio Fernandes2021-12-221-37/+9
| | | | | | | | | | The ::event signal is gone in GTK4. We already have a gesture for clicks, use it instead. This commit also prepares for turning the menu into a popover, by passing the x, y coordinates instead of a GdkEvent. This is to avoid conflicts with the changes in another branch.
* list-view: Separate column event and menu codeAntónio Fernandes2021-12-221-13/+24
| | | | | This is a preparation for the next commit, in order to avoid conflict between branches.
* list-view: Stop chaining up to ::button_press_event()António Fernandes2021-12-221-55/+23
| | | | | | | | | | | | | | | | | | | | | | | | Event signals are gone in GTK4. We rely on the chain-up for two cases: - holding Shift while clicking - clicking an unselected row (without holding Ctrl) The later can be easily emulated in our side. For the former, we can fall through and let GtkTreeView's default handler do everything. Side effects of this change: - secondary click while holding down Shift: BEFORE: opens context menu without changing selection, even when clicking outside selection; AFTER: range-select without opening the context menu. - click on expander while holding down Ctrl: BEFORE: adds row to selection and expands tree simultaneously; AFTER: expands tree without changing selection. Both are exotic corner cases without an obvious expected behavior and the behavior before this change is unexpected and inconsistent. So, the side effects are neutral at worst. Not worth keeping the chain-up.
* list-view: Remove duplicate click selection codeAntónio Fernandes2021-12-221-46/+11
| | | | | | | | Primary and secondary click have similar code for handling selection with modifiers, with some corner case inconsistencies. Unifying the code path resolves the inconsistencies and simplifies the code.
* list-view: Use coordinates passed by gestureAntónio Fernandes2021-12-221-7/+7
| | | | | | | | | | | | We have coordinates right there in the gesture ::release signal, but are still getting coordinates from GdkEvent. This is because gtk_tree_view_get_path_at_pos() requires bin_window coordinates, which happened to be what the GdkEvent coordinates are (because bin_window is the event's GdkWindow). In order to use gesture coordinates, we need to translate them into bin coordinates.
* list-view: Merge did_not_drag() into its callerAntónio Fernandes2021-12-221-75/+65
| | | | | | | | | | | This function has only one caller and it relies on the passed GdkEvent for everything. However, in GTK 4, we are going to depend less on GdkEvent and more on the gesture itself and its signal handler parameters. So, inline the function to make sure we have everything at ready for when we switch to GTK 4.
* list-view: Drop ignore_button_releaseAntónio Fernandes2021-12-222-8/+1
| | | | This has no effect nowadays.
* list-view: Remove event window comparisonAntónio Fernandes2021-12-221-2/+2
| | | | | | | GdkWindow is an X11'ism that's gone in GTK4. If the event is not in the bin window, then it's in the header, So, we can check for clicks in the header using event coordinates instead.
* list-view: Translate coordinates for underline on hoverAntónio Fernandes2021-12-221-2/+12
| | | | | | | | | | | gtk_tree_view_get_path_at_pos() requires bin_window coordinates, which happened to be what the ::event coordinates were (because bin_window was the event's GdkWindow). However, with GtkEventControllerMotion we get widget coordinates. This causes glytches with the underline. Translating the coordinates fixes the regression.
* list-view: Rearrange codeAntónio Fernandes2021-12-221-41/+44
| | | | | | Use early returns instead of big conditional blocks. (Changes extracted from the Ernestas's version of the previous commit, so, credit to him).
* list-view: Use event controllers for pointer and key eventsErnestas Kulik2021-12-222-80/+54
| | | | | | | Rebased and ammended by António Fernandes <antoniof@gnome.org> (Some style changes in the original have been extracted into the next commit, for ease of review).
* floating-bar: Handle parent changes in GObject::notifyAntónio Fernandes2021-12-221-5/+10
| | | | GtkWidget::parent-set is gone in GTK4.
* floating-bar: Don't use gdk_window_get_position()António Fernandes2021-12-221-1/+4
| | | | | | | It's gone in GTK4. Instead, translate to parent widget coordinates, which is the same coordinate system we get from the event controller.
* floating-bar: Use GdkEventControllerMotionAntónio Fernandes2021-12-221-40/+60
| | | | | | The ::event signal won't exist in GTK4. Based on Ernestas Kulik's earlier port.
* Revert "general: Add libportal-gtk3 dependency"António Fernandes2021-12-215-10/+5
| | | This reverts commit ae752ea07895b918683f664fe78950255f7faab0
* general: Add libportal-gtk3 dependencyAntónio Fernandes2021-12-215-5/+10
| | | | | | | The portal-gtk3.h header has been moved into a separate library which binds gtk3 explicitly. https://github.com/flatpak/libportal/pull/53
* autorun-software: Stop using blocking dialog functionsMatthew Jakeman2021-12-161-8/+24
| | | | | | | Replaces gtk_dialog_run() with equivalent non-blocking behaviour for the nautilus-autorun-software utility. Part of #1992
* places-view: Stop using blocking dialog functionsMatthew Jakeman2021-12-161-3/+2
| | | | | | | Replaces gtk_dialog_run() with equivalent non-blocking behaviour for error messages in the places sidebar. Part of #1992
* Updated Lithuanian translationAurimas Černius2021-12-141-370/+373
|
* places-view: Fix regressionAntónio Fernandes2021-12-141-1/+2
| | | | | | | | | | | Unlike NautilusFilesView, NautilusPlacesView is not a subclass of GtkGrid, but instead it's a subclass of GtkBox. Casting it to GTK_GRID fails at runtime, showing the Other Locations view as empty. This is a regression caused by e9ae1add9cccee61d10e724b3d7f3526df8ad32a Fix it by treating it as a GtkBox.
* Update Icelandic translationSveinn í Felli2021-12-131-421/+385
|
* file-operations: Delay FileConflictDialog activationÁlvaro Costa2021-12-085-0/+43
| | | | | | | | | Just as the error, warning and question dialogs, the FileConflictDialog may also pop up unexpectedly during a lengthier operation. The same idea of the previous commit is applied here. Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1988
* file-operations: Delay dialog activationÁlvaro Costa2021-12-082-0/+28
| | | | | | | | | | | | Warning, error and question dialogs may pop up unexpectedly during lengthier operations and the user may end up selecting an unwanted action. This patch introduces a delay of 2s for dialog activation when the total elapsed time of the job that created the dialog is greater than 2s. Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1988
* search-popover: Stop using blocking dialog functionsMatthew Jakeman2021-12-071-21/+37
| | | | | | | Replaces usage of gtk_dialog_run() with the "response" signal in preparation for GTK 4 port. Part of #1992
* general: Stop overriding GtkWidget.destroy()António Fernandes2021-12-064-29/+21
| | | | | | | | It's gone in GTK4. Anything we are doing on ::destroy can be done on ::dispose(). Extra care must be taken, however, because GObject.dispose() may be run multiple times; for this reason, move some things to .finalize().
* Revert "general: Stop overriding GtkWidget.destroy()"António Fernandes2021-12-064-39/+49
| | | | | | | | | | | This reverts commit 1c83d6af8bb4890dfb279c75506fa9be2a66b6ee. It did a little to much and this introduced at least one bug: when going from a regular folder to other-locations:///, the current view menu keeps displaying invalid actions (New Folder, Properties, etc.), which, if activated, crash the application. Let's revert first and do it right in the next commit.
* extensions/image-properties: Reduce container APIAntónio Fernandes2021-12-061-2/+7
| | | | Preparing for GTK4.
* extensions/image-properties: Don't subclass widgetAntónio Fernandes2021-12-063-60/+37
| | | | | | | | GTK discourages subclassing widgets. The only reason we are subclassing here is to add struct fields. But we don't need to subclass a widget for that. We don't even need to subclass GObject. A plain data struct is enough.
* general: Stop using GtkContainer::get_children() and ::foreach()António Fernandes2021-12-064-34/+40
| | | | Add transition wrappers for needed GTK4 methods unavailable in GTK3.