public inbox for
help / color / mirror / Atom feed
From: "Tobias Häußler" <>
Subject: Re: Taskbar grouping in Windows 7
Date: Mon, 25 Jul 2011 11:20:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 19.07.2011 17:17, Jon TURNEY wrote:
> On 01/07/2011 21:38, Tobias Häußler wrote:
>> On 29/06/2011 15:25, Jon TURNEY wrote:
>>> On 25/06/2011 13:48, Tobias Häußler wrote:
>>>> I created a small patch for XWin that adds correct grouping of taskbar
>>>> icons when 'Always combine, hide labels' is set in the taskbar
>>>> properties. It uses the new taskbar APIs introduced in Windows 7 to set
>>>> an application id for each window. The id is based on the X11 class hints.
>>>> Maybe it is useful for someone...
>>> Firstly, thanks very much for this patch.
>>> Getting Windows to correctly group XWin windows on the taskbar is something
>>> that has needed fixing for a while, so it's great to have it done :-)
>> Thanks for your suggestions! I changed the code you mentioned.
> Thanks.  I've included this patch into the 1.10.3-1 package.
> I noticed that there are a couple of warnings issued when building
>>    CC     winmultiwindowwm.o
>> In file included from winmultiwindowwm.c:69:0:
>> taskbar.h:59:19: warning: ‘IID_IPropertyStore’ initialized and declared ‘extern’
>> taskbar.h:67:53: warning: ‘PKEY_AppUserModel_ID’ initialized and declared ‘extern’
> This seems to be related to the nonsense that is INITGUID.  I'm not sure how
> to fix this warning.  Would moving all the GUIDs we use (including the DirectX
> ones we use) to a separate file and compiling that with INITGUID defined be
> the correct solution?

I don't know the right way to deal with that, but it seems to work if 
taskbar.h is included in a separate .c-file with INITGUID defined, and 
in winmultiwindowwm.c without:

--- taskbar.c:
#define INITGUID
#include <basetyps.h>
#include <shlguid.h>

#include "taskbar.h"

--- winmultiwindowwm.c:
#include "taskbar.h"

The current solution produces this warning because of the declaration of 
DEFINE_GUID in basetyps.h and initguid.h:

DEFINE_GUID with INITGUID in basetyps.h resolves to:
   const GUID IID_IPropertyStore = {a,b,c,...}

DEFINE_GUID without INITGUID in basetyps.h resolves to:
   extern const GUID IID_IPropertyStore;

DEFINE_GUID with INITGUID in initguid.h resolves to:
   (extern) const GUID IID_IPropertyStore = {a,b,c,...}
Whether extern is appended or not depends on basetyps.h, which is 
included before initguid.h.

Including initguid.h (with INITGUID defined) after basetyps.h appends "= 
{a,b,c}", but does not remove "extern". In winmultiwindowwm.c this is 
the case, as basetyps.h is included by objbase.h before initguid.h.

The DirectX-GUIDs are initialized in the lib*.a-files of w32api, 
therefore INITGUID is not necessary and the warnings are not present. As 
soon as w32api contains the GUID for IID_IPropertyStore, taskbar.c with 
INITGUID can be removed.

> The other thing I noticed is that PropVariantClear() has been provided by
> ole32.dll since at least NT4, so there's no need to dynamically link with it.
>   So I'm confused as to why you are using GetProcAddress for that?

PropVariantClear() is not declared in the header files of w32api, so I 
had to link it dynamically.

Unsubscribe info:
Problem reports:

      reply	other threads:[~2011-07-25 10:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-25 12:49 Tobias Häußler
2011-06-29 13:26 ` Jon TURNEY
2011-07-02 16:51   ` Tobias Häußler
2011-07-19 15:31     ` Jon TURNEY
2011-07-25 11:20       ` Tobias Häußler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).