MCPcopy Create free account
hub / github.com/GNOME/gnome-shell / acceptDropInternal

Method acceptDropInternal

js/ui/workspaceThumbnail.js:537–567  ·  view source on GitHub ↗
(source, actor, time)

Source from the content-addressed store, hash-verified

535 }
536
537 acceptDropInternal(source, actor, time) {
538 if (this.state > ThumbnailState.NORMAL)
539 return false;
540
541 if (source.metaWindow) {
542 const win = source.metaWindow.get_compositor_private();
543 if (this._isMyWindow(win))
544 return false;
545
546 const metaWindow = win.get_meta_window();
547 Main.moveWindowToMonitorAndWorkspace(metaWindow,
548 this.monitorIndex, this.metaWorkspace.index());
549 return true;
550 } else if (source.app && source.app.can_open_new_window()) {
551 if (source.animateLaunchAtPos)
552 source.animateLaunchAtPos(actor.x, actor.y);
553
554 source.app.open_new_window(this.metaWorkspace.index());
555 return true;
556 } else if (!source.app && source.shellWorkspaceLaunch) {
557 // While unused in our own drag sources, shellWorkspaceLaunch allows
558 // extensions to define custom actions for their drag sources.
559 source.shellWorkspaceLaunch({
560 workspace: this.metaWorkspace.index(),
561 timestamp: time,
562 });
563 return true;
564 }
565
566 return false;
567 }
568
569 setScale(scaleX, scaleY) {
570 this._viewport.set_scale(scaleX, scaleY);

Callers 1

acceptDropMethod · 0.80

Calls 3

_isMyWindowMethod · 0.95
animateLaunchAtPosMethod · 0.80
indexMethod · 0.45

Tested by

no test coverage detected