Issue #1364 resolved

context menus icons do NOT display properly

Mark Mikofski avatarMark 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. Steve Borho

    The only thing I can tell you for sure is that this should only a problem on XP. MS added a new context menu API with Vista and we've moved to those newer APIs.

    Perhaps Adrian will be curious about this.

  2. Mark Mikofski

    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.

  3. Anonymous

    Look at my screenshot plz: https://bitbucket.org/tortoisehg/thg/issue-attachment/1461/tortoisehg/thg/1322907431.1/1461/tortoise-bug.jpg 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.

  4. Mark Mikofski

    @<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.

  5. 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.

  6. 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 1.8.1.0 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.

  7. 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 https://bitbucket.org/tortoisehg/thg/downloads

    But I was not sure if that contains the entire source code. Anyway, I have found the file tortoisehg\hgqt\shellconf.py 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.

  8. Mark Mikofski

    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.

  9. 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:

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

    to

            DrawIconEx(
                lpdis->hDC,
                lpdis->rcItem.left < 16 ? lpdis->rcItem.left : lpdis->rcItem.left - 16,
                lpdis->rcItem.top
                    + (lpdis->rcItem.bottom - lpdis->rcItem.top - 16) / 2,
                (HICON) lpdis->itemData, 16, 16,
                0, 0, DI_NORMAL
            );
    
  10. 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.

  11. 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 https://bitbucket.org/tortoisehg/shellext instead. I have sent a mail to that email address to inform them of the request.

    Here is the pull request: https://bitbucket.org/tortoisehg/shellext/pull-request/1/fix-context-menus-icons-not-properly/diff

    Thanks in advance

  12. Cyril CLEAUD

    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).

  13. 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

  14. 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 :)

  15. Fish Code

    I have d/l tortoisehg-stable-2.11.2246.128-x64-ca3d2e219b32.msi and tortoisehg-stable-2.11.2246.128-x86-197ef14ca81d.msi and done some simple operation tests on XP Pro 32-bit, XP Pro 64-bit and Win7 64-bit (to make sure there's no regression).

    So far so good :)

  16. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.