copy getAppFromSource into taskbar.js since it is not exported yet

This commit is contained in:
Philipp Unger
2023-08-28 16:34:46 +02:00
parent 6b2629a572
commit c4c114d921

View File

@@ -41,6 +41,7 @@ import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
import * as Workspace from 'resource:///org/gnome/shell/ui/workspace.js';
import * as AppIcons from './appIcons.js';
import * as AppDisplay from 'resource:///org/gnome/shell/ui/appDisplay.js';
import * as Panel from './panel.js';
import * as PanelManager from './panelManager.js';
import * as PanelSettings from './panelSettings.js';
@@ -61,6 +62,14 @@ const T1 = 'ensureAppIconVisibilityTimeout'
const T2 = 'showLabelTimeout'
const T3 = 'resetHoverTimeout'
// TODO will be exported in the next gnome 45 release again
function getAppFromSource(source) {
if (source instanceof AppDisplay.AppIcon)
return source.app;
else
return null;
}
/**
* Extend DashItemContainer
*
@@ -621,7 +630,7 @@ export var Taskbar = class {
}
_onDragMotion(dragEvent) {
let app = Dash.getAppFromSource(dragEvent.source);
let app = getAppFromSource(dragEvent.source);
if (app == null)
return DND.DragMotionResult.CONTINUE;