mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Do not reveal panel when mouse button is pressed
This commit is contained in:
@@ -54,7 +54,8 @@ var Intellihide = new Lang.Class({
|
||||
this._dtpPanel = dtpPanel;
|
||||
this._dtpSettings = dtpPanel._dtpSettings;
|
||||
this._panelBox = dtpPanel.panelBox;
|
||||
this._proximityManager = dtpPanel.panelManager.proximityManager;
|
||||
this._panelManager = dtpPanel.panelManager;
|
||||
this._proximityManager = this._panelManager.proximityManager;
|
||||
this._holdStatus = Hold.NONE;
|
||||
|
||||
this._signalsHandler = new Utils.GlobalSignalsHandler();
|
||||
@@ -72,7 +73,6 @@ var Intellihide = new Lang.Class({
|
||||
this._monitor = this._dtpPanel.monitor;
|
||||
this._animationDestination = -1;
|
||||
this._pendingUpdate = false;
|
||||
this._dragging = false;
|
||||
this._hoveredOut = false;
|
||||
this._windowOverlap = false;
|
||||
this._panelAtTop = this._dtpSettings.get_string('panel-position') === 'TOP';
|
||||
@@ -183,16 +183,6 @@ var Intellihide = new Lang.Class({
|
||||
'monitors-changed',
|
||||
() => this._reset()
|
||||
],
|
||||
[
|
||||
global.display,
|
||||
'grab-op-begin',
|
||||
() => this._dragging = true
|
||||
],
|
||||
[
|
||||
global.display,
|
||||
'grab-op-end',
|
||||
() => this._dragging = false
|
||||
],
|
||||
[
|
||||
this._panelBox,
|
||||
'notify::hover',
|
||||
@@ -306,11 +296,11 @@ var Intellihide = new Lang.Class({
|
||||
|
||||
if (fromRevealMechanism) {
|
||||
//the user is trying to reveal the panel
|
||||
if (this._monitor.inFullscreen && !this._dragging) {
|
||||
if (this._monitor.inFullscreen && !this._panelManager.mouseBtnPressed) {
|
||||
return this._dtpSettings.get_boolean('intellihide-show-in-fullscreen');
|
||||
}
|
||||
|
||||
return !this._dragging;
|
||||
return !this._panelManager.mouseBtnPressed;
|
||||
}
|
||||
|
||||
if (!this._dtpSettings.get_boolean('intellihide-hide-from-windows')) {
|
||||
|
||||
@@ -34,26 +34,32 @@ const Proximity = Me.imports.proximity;
|
||||
const Taskbar = Me.imports.taskbar;
|
||||
const Utils = Me.imports.utils;
|
||||
|
||||
const BoxPointer = imports.ui.boxpointer;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Dash = imports.ui.dash;
|
||||
const Lang = imports.lang;
|
||||
const Gi = imports._gi;
|
||||
const Atspi = imports.gi.Atspi;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
|
||||
const BoxPointer = imports.ui.boxpointer;
|
||||
const Dash = imports.ui.dash;
|
||||
const IconGrid = imports.ui.iconGrid;
|
||||
const Main = imports.ui.main;
|
||||
const PanelMenu = imports.ui.panelMenu;
|
||||
const Lang = imports.lang;
|
||||
const St = imports.gi.St;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Layout = imports.ui.layout;
|
||||
const Shell = imports.gi.Shell;
|
||||
const WorkspacesView = imports.ui.workspacesView;
|
||||
|
||||
const ATSPI_MOUSE = 'mouse:button:';
|
||||
const ATSPI_MOUSE_EVENTS = ['1p', '1r'];
|
||||
|
||||
var dtpPanelManager = new Lang.Class({
|
||||
Name: 'DashToPanel.PanelManager',
|
||||
|
||||
_init: function(settings) {
|
||||
this._dtpSettings = settings;
|
||||
this.overview = new Overview.dtpOverview(settings);
|
||||
this.mouseBtnPressed = false;
|
||||
},
|
||||
|
||||
enable: function(reset) {
|
||||
@@ -141,6 +147,9 @@ var dtpPanelManager = new Lang.Class({
|
||||
|
||||
this._needsDashItemContainerAllocate = !Dash.DashItemContainer.prototype.hasOwnProperty('vfunc_allocate');
|
||||
|
||||
this._mouseListener = Atspi.EventListener.new(e => this.mouseBtnPressed = e.type.slice(-1) == 'p');
|
||||
ATSPI_MOUSE_EVENTS.forEach(e => this._mouseListener.register(ATSPI_MOUSE + e));
|
||||
|
||||
if (this._needsDashItemContainerAllocate) {
|
||||
Utils.hookVfunc(Dash.DashItemContainer.prototype, 'allocate', this._newDashItemContainerAllocate);
|
||||
}
|
||||
@@ -241,6 +250,8 @@ var dtpPanelManager = new Lang.Class({
|
||||
if (this._needsDashItemContainerAllocate) {
|
||||
Utils.hookVfunc(Dash.DashItemContainer.prototype, 'allocate', Dash.DashItemContainer.prototype.vfunc_allocate);
|
||||
}
|
||||
|
||||
ATSPI_MOUSE_EVENTS.forEach(e => this._mouseListener.deregister(ATSPI_MOUSE + e));
|
||||
},
|
||||
|
||||
setFocusedMonitor: function(monitor, ignoreRelayout) {
|
||||
|
||||
Reference in New Issue
Block a user