RFR: 8273379 - GTK3 stops sending key events during drag and drop [v22]

Thiago Milczarek Sayao tsayao at openjdk.org
Tue Jan 17 17:22:06 UTC 2023


> This PR fixes 8273379.
> 
> I reverted back to use GDK (from [8225571](https://bugs.openjdk.org/browse/JDK-8225571)) to handle the events. 
> 
> It may also fix [8280383](https://bugs.openjdk.org/browse/JDK-8280383).
> 
> There's also some cleaup.
> 
> To do general testing (two tests were added):
> `java @build/run.args -jar apps/toys/DragDrop/dist/DragDrop.jar`
> 
> Information for reviewing:
> * Previously an offscreen window where used to pass events. Now it gets the window were Drag initially started  (`WindowContextBase::sm_mouse_drag_window`);
> * There's a new `DragSourceContext` instead of global variables;
> * DragView were simplified;
> * It now uses a event hook when drag starts to listen to Drag/DragView events;
> * It handles `GDK_GRAB_BROKEN` events (I still need to figure it out a test case for this - It should happen when another window grabs the device during the drag);
> * It uses `gdk_threads_add_idle_full` to end drag so the `GDK_BUTTON_RELEASE` event will continue before ending the drag. This is needed because `WindowContext` will notify java about the button release;
> * It also notifies "Drag Dropped" on DND Source if the drop is on the same app, because it needs to do so before mouse button is released - this method is more straightforward;
> * The Scenario were the drag source window closes during the drag is now covered;

Thiago Milczarek Sayao has updated the pull request incrementally with three additional commits since the last revision:

 - Fix DragView below cursor
 - Minor adjustments
 - Typo

-------------

Changes:
  - all: https://git.openjdk.org/jfx/pull/986/files
  - new: https://git.openjdk.org/jfx/pull/986/files/aa5d8ae2..5ee52e69

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jfx&pr=986&range=21
 - incr: https://webrevs.openjdk.org/?repo=jfx&pr=986&range=20-21

  Stats: 38 lines in 1 file changed: 13 ins; 14 del; 11 mod
  Patch: https://git.openjdk.org/jfx/pull/986.diff
  Fetch: git fetch https://git.openjdk.org/jfx pull/986/head:pull/986

PR: https://git.openjdk.org/jfx/pull/986


More information about the openjfx-dev mailing list