fixes #1522: GUI Disappearing (Mac OSX) #2530

pull jonasschnelli wants to merge 1 commits into bitcoin:master from jonasschnelli:mac_win_reopen_fix changing 3 files +15 −2
  1. jonasschnelli commented at 8:16 pm on April 14, 2013: contributor
    • this solution works stable on mac and ensures that the window get’s reopened when the user clicks the dock icon .
    • tested on 10.8 with Qt4.8.4 and Qt5.0.1
  2. fix: GUI Disappearing #1522 (Mac OSX)
    - this solution works stable on mac and ensures that the window get's reopened when the user clicks the dock icon .
    - tested on 10.8 with Qt4.8.4 and Qt5.0.1
    
    Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
    4d17a1b0c2
  3. in src/qt/bitcoingui.cpp: in b9d633bb70 outdated
    381@@ -382,6 +382,7 @@ void BitcoinGUI::createTrayIconMenu()
    382 #else
    383     // Note: On Mac, the dock icon is used to provide the tray's functionality.
    384     MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance();
    385+    dockIconHandler->setMainWindow((QMainWindow *)this);
    


    laanwj commented at 6:08 am on April 15, 2013:
    possible pointer leak here: when is the MacDocIconHandler freed? Does its scope extend beyond that of the main window? If so, you should do setMainWindow(NULL) in the destructor.

    jonasschnelli commented at 6:16 am on April 15, 2013:
    It’s a singleton, … it probably never gets freed during by the app itself. But i just added this->mainWindow = NULL; in the destructor.

    laanwj commented at 8:01 am on April 15, 2013:
    I think you misunderstand me. What I mean is to set the mainwindow of your singleton to NULL in the destructor of the MainWindow. This prevents a stale pointer in your singleton after MainWindow is freed but the singleton still lives.

    jonasschnelli commented at 10:03 am on April 15, 2013:
    Ah. Clear. Your right. Did update the code. But i think the destructor of BitcoinGUI never gets called during the runtime. But yes, the pointer MUST be set to NULL.

    laanwj commented at 10:21 am on April 15, 2013:

    The destructor of BitcoinGUI gets called when the object goes out of scope. Feel free to verify this and prove me wrong (this would be a bug).

    The proper idiom here would be a “weak pointer”. But explicitly setting it to null to prevent a dangling pointer is ok.

  4. BitcoinPullTester commented at 0:45 am on April 16, 2013: none
    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/4d17a1b0c29e8fd8510c75db1efb203b9b4f9eb0 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
  5. laanwj commented at 6:03 pm on April 18, 2013: member
    ACK after squashing into one commit
  6. Diapolo commented at 10:21 am on April 26, 2013: none
    @laanwj ping :)
  7. laanwj referenced this in commit 63888d43be on Apr 27, 2013
  8. laanwj merged this on Apr 27, 2013
  9. laanwj closed this on Apr 27, 2013

  10. laudney referenced this in commit 6882350494 on Mar 19, 2014
  11. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-04 22:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me