From: giwoong.kim Date: Mon, 19 Mar 2012 16:42:17 +0000 (+0900) Subject: [Title] remove skin flickering in windows X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1773^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d71b057d7970f382a55e3bf8ab9f159abcf774ef;p=sdk%2Femulator%2Fqemu.git [Title] remove skin flickering in windows [Type] [Module] Emulator [Priority] [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java index a0d5a02e70..fc4ea9b066 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java @@ -124,6 +124,7 @@ public class EmulatorSkin { private boolean isMousePressed; private boolean isDragStartedInLCD; private boolean isHoverState; + private SkinRegion currentHoverRegion; private boolean isShutdownRequested; private SocketCommunicator communicator; @@ -483,8 +484,14 @@ public class EmulatorSkin { // MouseMoveListener of shell does not receive event only with MouseMoveListener // in case that : hover hardkey -> mouse move into LCD area if( isHoverState ) { - shell.redraw(); + if (currentHoverRegion.width == 0 && currentHoverRegion.height == 0) { + shell.redraw(); + } else { + shell.redraw( currentHoverRegion.x, currentHoverRegion.y, + currentHoverRegion.width + 1, currentHoverRegion.height + 1, false ); + } isHoverState = false; + currentHoverRegion.width = currentHoverRegion.height = 0; } } @@ -514,8 +521,14 @@ public class EmulatorSkin { if ( null == region ) { if( isHoverState ) { - shell.redraw(); + if (currentHoverRegion.width == 0 && currentHoverRegion.height == 0) { + shell.redraw(); + } else { + shell.redraw( currentHoverRegion.x, currentHoverRegion.y, + currentHoverRegion.width + 1, currentHoverRegion.height + 1, false ); + } isHoverState = false; + currentHoverRegion.width = currentHoverRegion.height = 0; } } else { isHoverState = true; @@ -523,6 +536,7 @@ public class EmulatorSkin { gc.setLineWidth( 1 ); gc.setForeground( hoverColor ); gc.drawRectangle( region.x, region.y, region.width, region.height ); + currentHoverRegion = region; gc.dispose(); } @@ -544,7 +558,12 @@ public class EmulatorSkin { int keyCode = getHardKeyCode( e.x, e.y ); if ( EmulatorConstants.UNKNOWN_KEYCODE != keyCode ) { - shell.redraw(); + if (currentHoverRegion.width == 0 && currentHoverRegion.height == 0) { + shell.redraw(); + } else { + shell.redraw( currentHoverRegion.x, currentHoverRegion.y, + currentHoverRegion.width + 1, currentHoverRegion.height + 1, false ); + } KeyEventData keyEventData = new KeyEventData( KeyEventType.RELEASED.value(), keyCode ); communicator.sendToQEMU( SendCommand.SEND_HARD_KEY_EVENT, keyEventData ); }