mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
copy getAppFromSource into taskbar.js since it is not exported yet
This commit is contained in:
11
taskbar.js
11
taskbar.js
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user