deimos1877 / BorderlessWindow

MIT License
193 stars 41 forks source link

General Inquiry: How to get mouse events to Borderless window after getting QT app embedded. #8

Closed JosephCoppola closed 7 years ago

JosephCoppola commented 7 years ago

Hello!

First off thank you for making this repository. It's been very helpful. I was successfully able to embed our current QT application into this project. The problem now is the application is indeed embedded into QMainPanel but isn't allowing BorderlessWindow to receive mouse events anymore aka resize and move window.

Any thoughts on how to alleviate this?

Thanks.

deimos1877 commented 7 years ago

Hi. If i understand you correctly.

Application has two event loops: one from WinApi, one from QApplication. You should use appropriate event loop, depending on what event you trying to catch.

You need to pass events from one to another. In theory it's possible, but i never tried to do something like that.

JosephCoppola commented 7 years ago

Okay interesting. To provide a little more context, our QT application was originally a QMainWindow. I converted that to be an QWidget. I then load the QWidget in QMainPanel and allow your code to take it from there. Looks great and works well. Problem is my UI takes the whole window space (which we want) and the areas where you check for resizing are technically behind my UI now and no longer receive mouse events.

So you think if I take the trapped mouse events from my UI and communicate them up to QMainPanel or Borderless window it should then work as expected? Or could I essentially copy the winEvent implementation from QMainPanel into our UI and pass the events to the BorderlessWindow window handle?

Please let me know if I am not clear enough.

deimos1877 commented 7 years ago

Problem is my UI takes the whole window space (which we want) and the areas where you check for resizing are technically behind my UI now and no longer receive mouse events.

Why do you want your UI to take whole window?

So you think if I take the trapped mouse events from my UI and communicate them up to QMainPanel or Borderless window it should then work as expected?

Something like that, but:

  1. I haven't tried it myself, so i'm not sure.
  2. My project is more like a workaround or a hack. From my experience it never works as expected.
JosephCoppola commented 7 years ago
  1. We want the UI to take the whole window so that it actually is borderless.

  2. Sounds good I will give it a try and if you want I can let you know what I find.

If you don't care you're free to close this ticket. Thanks for getting back so quickly!

JosephCoppola commented 7 years ago

Communicating the clicking of the title bar from my UI to the Win32 worked fine. Resizing not so much. I'll have to look at it some more later next week when we have time.

Gonna close. Thanks again.