[Title] bugfix : skin ui may be killed in hardkey area
authorSon Hyunjun <hj79.son@samsung.com>
Fri, 13 Apr 2012 08:14:32 +0000 (17:14 +0900)
committerSon Hyunjun <hj79.son@samsung.com>
Fri, 13 Apr 2012 08:14:32 +0000 (17:14 +0900)
[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

tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java

index 0311d10..7911540 100644 (file)
@@ -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 );
                                        }
index 64a5c49..9879549 100644 (file)
@@ -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();