MacOS clicking in unactivated window causes it to move - macos

I have a window in my mac app, and when I click on any control in it, the window moves. This only happens when the window is not activated (focused?). If the window is already the main window, it works fine.
What would cause this? I'm thinking I'm not returning some kind of 'handled' value so that the mouse event is getting passed back to the window's move routine, even though I am not over the move bar.
Thanks for any suggestions!

Related

After FlashWindow, click the window and the taskbar remains highlight (orange)

When I click the application shortcut, if the program is already open, I will show the program and enable FlashWindow. (FlashWindow(true);)
After blinking once, the taskbar is highlighted.
Theoretically, clicking on the application window would unhighlight the taskbar.
But it doesn't.
There is no problem when the window is minimized.
But it doesn't work when the window is already displayed.
I tried to get all the window handles of the application based on the process id and activated them one by one, but that didn't work either.
For this step I printed the log and used GetForegroundWindow to confirm that the change did happen.
How to solve this problem?
Is there any other way to make the taskbar blink only once without keeping it highlighted?

Why don't background windows receive mouse events when I drag off the foreground window?

When I click on a non-reactive area of a win32 window in the foreground (for example, a blank space on a menu bar) and drag the mouse off, background windows do not receive mouse events. Buttons don't got into hover state, the cursor doesn't change, etc. The mouse is "captured" by the foreground window, although it doesn't receive messages either unless the mouse is over it. This state persists until I release the mouse button. Why is this, and how can I get out of this state programmatically without releasing the mouse button?
Researching this issue, I thought at first it was related to the concept of mouse capture, but it appears it is not. GetCapture() returns NULL during this state, whatever it is.
Clarification Edit: This is easy to see in the simplest of applications. Create a new Win32 project in Visual Studio with the default project template, which makes an empty window. Run it, and click and hold the blank inside of the window. Drag the mouse outside the window, and note that no buttons in background windows light up or otherwise respond to mouse-over events. Even if I stick ReleaseCapture() in the WndProc so that it fires after every message, the result is the same. It really seems like this has nothing to do with mouse capture in the Get/SetCapture sense.

Release and move child window by dragging it

I am trying to implement an edge-docking feature between two NSWindows. When the user moves the window I that can be docked just below the main window I snap it into position and add it as a child window to tha main window. This works very well.
However, I am unable to move the docked window away by simply dragging it. Currently I listen for the NSLeftMouseDragged event and when it starts I undock the window by removing it as child from the main window. This works, but the window is not getting moved. You have to release the mouse button and start a new dragging action to move the window away. I am guessing this happens because when the first drag is initiated the window is sat as a child window and therfore cannot be moved by that drag, even thought it gets released in the mean time.
Is there any way around this?
Thank you

JavaFX 2: Passing mouse events through to other windows?

I created a PopUp which is draggable across the screen, like a photoshop palette independent of the main window.
However, I would like the main window to react when I drag this PopUp over it, i.e. receive the mouse events from the drag.
The problem seems to be that since the PopUp is a Window itself, it consumes the dragging mouse events, and the main window never gets them.
I tried making the main windows the owner of the PopUp, however it still doesn't get them.
Is there any way to get around this ? Thanks

Hidden window takes all input

I have other application's fullscreen direct-x window, which I need to hide. I found the way to hide it by hooking direct-x create device and changing window parameters so it is not fullscreen. This works ok on XP but on Win-7 I can't use any other application because it looks like application is switching it to be foreground window so all clicks and keyboard input goes to that window. However if I click fast I can make some action. This make me think that this app is using some function to direct input to itself, or to focus, dunno what.
The other thing is that if I resize the window and don't hide it, all works ok.
I tried to hook SetCapture, SetForegroundWindow, SetActiveWindow and SetWindowPos and none of this helped.
Do you have some idea how can I hide window in other way, or what can cause this focusing to invisible window?

Resources