Fix crash when using Magnifier shortcut while the mouse is on a layer button (issue 480)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1932 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2012-03-13 19:55:51 +00:00
parent be96447f3b
commit 30e8079236

View File

@ -691,6 +691,13 @@ void Main_handler(void)
{ {
if (Is_shortcut(Key,key_index)) if (Is_shortcut(Key,key_index))
{ {
if (preview_is_visible)
{
int x = Mouse_K;
Close_popup();
Mouse_K = x; // Close_popup waits for end of click and resets Mouse_K...
preview_is_visible = 0;
}
// Special keys (functions not hooked to a UI button) // Special keys (functions not hooked to a UI button)
switch(key_index) switch(key_index)
{ {
@ -1309,12 +1316,26 @@ void Main_handler(void)
{ {
if (Is_shortcut(key_pressed,0x100+button_index)) if (Is_shortcut(key_pressed,0x100+button_index))
{ {
if (preview_is_visible)
{
int x = Mouse_K;
Close_popup();
Mouse_K = x; // Close_popup waits for end of click and resets Mouse_K...
preview_is_visible = 0;
}
Select_button(button_index,LEFT_SIDE); Select_button(button_index,LEFT_SIDE);
prev_button_number=-1; prev_button_number=-1;
action++; action++;
} }
else if (Is_shortcut(key_pressed,0x200+button_index)) else if (Is_shortcut(key_pressed,0x200+button_index))
{ {
if (preview_is_visible)
{
int x = Mouse_K;
Close_popup();
Mouse_K = x; // Close_popup waits for end of click and resets Mouse_K...
preview_is_visible = 0;
}
Select_button(button_index,RIGHT_SIDE); Select_button(button_index,RIGHT_SIDE);
prev_button_number=-1; prev_button_number=-1;
action++; action++;