Skip to content

GUI Disappearing #1522

Closed
fanquake opened this Issue Jun 26, 2012 · 27 comments

8 participants

@fanquake
Bitcoin member

Since upgrading I've been having an issue where the GUI disappears completely.

For example, I'll be using Bitcoin-Qt, then exit it using the red cross. If I then click on Bitcoin in the dock, the GUI no longer shows up. It has definitely been selected though, because the task bar changes to Bitcoin and shows Bitcoin options.

Anyone else been having a similar problem?

@laanwj
Bitcoin member
laanwj commented Jun 26, 2012

Needs more information;
Upgrading from what version to what version?
Which OS?
Do you have "close to tray" enabled? Isn't it simply shutting down?

@fanquake
Bitcoin member

Sorry, didn't copy the top half of my issue.
OS X 10.7.4, upgrading from 0.6.2.2 to 0.6.3

Close to tray?

@laanwj
Bitcoin member
laanwj commented Jun 26, 2012

Never mind, that option doesn't exist on MacOSX.

A problem with the dock icon on OSX has been solved something like a month ago:

b06f9c1

I'm not sure whether it is backported to 0.6.x, though.

@fanquake
Bitcoin member

I've had a look into this, and adding that code back in actually fixes the problem.

@laanwj
Bitcoin member
laanwj commented Jul 14, 2012

But that brings back the problems in #1327 right? We really need someone to hack on bitcoin ui on the mac, currently it's mostly guess work.

@Nerzahd
Nerzahd commented Jul 21, 2012

Same problem here. i have to right-click at dock icon and select "Show/Hide Bitcoin" to bring the window back.

@laanwj
Bitcoin member
laanwj commented Aug 18, 2012

Can anyone answer my question? Does re-adding that code bring back issue #1327?

@fanquake
Bitcoin member

I have a feeling it does. Although that would probably be preferred over the gui dissapearing completely. Not all users would realise that they have to use show/hide to bring it back. Whereas they will more than likely click the dock icon more than once if the gui shows up and then dissapears.

@strk
strk commented Dec 20, 2012

I have this same problem on a linux box.
Commenting out the #ifndef Q_OS_MAC in BitcoinGUI::createTrayIcon (and relative #endif) fixes the issue for me, which suggests that macro is defined when it should not be...

@strk
strk commented Dec 20, 2012

Forget it, it still works after dropping the comments. There must be an issue with the dependency tracker which prevented my build to catch a recent fix

@Diapolo
Diapolo commented Jan 8, 2013

Any Mac dev, who can contribute here?

@fanquake
Bitcoin member

Has this been fixed?

@gavinandresen
Bitcoin member

Works for me on OSX 10.8 using git HEAD. Please open a new issue if it doesn't work for you when 0.8 is out.

@Nerzahd
Nerzahd commented Mar 10, 2013

With the new version 0.8 the GUI disappears completely again. I have to restart bitcoin-qt to bring it back.
OSX 10.8.2 on three different computers.
Others on the forum reported the same issue: https://bitcointalk.org/index.php?topic=145184.msg1582293#msg1582293

@gavinandresen gavinandresen reopened this Mar 10, 2013
@L2G
L2G commented Mar 11, 2013

I have observed this in OS X 10.7.5 as well, but to clarify: the window is irretrievable only after I hit the window-close button. If I hit the window-minimize button, the window minimizes as expected and can be restored in the usual way.

@strk
strk commented Mar 11, 2013

Does this have to do with tray icon at all ? Do you have a tray icon ?

@L2G
L2G commented Mar 11, 2013

The closest equivalent to a system tray in Mac OS is the right-hand side of the menu bar. My Bitcoin-Qt does not put an icon in the menu bar.

I played with the window options "Minimize to the tray instead of the taskbar" and "Minimize on close" to see if they had any effect, but they do not. Moreover, these settings do not appear to be retained in the Mac OS version.

I found an older thread on the Qt Project forums that may or may not be relevant here:
http://qt-project.org/forums/viewthread/2416

I can work on doing builds on my machine if you are still in need of people who can make and test their own builds on Mac OS.

@gavinandresen
Bitcoin member

RE: working on doing builds: yes, we need a Qt/OSX programmer. My main machine is OSX, but I spend most of my time working on lower-level code, not GUI stuff.

@L2G
L2G commented Mar 12, 2013

Okay. I was just able to run one of my own builds, so you can consider me at least a rookie QA engineer for Mac. 😸

@L2G
L2G commented Mar 12, 2013

Here would be one way to make a quickie fix. In BitcoinGUI::closeEvent is this block:

     if(clientModel)
     {
#ifndef Q_OS_MAC // Ignored on Mac
         if(!clientModel->getOptionsModel()->getMinimizeToTray() &&
            !clientModel->getOptionsModel()->getMinimizeOnClose())
         {
             qApp->quit();
         }
#endif
     }

Moving the #endif up by 3 lines would at least ensure that the app quits when the window-close button is clicked.

However, I think I see some possibilities for enabling minimize-to-tray and minimize-on-close on Mac OS, so I'm going to play with those some more.

@Nerzahd
Nerzahd commented Mar 18, 2013

if I change

void BitcoinGUI::createTrayIcon()
{
#ifndef Q_OS_MAC
trayIcon = new QSystemTrayIcon(this);

trayIcon->setToolTip(tr("Bitcoin client"));
trayIcon->setIcon(QIcon(":/icons/toolbar"));
trayIcon->show();
#endif

to

void BitcoinGUI::createTrayIcon()
{
trayIcon = new QSystemTrayIcon(this);
#ifndef Q_OS_MAC

trayIcon->setToolTip(tr("Bitcoin client"));
trayIcon->setIcon(QIcon(":/icons/toolbar"));
trayIcon->show();
#endif

the menu on the dockicon appears again.

@L2G
L2G commented Mar 18, 2013

For those watching at home, @Nerzahd moved #ifndef Q_OS_MAC down one line to keep trayIcon = new QSystemTrayIcon(this); from being excluded by the conditional.

(I had to diff the two to figure out what was going on.) 😁

@Diapolo
Diapolo commented Mar 19, 2013

I'm not sure why that patch helps on Mac really ^^. Can some Mac-capable dev enlighten me?

@L2G
L2G commented Mar 19, 2013

You have a point. At least this way the call the call to QSystemTrayIcon will get compiled into the Mac version, but without the call to trayIcon->show, it may be useless. I have a Mac and can try this out (just not right this moment).

Wait, were you talking about @Nerzahd's patch or mine?

@Nerzahd
Nerzahd commented Mar 19, 2013

i'm not a developer but i think it has something to do with:

// Create system tray menu (or setup the dock menu) that late to prevent users from calling actions,
// while the client has not yet fully loaded
if(trayIcon)
    createTrayIconMenu();
@Diapolo
Diapolo commented Mar 19, 2013

createTrayIconMenu() on Mac should work without depending on trayIcon to be non-zero. Perhaps that is the problem why it works, when allowing trayIcon = new QSystemTrayIcon(this); on Mac.

Solution could be to call createTrayIconMenu() on Mac always. Can a Mac dev try this?

Edit: I created a patch, dunno if it works though ^^.

@Diapolo Diapolo pushed a commit to Diapolo/bitcoin that referenced this issue Mar 30, 2013
Philip Kaufmann Bitcoin-Qt: ensure createTrayIconMenu() is always called on Mac
- this should prevent GUI issues on Mac that were observed before (disappearing
  GUI - see #1522)
- the patch ensures, that createTrayIconMenu() is always called on Mac to
  process and use our MacDockIconHandler
5968cf5
@jonasschnelli jonasschnelli added a commit to jonasschnelli/bitcoin that referenced this issue Apr 15, 2013
Jonas Schnelli 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>
4d17a1b
@laanwj laanwj closed this in 63888d4 Apr 27, 2013
@banjaxxed

I have this problem on v0.8.6-beta Windows 7 professional x64

@laudney laudney pushed a commit to reddcoin-project/reddcoin that referenced this issue Mar 19, 2014
Philip Kaufmann Bitcoin-Qt: ensure createTrayIconMenu() is always called on Mac
- this should prevent GUI issues on Mac that were observed before (disappearing
  GUI - see #1522)
- the patch ensures, that createTrayIconMenu() is always called on Mac to
  process and use our MacDockIconHandler
5e673ea
@laudney laudney pushed a commit to reddcoin-project/reddcoin that referenced this issue Mar 19, 2014
Jonas Schnelli 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>
0d77103
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.