Skip to content

Commit 1ee6450

Browse files
Merge pull request livecode#3536 from livecodefraser/bugfix-2670
Fix highlight on menu items on Linux
2 parents 1b4f0f1 + f564810 commit 1ee6450

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

docs/notes/bugfix-2670.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Fix strange menu item highlight on Linux
2+

engine/src/button.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ void MCButton::munfocus()
10741074
{
10751075
if (entry != NULL)
10761076
entry->munfocus();
1077-
if (flags & F_AUTO_ARM && state & CS_ARMED)
1077+
if (flags & F_AUTO_ARM)
10781078
{
10791079
state &= ~CS_ARMED;
10801080
ishovering = False;

engine/src/buttondraw.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,18 +299,21 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
299299
}
300300
}
301301
else if (!(flags & F_SHOW_BORDER) && MCcurtheme && MCcurtheme->getthemeid() == LF_NATIVEGTK
302-
&& state & (CS_ARMED | CS_KFOCUSED) && (!getcindex(DI_BACK, i) && !getpindex(DI_BACK,i))
302+
&& (!getcindex(DI_BACK, i) && !getpindex(DI_BACK,i))
303303
&& flags & MENU_ITEM_FLAGS && flags & F_AUTO_ARM)
304304
{
305305
// FG-2014-07-30: [[ Bugfix 9405 ]]
306306
// Clear the previously drawn highlight before drawing GTK highlight
307307
setforeground(dc, DI_BACK, False, False);
308308
dc->fillrect(shadowrect);
309309

310-
MCWidgetInfo winfo;
311-
winfo.type = WTHEME_TYPE_MENUITEMHIGHLIGHT;
312-
getwidgetthemeinfo(winfo);
313-
MCcurtheme->drawwidget(dc, winfo, shadowrect);
310+
if (state & CS_ARMED)
311+
{
312+
MCWidgetInfo winfo;
313+
winfo.type = WTHEME_TYPE_MENUITEMHIGHLIGHT;
314+
getwidgetthemeinfo(winfo);
315+
MCcurtheme->drawwidget(dc, winfo, shadowrect);
316+
}
314317
}
315318

316319
}

0 commit comments

Comments
 (0)