[git] GpgOL - branch, master, updated. gpgol-1.4.0-254-gfdc2575

by Andre Heinecke cvs at cvs.gnupg.org
Mon Jan 16 16:20:54 CET 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".

The branch, master has been updated
       via  fdc2575c657abd4e7630cbb1461a9f270ea2046a (commit)
      from  94faa08526668e51d861d5281a8e562a5bc9b9a2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fdc2575c657abd4e7630cbb1461a9f270ea2046a
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jan 16 15:52:37 2017 +0100

    Programatically resize window after category set
    
    * src/mail.cpp (resize_active_window): New. Resize window by 1px
    and back.
    (Mail::update_categories): Use it.
    
    --
    This fixes a display issue when categories are updated, mostly..

diff --git a/src/mail.cpp b/src/mail.cpp
index b713f3e..03c2382 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -1374,6 +1374,68 @@ Mail::remove_categories ()
   remove_category (m_mailitem, verifyCategory);
 }
 
+/* Now for some tasty hack: Outlook sometimes does
+   not show the new categories properly but instead
+   does some weird scrollbar thing. This can be
+   avoided by resizing the message a bit. But somehow
+   this only needs to be done once.
+
+   Weird isn't it? But as this workaround worked let's
+   do it programatically. Fun. Wan't some tomato sauce
+   with this hack? */
+static void
+resize_active_window ()
+{
+  HWND wnd = get_active_hwnd ();
+  static std::vector<HWND> resized_windows;
+  if(std::find(resized_windows.begin(), resized_windows.end(), wnd) != resized_windows.end()) {
+      /* We only need to do this once per window. XXX But sometimes we also
+         need to do this once per view of the explorer. So for now this might
+         break but we reduce the flicker. A better solution would be to find
+         the current view and track that. */
+      return;
+  }
+
+  if (!wnd)
+    {
+      TRACEPOINT;
+      return;
+    }
+  RECT oldpos;
+  if (!GetWindowRect (wnd, &oldpos))
+    {
+      TRACEPOINT;
+      return;
+    }
+
+  if (!SetWindowPos (wnd, nullptr,
+                     (int)oldpos.left,
+                     (int)oldpos.top,
+                     /* Anything smaller then 19 was ignored when the window was
+                      * maximized on Windows 10 at least with a 1980*1024
+                      * resolution. So I assume it's at least 1 percent.
+                      * This is all hackish and ugly but should work for 90%...
+                      * hopefully.
+                      */
+                     (int)oldpos.right - oldpos.left - 20,
+                     (int)oldpos.bottom - oldpos.top, 0))
+    {
+      TRACEPOINT;
+      return;
+    }
+
+  if (!SetWindowPos (wnd, nullptr,
+                     (int)oldpos.left,
+                     (int)oldpos.top,
+                     (int)oldpos.right - oldpos.left,
+                     (int)oldpos.bottom - oldpos.top, 0))
+    {
+      TRACEPOINT;
+      return;
+    }
+  resized_windows.push_back(wnd);
+}
+
 void
 Mail::update_categories ()
 {
@@ -1400,6 +1462,9 @@ Mail::update_categories ()
          categories */
       remove_category (m_mailitem, decCategory);
     }
+
+  resize_active_window();
+
   return;
 }
 

-----------------------------------------------------------------------

Summary of changes:
 src/mail.cpp | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org




More information about the Gnupg-commits mailing list