Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right-click on QGIS Toolbars no longer shows the drop-down list of panels and toolbars #25350

Closed
qgib opened this issue Nov 14, 2017 · 11 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! GUI/UX Related to QGIS application GUI or User Experience High Priority Regression Something which used to work, but doesn't anymore

Comments

@qgib
Copy link
Contributor

qgib commented Nov 14, 2017

Author Name: Harrissou Santanna (@DelazJ)
Original Redmine Issue: 17453
Affected QGIS version: master
Redmine category:gui


To enable or disable a toolbar/panel, you could right-click any "empty" place on a toolbar, on the menu bar, on a panel and you get a list of panels and toolbars with checkbox.
This seems to no longer work in master. Right-clicking does nothing.
Tested on Windows.

@qgib
Copy link
Contributor Author

qgib commented Nov 14, 2017

Author Name: Giovanni Manghi (@gioman)


  • priority_id was changed from Normal to High

@qgib
Copy link
Contributor Author

qgib commented Dec 14, 2017

Author Name: Michel Stuyts (@mstuyts)


I noticed similar behavior. The right-click functionality to enable or disable a toolbar or panel stops working when a QGIS project is opened. When QGIS is restarted without opening a project everything works as expected. Adding layers to QGIS has no effect, but when an existing project is opened right clicking on a toolbar doesn't work anymore, until QGIS is restarted. I tested this in QGIS 2.99 installed with OSGeo4W on Windows 10.

Another thing I noticed is that right-clicking only works when it's done on an active toolbar button or next to a button on the toolbar. Right clicking on a greyed out button does not show the list of toolbars and panels. Both in QGIS 2.18.15 and QGIS 2.99.

@qgib
Copy link
Contributor Author

qgib commented Dec 14, 2017

Author Name: Steven Mizuno (Steven Mizuno)


More information: I got curious enough to try multiple right-clicks on a toolbar. For me it takes 25+ right-clicks, but eventually the list of panels does appear and continues to work with a single right-click until another project is loaded or New project is chosen.

For me, right-clicking on a toolbar's empty space does work.

I am using Windows 8.1 and OSGeo4W.

@qgib
Copy link
Contributor Author

qgib commented Dec 14, 2017

Author Name: Nyall Dawson (@nyalldawson)


Likely a change in qt5. Can you find any bug reports on the qt tracker regarding this?


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Dec 15, 2017

Author Name: laura costa (laura costa)


I have similar behavior. I've noticed it succeed when i load a saved project. No problem when i launch qgis

@qgib
Copy link
Contributor Author

qgib commented Dec 15, 2017

Author Name: Michel Stuyts (@mstuyts)


I tried multiple right-clicks and for me it always takes exact 21 right-clicks to make it work again, until I open a project or a New Project is created.

@qgib
Copy link
Contributor Author

qgib commented Dec 16, 2017

Author Name: Steven Mizuno (Steven Mizuno)


I believe I have tracked down the problem to QgsMapToolCapture::stopCapturing() where an event filter is installed on QgisApp (Windows only). The filter targets context menu events.

Now I need help from devs about how to fix the problem -- what is the purpose of the event filter (only on Windows)? Is it still necessary?

and a question -- is this a Windows only problem?
I'm not sure based on what is in the bug report, although no one has mentioned Linux or Mac.


The short version of my tracking down the problem:
I determined that in QgisApp, fileNew() and addProject() were starting the problem. I considered whether signals could be the issue. I could call a lower level project load function that didn't have any signals -- no problem.

I decided to test whether the signals newProject and projectRead would have any effect by preventing them from being sent (comment out the lines) -- the problem disappeared.

Then I tried creating my own signal and slot, with my signal replacing newProject and projectRead, and my added slot just popping a messagebox -- this worked OK; right-click on toolbar would get the menu.

A search for the use of newProject and projectRead turned up several map tools that were connecting the signals to stopCapturing (in QgsMapToolCapture), so I tried connecting my signal to stopCapturing in just one tool (add feature) -- this would require just one extra right-click before the menu would appear.

There is an event filter installed on QgisApp by stopCapturing() so I tested whether this had any effect.
I returned the modified/added signals and slots to the original state and disabled the event filter installation in QgsMapToolCapture::stopCapturing() -- now you right-click once on a toolbar and get the menu!

I have tried the add feature tool (polygon) briefly and did not see any obvious problem without the event filter.

@qgib
Copy link
Contributor Author

qgib commented Dec 16, 2017

Author Name: Harrissou Santanna (@DelazJ)


Steven, thanks for tracking down this issue. May i suggest you to provide your changes that fix the issue (better, like a pull-request) so that other developers can comment and improve together the fix? It will also speed up the process.
This advice would also apply to #25570.
Thanks.

@qgib
Copy link
Contributor Author

qgib commented Jan 11, 2018

Author Name: Steven Mizuno (Steven Mizuno)


PR filed: #6043

@qgib
Copy link
Contributor Author

qgib commented Jan 15, 2018

Author Name: Steven Mizuno (Steven Mizuno)


Applied in changeset cefb1bc.


  • status_id was changed from Feedback to Closed
  • done_ratio was changed from 0 to 100

@qgib qgib closed this as completed Jan 15, 2018
@qgib
Copy link
Contributor Author

qgib commented Feb 22, 2018

Author Name: Giovanni Manghi (@gioman)


  • resolution was changed from to fixed/implemented

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority GUI/UX Related to QGIS application GUI or User Experience Regression Something which used to work, but doesn't anymore labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! GUI/UX Related to QGIS application GUI or User Experience High Priority Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

No branches or pull requests

1 participant