context menus icons do NOT display properly

Issue #1364 resolved
Mark Mikofski
created an issue

I have both TortoiseHg 2.1.4 and TortoiseSVN 1.7.1 installed on Windows XP SP3. The shell context menu icons at the highest level (i.e.: for Hg Workbench, Hg Commit and TortoiseHg) are displaying just outside of the window, so that they are not really visible (see attached file). It doesn't seem to affect the functionality, but it doesn't look good. I've seen this problem before in an older version of TortoiseSVN, there were tickets and it was fixed in a release. I don't see anyone else having this problem. It also happened with 2.1.2 (a la Kiln Client).

Comments (38)

  1. Mark Mikofski reporter

    Thanks @Steve Borho. I'll take a look at it as soon as I get a chance. This may not seem like a problem to windows 7 users, but I just added tortoiseGit and now tortoiseHg context and sub-context menus are both shifted left, but tortoiseGit and tortoiseSVN are both fine, and before it was only the topmost level.

  2. Anonymous

    Look at my screenshot plz: I was install all of exists Tortoises: Subversion, Git, Hg and Bazaar, but set up it to show menu only inside working directories (i didn't find that option in Bzr and make it enable-disable by reg-files). And I have seen this issue only by last 2 - Hg & Bzr (as I understand, both are using Qt), and only when it's dawing with and of first 2 - SVN & Git (as I know, it's don't using). I never wrote shell-extensions, didn't open the client's sources, and I have no idea, why is it and how to fix this strange glitch, but I think it has something to do with Qt-platform.

  3. Mark Mikofski reporter

    @<Anonymous> This is a great screen shot. It shows the glitch perfectly. I didn't know that it also is an issue with bzr. You know that this is only an issue with XP, and that this glitch does not happen in Windows 7. Thanks for the heads up re: Qt-platform. I'll look into it.

  4. FallenPhoenix

    In case this issue is still unfixed, can you add option to not display menu outside Hg-repos even with shift-click? I think, it can be 3-state checkbox or combobox... Mercurial is not my main VCS now (prefere Git, cause it's GUI more stable on WinXP), but I use it to work with another's repos.

  5. dankirkd

    This continues to be a problem. The lastest TortoiseGit and TortoiseSVN play well with each other, but TortoiseHg doesn't. I'm using Win XP SP3. TortoiseSVN 1.7.11, TortoiseGit and TortoiseHg 2.7.

    This used to happen with TortoiseGit as well but they fixed their problem a while back. This TortoiseGit Issue sheds some light on the issue. Looks like originally TortoiseSVN had things one way (the wrong way), then that was fixed and TortoiseGit adjusted to the correct approach. So I'm guessing that TortoiseHg needs simply to do the same so they are all on the same page.

  6. Fish Code

    For information: the same problem also happens in XP Pro SP3 64-bit.

    I was trying to peek in the source code so I downloaded a stable branch from

    But I was not sure if that contains the entire source code. Anyway, I have found the file tortoisehg\hgqt\ which is related to context menu but I'm unable to see anything which defines the position of the icons.

    Actually, THg is written in Python and differs a lot from TCVS/TSVN, I don't know why it has to be called Tortoise HG.

  7. Mark Mikofski reporter

    @Fish Code see issue #1461 @Steve Borho says, "you would want to look at the code that renders the menu in the shellext repository". I doubt you will see any movement on this, as it is only an xp problem which is discontinued anyway. It uses same icon overlays as other tortoises, hence the connection.

  8. Fish Code

    I agree with dankirkd: if nothing is done during x years and waiting for the end of support to say it won't be fixed, then there is no need to have bug tracking. We might as well wait for another 12 years and I'm sure even all the problem for Windows 7 will be "solved" :D

    Thanks to janrysavy for the source code location. After comparing the diff patch of tgit, without any compiler, environment and debugger, naïvely I would say we could change the code around line 758 from:

                lpdis->rcItem.left - 16,
                    + (lpdis->rcItem.bottom - lpdis-> - 16) / 2,
                (HICON) lpdis->itemData, 16, 16,
                0, 0, DI_NORMAL


                lpdis->rcItem.left < 16 ? lpdis->rcItem.left : lpdis->rcItem.left - 16,
                    + (lpdis->rcItem.bottom - lpdis-> - 16) / 2,
                (HICON) lpdis->itemData, 16, 16,
                0, 0, DI_NORMAL
  9. Fish Code

    Is there any doc to tell me how to make a "compile/build machine"? And if it's possible for me to make it (ie it doesn't require paid software like Microsoft Visual Studio), and if you could give me a lot of time, about two weeks :p , then I could help.

  10. Fish Code

    Yes! That's it! The correction to this bug is as simple as the code I naïvely suggested earlier.

    I have tested it in both XP Pro SP3 (32bit) and XP Pro SP2 (64bit) and both are showing the context menu icons correctly.

    As I'm unable to make THg generate a "diff", I have submitted a pull-request to instead. I have sent a mail to that email address to inform them of the request.

    Here is the pull request:

    Thanks in advance

  11. Cyril CLÉAUD

    Also, I've tested all other nemu commands and haven't seen any regression.

    Please notice my tests were passed with both TortoiseHg, TortoiseGit and TortoiseSVN. I didn't test the case of TortoiseHg only (but I think there won't be any problem).

  12. Fish Code

    Your context menu for Thg is different from what I have. I suppose that's from an older version. Version 1 or something?

    Glad that the DLL is backward compatible :D

  13. Fish Code

    My context menu is different. I have "THg Workbench" on the first level. xp-context-menu.png

    I'm a newbie in THg so I suppose you have customized something in THg. It doesn't matter :)

  14. Log in to comment