Author: leavengood Date: 2011-06-18 08:00:14 +0200 (Sat, 18 Jun 2011) New Revision: 42233 Changeset: https://dev.haiku-os.org/changeset/42233 Ticket: https://dev.haiku-os.org/ticket/7591 Modified: haiku/trunk/src/apps/showimage/ShowImageView.cpp Log: Account for quickly repeated double clicks when toggling fullscreen mode. If done fast enough the click count can reach 7 pretty easily. Fixes #7591. Modified: haiku/trunk/src/apps/showimage/ShowImageView.cpp =================================================================== --- haiku/trunk/src/apps/showimage/ShowImageView.cpp 2011-06-18 05:43:29 UTC (rev 42232) +++ haiku/trunk/src/apps/showimage/ShowImageView.cpp 2011-06-18 06:00:14 UTC (rev 42233) @@ -1089,7 +1089,10 @@ buttons = Window()->CurrentMessage()->FindInt32("buttons"); } - if (buttons == B_PRIMARY_MOUSE_BUTTON && clickCount == 2) { + // Using clickCount >= 2 and the modulo 2 accounts for quickly repeated + // double-clicks + if (buttons == B_PRIMARY_MOUSE_BUTTON && clickCount >= 2 && + clickCount % 2 == 0) { Window()->PostMessage(MSG_FULL_SCREEN); return; }