{ "id": "100592", "key": "TIMOB-10809", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "14137", "description": "Release 2.1.3", "name": "Release 2.1.3", "archived": true, "released": true, "releaseDate": "2012-10-03" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14098", "description": "Sprint 2012-18 API", "name": "Sprint 2012-18 API", "archived": true, "released": true, "releaseDate": "2012-09-10" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-09-07T15:43:12.000+0000", "created": "2012-09-06T20:47:34.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "api", "module_window", "qe-testadded" ], "versions": [ { "id": "13273", "description": "Release 2.0.2", "name": "Release 2.0.2", "archived": false, "released": true, "releaseDate": "2012-05-31" }, { "id": "14096", "description": "Release 2.1.2", "name": "Release 2.1.2", "archived": true, "released": true, "releaseDate": "2012-08-31" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "29465", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "115554", "key": "TIMOB-14130", "fields": { "summary": "Android: Window events, windows in the Tab and test", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2013-06-10T23:25:36.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h3. Problem description\r\nCreating a lightweight windows between two heavyweight windows might prevent heavyweight focus event to be fired\r\n\r\nh3. Steps to reproduce and sample code\r\n\r\nRun the sample code (also on https://gist.github.com/61044bd87f85742e3b19):\r\n\r\n{code}\r\n/**\r\n * Creates a simple black light weight window\r\n */\r\nfunction LightWeightWindow(){\r\n\tvar win = Ti.UI.createWindow({\r\n\t\tbackgroundColor: 'black',\r\n\t});\r\n\r\n\treturn win;\r\n}\r\n\r\n/**\r\n * Creates a heavy weight window\r\n * @param {Number} num\tthe window number\r\n */\r\nfunction HeavyWeightWindow(num){\r\n\tnum ++;\r\n\t// create the window\r\n\tvar win = Ti.UI.createWindow({\r\n\t\tfullscreen: false, // make it heavy weight\r\n\t\tbackgroundColor: '#ccc',\r\n\t\ttitle: 'win '+num\r\n\t});\r\n\r\n\t// let's do some processing\r\n\tfor(var i = 0; i < 200; i++) {\r\n\t\twin.add(Ti.UI.createView({width:0,height:0,left:0,top:0}));\r\n\t}\r\n\r\n\t// open next window\r\n\tvar btn = Ti.UI.createButton({\r\n\t\ttitle: 'open win ' + (num + 1)\r\n\t});\r\n\r\n\tbtn.addEventListener('click', function(){\r\n\t\t// open light weight window\r\n\t\tvar lightWeight = LightWeightWindow();\r\n\t\tlightWeight.open();\r\n\t\t// create the next heavy weight window\r\n\t\tvar next = \tHeavyWeightWindow(num);\r\n\t\t// open the heavy weight window\r\n\t\tnext.open();\r\n\t\t// lastly, close the light weight window\r\n\t\tlightWeight.close();\r\n\t});\r\n\r\n\t// on focus, show the toast notification\r\n\twin.addEventListener('focus', function(){\r\n\t\tTi.UI.createNotification({\r\n\t\t\tmessage:'focus on win '+ num,\r\n\t\t\tduration: Ti.UI.NOTIFICATION_DURATION_SHORT\r\n\t\t}).show();\r\n\r\n\t\tTi.API.info('focus on win '+ num)\r\n\t});\r\n\r\n\twin.add(btn);\r\n\r\n\treturn win;\r\n}\r\n\r\nHeavyWeightWindow(0).open();\r\n{code}\r\n\r\n\r\nh5. Steps to reproduce\r\n\r\n- Click on the button to open a lightweight window, create next heavyweight window, open it and then close the lightweight window previously opened.\r\n- On window focus, we show a toast notification\r\n- Open a few windows, then press the back button.\r\n\r\nResult: 'focus' event listener is no longer triggered when pressing the back button", "attachment": [], "flagged": false, "summary": "Android: lightweight window might not allow heavy weight window to focus", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK tested 2.0.2 GA, 2.1.2, 2.2.0", "comment": { "comments": [ { "id": "218059", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here's another test case, similar to the one above, but has \"blur\" eventListener added as well.\r\n{code}\r\n/**\r\n * Creates a simple black light weight window\r\n */\r\nfunction LightWeightWindow(){\r\n var win = Ti.UI.createWindow({\r\n backgroundColor: 'black',\r\n });\r\n \r\n return win;\r\n}\r\n \r\n/**\r\n * Creates a heavy weight window\r\n * @param {Number} num the window number\r\n */\r\nfunction HeavyWeightWindow(num){\r\n num ++;\r\n // create the window\r\n var win = Ti.UI.createWindow({\r\n fullscreen: false, // make it heavy weight\r\n backgroundColor: '#ccc',\r\n title: 'win '+num\r\n });\r\n \r\n // let's do some processing\r\n for(var i = 0; i < 200; i++) {\r\n win.add(Ti.UI.createView({width:0,height:0,left:0,top:0}));\r\n }\r\n \r\n // open next window\r\n var btn = Ti.UI.createButton({\r\n title: 'open win ' + (num + 1)\r\n });\r\n \r\n btn.addEventListener('click', function(){\r\n // open light weight window\r\n var lightWeight = LightWeightWindow();\r\n lightWeight.open();\r\n // create the next heavy weight window\r\n var next = HeavyWeightWindow(num);\r\n // open the heavy weight window\r\n next.open();\r\n // lastly, close the light weight window\r\n lightWeight.close();\r\n });\r\n \r\n // on focus, show the toast notification\r\n win.addEventListener('focus', function(){\r\n Ti.UI.createNotification({\r\n message:'focus on win '+ num,\r\n duration: Ti.UI.NOTIFICATION_DURATION_SHORT\r\n }).show();\r\n \r\n Ti.API.info('focus on win '+ num)\r\n });\r\n \r\n win.addEventListener('blur', function(){\r\n \r\n Ti.API.info('blur on win '+ num)\r\n });\r\n \r\n win.add(btn);\r\n \r\n return win;\r\n}\r\n \r\nHeavyWeightWindow(0).open();\r\n{code}", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-07T15:23:42.000+0000", "updated": "2012-09-07T15:23:42.000+0000" }, { "id": "218066", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR for master https://github.com/appcelerator/titanium_mobile/pull/2888", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-09-07T15:45:33.000+0000", "updated": "2012-09-07T15:45:33.000+0000" }, { "id": "218067", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR for 2_1_X https://github.com/appcelerator/titanium_mobile/pull/2890", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-09-07T15:49:46.000+0000", "updated": "2012-09-07T15:49:46.000+0000" }, { "id": "218144", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Environment used for verification -\r\nTitanium SDK: 2.2.0.v20120907162025\r\nTitanium  Studio: 2.1.3.201209071738\r\nDevice:Samsung GALAXY Note (2.3.6)\r\nMachine OS - MAC 10.8", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-10T05:10:57.000+0000", "updated": "2012-09-10T05:10:57.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }