Re: Statusicon/set_skip_taskbar_hint()



Wordaround found!

With the help of the list-archive¹ and the source-code of Pidgin² written in GTK+.

Below I added the relevant code that made things work. For short the

behaviour. Clicking on statusicon lets my main window disappear, if visible

in the taskbar. It minimizes to taskbar and afterwards the taskbar entry

disappears too. When not visibile, the taskbar entry appears with animation

the window appears without animation. Same behaviour like on linux.

How it works:

On win32 I no longer check get_skip_taskbar_hint() instead I use the win32-API

IsWindowVisible() but before I have to extract the window handler from my main

window. After minimizing with iconify() I call win32-API ShowWindow()³ with

flag SW_HIDE. This lets disappear the window and taskbar entry as well, but

minimizes it before.

For letting my main window pop-up again I'm still experimentating, if all code

lines are nessecary (deiconify() and present()).

Further detail: Statusicon ist a member of MainWindow class and smart pointer

Remark: Haven't made any sophiticated test. If I recognize a problem, I'll report.

Greetings -- mik

¹http://www.nabble.com/Win32-HWND-td20494257.html

²pidgin source-code -> MinimizeToTray.c

³http://msdn.microsoft.com/en-us/library/ms633548.aspx

8< 8< 8<8< CODE 8< 8< 8< 8< CODE 8< 8< 8< 8<

#ifdef PLATFORM_WIN32

#include <windows.h>

#include <gdk/gdkwin32.h>

#else

...

void MainWindow::onStatusIconActivated(void)

{

clog << "MainWindow::onStatusIconActivatedClicked" << std::endl;

#ifdef PLATFORM_WIN32

HWND hWnd = reinterpret_cast<HWND> (GDK_WINDOW_HWND (

this->get_window()->gobj()));

bool hide = !IsWindowVisible(hWnd);

#else

bool hide = get_skip_taskbar_hint();

#endif

if (hide) {

deiconify();

present();

} else {

iconify();

// http://www.nabble.com/Win32-HWND-td20494257.html

// pidgin -> MinimizeToTray.c

}

#ifdef PLATFORM_WIN32

if(hide) {

ShowWindow(hWnd, SW_SHOW);

SetActiveWindow(hWnd);

SetForegroundWindow(hWnd);

} else {

ShowWindow(hWnd, SW_HIDE);

}

#else

set_skip_taskbar_hint(not hide);

#endif

}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]