{ "id": "124836", "key": "TIMOB-16208", "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": [], "resolution": null, "resolutiondate": null, "created": "2014-01-15T21:31:07.000+0000", "priority": null, "labels": [ "3.2.0GA", "blur", "focus", "hide", "ios", "ios7", "window" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:57.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Create a window which has focus and blur events. These events fire correctly when you open and close a new window over top. However, if you open a new window over top and then hide that new window, the window below no longer fires focus and blur events, nor do any other windows that are opened and closed.\r\n\r\nConsider the following code below that reproduces the issue. As you open and close win1, the focus and blur events of baseWindow fire correctly. However after you open window 2 and then hide it, no more focus and blur events are fired for baseWindow. You could also add focus and blur events to win1, and these wouldn't fire after hiding win2 either.\r\n\r\n{code}\r\nvar baseWindow = Ti.UI.createWindow({ backgroundColor: 'blue', title: 'Base Window' });\r\nbaseWindow.addEventListener('focus', function() {\r\n alert('baseWindow was focused');\r\n});\r\nbaseWindow.addEventListener('blur', function() {\r\n alert('baseWindow was blurred');\r\n});\r\n\r\nvar openWin1Button = Ti.UI.createButton({\r\n top: 20, title: 'Open window 1'\r\n});\r\nopenWin1Button.addEventListener('click', function() {\r\n var win1 = Ti.UI.createWindow({ backgroundColor: 'green', title: 'Window 1' });\r\n\r\n var closeWin1Button = Ti.UI.createButton({\r\n top: 20, title: 'Close window 1'\r\n });\r\n closeWin1Button.addEventListener('click', function() {\r\n win1.close();\r\n });\r\n win1.add(closeWin1Button);\r\n\r\n win1.open();\r\n\r\n});\r\nbaseWindow.add(openWin1Button);\r\n\r\nvar win2;\r\nvar openWin2Button = Ti.UI.createButton({\r\n top: 80, title: 'Open window 2'\r\n});\r\nopenWin2Button.addEventListener('click', function() {\r\n if(!win2) {\r\n win2 = Ti.UI.createWindow({ backgroundColor: 'red', title: 'Window 2' });\r\n\r\n var closeWin2Button = Ti.UI.createButton({\r\n top: 20, title: 'Hide window 2'\r\n });\r\n closeWin2Button.addEventListener('click', function() {\r\n win2.hide();\r\n });\r\n win2.add(closeWin2Button);\r\n\r\n win2.open();\r\n }\r\n else {\r\n win2.show();\r\n }\r\n\r\n});\r\nbaseWindow.add(openWin2Button);\r\n\r\nbaseWindow.open();\r\n{code}\r\n\r\nThis worked fine with Titanium SDK 3.1.x and iOS 6 but no longer does. I also tried setting the opacity and height of win2 to 0 but it had no affect. As long as win2 is open (but hidden), the focus and blur events of other windows will not fire.", "attachment": [], "flagged": false, "summary": "iOS: Window focus and blur events no longer fire after hiding a window", "creator": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "environment": "Titanium SDK 3.2.0.GA, iOS 7", "comment": { "comments": [ { "id": "288512", "author": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "body": "It seems that the focus and blur events not firing are only part of the problem with hidden windows. If you hide a window and then open a new window with a different status bar color (Ti.UI.iPhone.StatusBar.DEFAULT -> Ti.UI.iPhone.StatusBar.LIGHT_CONTENT), the status bar won't update to the new style. It must think the hidden window is still showing so doesn't respect focus/blur/status bar styles on the truly visible window or new windows that open later on.", "updateAuthor": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "created": "2014-01-16T19:53:50.000+0000", "updated": "2014-01-16T19:53:50.000+0000" }, { "id": "296075", "author": { "name": "felipemathies", "key": "felipemathies", "displayName": "Felipe Mathies", "active": true, "timeZone": "America/Sao_Paulo" }, "updateAuthor": { "name": "felipemathies", "key": "felipemathies", "displayName": "Felipe Mathies", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2014-03-07T01:00:47.000+0000", "updated": "2014-03-07T01:00:47.000+0000" }, { "id": "301822", "body": "This issue was previously scheduled to be worked on in more than one sprint:\r\n* 'Release 3.1.2' (on board '3.1.X Triage')\r\n* 'Release 3.0.1/TS 3.0.2' (on board '3.1.0 Triage')\r\n* 'Triage' (on board '3.2.X Triage')\r\n\r\nStarting from JIRA Agile 6.3, an issue can only belong to a single future sprint. Read more about this change: http://docs.atlassian.com/agile/docs-0630/Sprint+Marker+Migration\r\n\r\nThis issue is now scheduled for future sprint 'Release 3.1.2' (on board '3.1.X Triage').\r\n\r\nIf this is incorrect, please update the issue accordingly.\r\n\r\nThis comment was automatically generated by JIRA. If it is no longer relevant, please feel free to delete it.", "created": "2014-04-21T15:32:17.000+0000", "updated": "2014-04-21T15:32:17.000+0000" }, { "id": "323000", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue reproduces with TiSDK 3.2.0 and 3.4.0 GA \r\niOS 7.1 \r\niOS 7.0\r\nTiSDK 3.4.0 ,3.2.0\r\nAppcelerator Studio, build: 3.3.0.201407111535 \r\nTitanium Command-Line Interface, CLI version 3.3.0,", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-11T06:01:27.000+0000", "updated": "2014-09-11T06:03:35.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }