Bloc
Bloc copied to clipboard
The shortcut action persists even when a new BlSpace is opened in front of the targeted BlSpace.
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 only one space show be opened? Not sure I understood the expected behavior / the bug
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.
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.
Wow I can't realize why you get that behavior, and also why I don't.
What am I missing? mmm
Hum probably Windows XD ?
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: @.***>
WOo incredible. I have this problem with SDL or Morphic window.
@labordep do you still have this issue in new images? was it always in the same image?
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
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?
Hi @tinchodias, Yes I confirm!