From: Son Hyunjun Date: Fri, 13 Apr 2012 08:14:32 +0000 (+0900) Subject: [Title] bugfix : skin ui may be killed in hardkey area X-Git-Tag: TizenStudio_2.0_p2.3~1503 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6bb5644042769ca736d1fc034e67e9481a50e998;p=sdk%2Femulator%2Fqemu.git [Title] bugfix : skin ui may be killed in hardkey area [Type] Bugfix [Module] Skin [Priority] Minor [CQ#] [Redmine#] [Problem] skin ui is killed clicking hardkey area after doing Always On Top in hardkey area [Cause] null check [Solution] Change-Id: Ifb67817f6a94ac4b6ace923537ec8a6b4a60afb4 --- 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 0311d10..7911540 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 @@ -580,12 +580,17 @@ public class EmulatorSkin { int keyCode = SkinUtil.getHardKeyCode( e.x, e.y, currentRotationId, currentScale ); if ( SkinUtil.UNKNOWN_KEYCODE != keyCode ) { - if ( currentHoverRegion.width == 0 && currentHoverRegion.height == 0 ) { - shell.redraw(); - } else { - shell.redraw( currentHoverRegion.x, currentHoverRegion.y, currentHoverRegion.width + 1, - currentHoverRegion.height + 1, false ); + + // null check : prevent from mouse up without a hover (ex. doing always on top in hardkey area) + if( null != currentHoverRegion ) { + 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, 0 ); communicator.sendToQEMU( SendCommand.SEND_HARD_KEY_EVENT, keyEventData ); } diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java index 64a5c49..9879549 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java @@ -75,6 +75,8 @@ public class EmulatorSkinMain { */ public static void main( String[] args ) { + SocketCommunicator communicator = null; + try { String vmPath = getVmPath( args ); @@ -138,7 +140,7 @@ public class EmulatorSkinMain { int windowHandleId = skin.compose(); int uid = config.getArgInt( ArgsConstants.UID ); - SocketCommunicator communicator = new SocketCommunicator( config, uid, windowHandleId, skin ); + communicator = new SocketCommunicator( config, uid, windowHandleId, skin ); skin.setCommunicator( communicator ); @@ -181,10 +183,16 @@ public class EmulatorSkinMain { if ( null != logger ) { logger.log( Level.SEVERE, e.getMessage(), e ); + logger.warning( "Shutdown skin process !!!" ); } else { e.printStackTrace(); + System.out.println( "Shutdown skin process !!!" ); } - + + if( null != communicator ) { + communicator.terminate(); + } + } finally { ImageRegistry.getInstance().dispose(); Display.getDefault().close();