Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
thunar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pratik Karki
thunar
Commits
40a7dfb6
Commit
40a7dfb6
authored
5 years ago
by
Andre Miranda
Browse files
Options
Downloads
Patches
Plain Diff
Prevent new bookmarks on sidebar when dragging files (Bug #14921)
parent
57d725ed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
thunar/thunar-shortcuts-view.c
+31
-0
31 additions, 0 deletions
thunar/thunar-shortcuts-view.c
with
31 additions
and
0 deletions
thunar/thunar-shortcuts-view.c
+
31
−
0
View file @
40a7dfb6
...
...
@@ -837,6 +837,11 @@ thunar_shortcuts_view_drag_motion (GtkWidget *widget,
gtk_tree_view_set_drag_dest_row
(
GTK_TREE_VIEW
(
view
),
path
,
position
);
gtk_tree_path_free
(
path
);
}
else
{
/* remove highlight */
gtk_tree_view_set_drag_dest_row
(
GTK_TREE_VIEW
(
view
),
NULL
,
position
);
}
/* tell Gdk whether we can drop here */
gdk_drag_status
(
context
,
action
,
timestamp
);
...
...
@@ -1439,6 +1444,8 @@ thunar_shortcuts_view_compute_drop_actions (ThunarShortcutsView *view,
GtkTreeIter
iter
;
ThunarFile
*
file
;
gint
cell_y
;
GList
*
lp
;
guint
n
;
/* determine the shortcuts model */
model
=
gtk_tree_view_get_model
(
GTK_TREE_VIEW
(
view
));
...
...
@@ -1481,6 +1488,30 @@ thunar_shortcuts_view_compute_drop_actions (ThunarShortcutsView *view,
/* check if we cannot drop into the shortcut */
if
(
G_UNLIKELY
(
actions
==
0
))
{
/* check if any of the paths is not directory but only up to 100, if
* someone drags too many directories it may slowdown or even freeze
* Thunar while moving the cursor.
*/
for
(
lp
=
view
->
drop_file_list
,
n
=
0
;
lp
!=
NULL
&&
n
<
100
;
lp
=
lp
->
next
,
++
n
)
{
GFileInfo
*
info
;
gboolean
is_directory
;
info
=
g_file_query_info
(
lp
->
data
,
G_FILE_ATTRIBUTE_STANDARD_TYPE
,
G_FILE_QUERY_INFO_NONE
,
NULL
,
NULL
);
if
(
G_UNLIKELY
(
info
==
NULL
))
return
0
;
is_directory
=
g_file_info_get_file_type
(
info
)
==
G_FILE_TYPE_DIRECTORY
;
g_object_unref
(
info
);
if
(
!
is_directory
)
return
0
;
}
/* check the action that should be performed */
if
(
gdk_drag_context_get_suggested_action
(
context
)
==
GDK_ACTION_LINK
||
(
gdk_drag_context_get_actions
(
context
)
&
GDK_ACTION_LINK
)
!=
0
)
actions
=
GDK_ACTION_LINK
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment