mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
Close the main window on a dock icon click if it is already open.
This commit is contained in:
parent
0cf1d27b04
commit
e850bd7df8
1 changed files with 12 additions and 9 deletions
21
gtk/main.c
21
gtk/main.c
|
@ -149,7 +149,7 @@ appsetup( TrWindow * wind, benc_val_t * state, GList * args, gboolean paused );
|
||||||
static void
|
static void
|
||||||
winsetup( struct cbdata * cbdata, TrWindow * wind );
|
winsetup( struct cbdata * cbdata, TrWindow * wind );
|
||||||
static void
|
static void
|
||||||
remakewind( struct cbdata * cbdata );
|
iconclick( struct cbdata * cbdata );
|
||||||
static void
|
static void
|
||||||
makeicon( struct cbdata * cbdata );
|
makeicon( struct cbdata * cbdata );
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -456,19 +456,22 @@ winsetup( struct cbdata * cbdata, TrWindow * wind )
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
remakewind( struct cbdata * cbdata )
|
iconclick( struct cbdata * cbdata )
|
||||||
{
|
{
|
||||||
GtkWidget * win;
|
GtkWidget * win;
|
||||||
|
|
||||||
if( NULL != cbdata->wind )
|
if( NULL != cbdata->wind )
|
||||||
{
|
{
|
||||||
return;
|
/* close window */
|
||||||
|
winclose( NULL, NULL, cbdata );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* create window */
|
||||||
|
win = tr_window_new();
|
||||||
|
winsetup( cbdata, TR_WINDOW( win ) );
|
||||||
|
tr_window_show( TR_WINDOW( win ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create window */
|
|
||||||
win = tr_window_new();
|
|
||||||
winsetup( cbdata, TR_WINDOW( win ) );
|
|
||||||
tr_window_show( TR_WINDOW( win ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -950,7 +953,7 @@ handleaction( struct cbdata * data, int act )
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case ACT_ICON:
|
case ACT_ICON:
|
||||||
remakewind( data );
|
iconclick( data );
|
||||||
return;
|
return;
|
||||||
case ACT_CLOSE:
|
case ACT_CLOSE:
|
||||||
if( NULL != data->wind )
|
if( NULL != data->wind )
|
||||||
|
|
Loading…
Reference in a new issue