Bloc icon indicating copy to clipboard operation
Bloc copied to clipboard

The shortcut action persists even when a new BlSpace is opened in front of the targeted BlSpace.

Open labordep opened this issue 2 years ago • 11 comments

The shortcut action persists even when a new BlSpace is opened in front of the targeted BlSpace. If you try this example below you can see that the space2 is opening each time that the mouse is entered the space1 window.

Instructions: Do it in this code and press F12 on the opened window. Caution: the Bloc backend should be in Morphic and the space2 should be be in front of the space1 (may be it depend of your pharo window size).

shortcut := BlShortcutWithAction new
			              name: 'Test shortcut';
			              combination: ((BlKeyCombination builder key: KeyboardKey F12) build);
			              action: [ :event | "open a new space in front of space1"
						"open space2"
						BlSpace new show.
						
				 ].

space1 := BlSpace new.
space1 show.
space1 root addShortcut: shortcut.

=> See my video to have an illustration of this issue. I press F12 only one for opening space2 window at the first time.

https://github.com/pharo-graphics/Bloc/assets/49183340/a4726a45-e241-435b-bda8-10ca10cbc9d5

labordep avatar Nov 19 '23 13:11 labordep

@labordep only one space show be opened? Not sure I understood the expected behavior / the bug

tinchodias avatar Nov 20 '23 16:11 tinchodias

Is it like this?

counter := 0.
dialog := BlSpace new.
dialog root background: Color random.
dialog
	position: 200 @ 100;
	extent: 300 @ 300.
								
shortcut := BlShortcutWithAction new
			              name: 'Test shortcut';
			              combination: ((BlKeyCombination builder key: KeyboardKey F12) build);
			              action: [ :event | "open a new space in front of space1"
						counter := counter + 1.
						dialog title: 'F12 pressed ', counter asString, ' times'.
						dialog isOpened
							ifTrue: [ self inform: 'Dialog already opened' ]
							ifFalse: [ dialog show ] ].

mainSpace := BlSpace new.
mainSpace show.
mainSpace root addShortcut: shortcut.

tinchodias avatar Nov 20 '23 16:11 tinchodias

Hi @tinchodias your example have the same problem with my configuration, but this is possible that you haven't same problem as me. I only press the F12 key once, yet it continues to open windows in loops when I move my mouse. I realize that it may not be visible in the video, but I press the F12 key only once throughout the entire video.

labordep avatar Nov 20 '23 19:11 labordep

Wow I can't realize why you get that behavior, and also why I don't.

What am I missing? mmm

tinchodias avatar Nov 20 '23 20:11 tinchodias

Hum probably Windows XD ?

labordep avatar Nov 20 '23 20:11 labordep

El lun, 20 nov 2023 a la(s) 17:17, Pierre Laborde @.***) escribió:

Hum probably Windows XD ?

On Windows I also have the expected behavior , the window only opens when I press F12. But I didn't update to latest Bloc commit

— Reply to this email directly, view it on GitHub https://github.com/pharo-graphics/Bloc/issues/356#issuecomment-1819740893, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXHHKLV4XB7T6VX6YZCD7LYFO3FRAVCNFSM6AAAAAA7RXKWC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJZG42DAOBZGM . You are receiving this because you were mentioned.Message ID: @.***>

tinchodias avatar Nov 20 '23 23:11 tinchodias

WOo incredible. I have this problem with SDL or Morphic window.

labordep avatar Nov 21 '23 21:11 labordep

@labordep do you still have this issue in new images? was it always in the same image?

tinchodias avatar Dec 04 '23 21:12 tinchodias

HI @tinchodias, I have tested today in a new image with a new fresh Bloc and I have always the same problem for Morphic windows. I haven't this problem with SDL windows.

My config:

  • Windows 11 Pro
  • Pharo-11.0.0+build.720
  • Pharo VM 10.0.8.0

labordep avatar Dec 17 '23 18:12 labordep

So strange. Please confirm me if I understand well: when the host is SDL2 no problem, when host is Morphic then yes you reproduce the problem always. Right?

tinchodias avatar Dec 24 '23 04:12 tinchodias

Hi @tinchodias, Yes I confirm!

labordep avatar Dec 24 '23 12:12 labordep