@@ -18,6 +18,7 @@ public sealed partial class TabBar : BaseTabBar, INotifyPropertyChanged
18
18
19
19
private readonly ICommandManager Commands = Ioc . Default . GetRequiredService < ICommandManager > ( ) ;
20
20
private readonly IAppearanceSettingsService AppearanceSettingsService = Ioc . Default . GetRequiredService < IAppearanceSettingsService > ( ) ;
21
+ private readonly IWindowContext WindowContext = Ioc . Default . GetRequiredService < IWindowContext > ( ) ;
21
22
22
23
// Fields
23
24
@@ -44,12 +45,8 @@ public sealed partial class TabBar : BaseTabBar, INotifyPropertyChanged
44
45
public bool ShowTabActionsButton
45
46
=> AppearanceSettingsService . ShowTabActions ;
46
47
47
- // Dragging makes the app crash when run as admin.
48
- // For more information:
49
- // - https://github.com/files-community/Files/issues/12390
50
- // - https://github.com/microsoft/terminal/issues/12017#issuecomment-1004129669
51
48
public bool AllowTabsDrag
52
- => ! ElevationHelpers . IsAppRunAsAdmin ( ) ;
49
+ => WindowContext . CanDragAndDrop ;
53
50
54
51
public Rectangle DragArea
55
52
=> DragAreaRectangle ;
@@ -172,7 +169,7 @@ private void TabView_TabStripDragOver(object sender, DragEventArgs e)
172
169
{
173
170
if ( e . DataView . Properties . ContainsKey ( TabPathIdentifier ) )
174
171
{
175
- HorizontalTabView . CanReorderTabs = true && ! ElevationHelpers . IsAppRunAsAdmin ( ) ;
172
+ HorizontalTabView . CanReorderTabs = WindowContext . CanDragAndDrop ;
176
173
177
174
e . AcceptedOperation = DataPackageOperation . Move ;
178
175
e . DragUIOverride . Caption = "TabStripDragAndDropUIOverrideCaption" . GetLocalizedResource ( ) ;
@@ -187,12 +184,12 @@ private void TabView_TabStripDragOver(object sender, DragEventArgs e)
187
184
188
185
private void TabView_DragLeave ( object sender , DragEventArgs e )
189
186
{
190
- HorizontalTabView . CanReorderTabs = true && ! ElevationHelpers . IsAppRunAsAdmin ( ) ;
187
+ HorizontalTabView . CanReorderTabs = WindowContext . CanDragAndDrop ;
191
188
}
192
189
193
190
private async void TabView_TabStripDrop ( object sender , DragEventArgs e )
194
191
{
195
- HorizontalTabView . CanReorderTabs = true && ! ElevationHelpers . IsAppRunAsAdmin ( ) ;
192
+ HorizontalTabView . CanReorderTabs = WindowContext . CanDragAndDrop ;
196
193
197
194
if ( ! ( sender is TabView tabStrip ) )
198
195
return ;
0 commit comments