Commit graph

75 commits

Author SHA1 Message Date
Jocelyn Turcotte
166ef85a51 shell/Windows: Update binaries to build 44 2017-01-18 13:34:02 +01:00
Jocelyn Turcotte
47fbfbc006 shell/Windows: Avoid memory allocations and copies when querying icons
IsMemberOf is called for every file (in the ownCloud directory or not) and
with every instance of OCOverlay (we have 5) when displaying a list of
files in Explorer.

Refactor the code to avoid copying the list of watched directories, as
well as creating a wstring from a PWWSTR for files outside watched
directories.

Also change some calls of begin_with to use isDescendantOf since it
properly handles parent paths not ending with a backslash, which could
lead to SocketAPI queries for sibling folders with a name that starts with
a watched folder name.
2017-01-18 12:15:52 +01:00
Jocelyn Turcotte
e131c142ff shell/Windows: Fix the view not being updated on StateError
Since StateError == 0, if this was the status used when the path
isn't in the map already, the view would not be updated since the
new state would be the same as the default-constructed state in the
map. Fix by explicitly inserting in that case, this also avoid aving
to do two lookups in the map when a path already has an entry.
2017-01-18 12:15:52 +01:00
Jocelyn Turcotte
1b99ff2e91 shell/Windows: Remove the UPDATE_VIEW message handling
The client now tries to only push STATUS messages to connections
unless they previously requested it with a RETRIEVE_FILE_STATUS,
but this means that we now have to make sure that a new connection
will rerequest every icon that the user will see on files from that
point on.

To that end, we now send a SHChangeNotify for every file in the cache
when we lose the connection (or on UNREGISTER_PATH) to make sure that
what's on the screen matches what's in the cache. We also remove the
_oldCache logic that made this more difficult to enforce.

The client has been able to reliably push status updates on macOS
for a few versions now, and we don't need it on Windows either. The
_oldCache mechanism was to avoid sending to many update requests
when receiving an UPDATE_VIEW.

Also fixes #4766
2017-01-18 12:15:52 +01:00
Jocelyn Turcotte
3e85d47a57 shell/Windows: Convert tabs to space
It was a mix of both and the rest of the code uses spaces.
2017-01-18 12:15:52 +01:00
Jocelyn Turcotte
e709d75d56 shell/Windows: Remove unused files
The real OCContextMenu.cpp is in the OCContextMenu folder.
2017-01-18 12:15:52 +01:00
Daniel Molkentin
b575ded464 More GmbH -> Inc Copyright header fixes 2016-07-26 16:53:11 +02:00
Jocelyn Turcotte
03a90bf03f shell/windows: Build 43, add missing 32 bit binaries
Also include a minor change from #5025
2016-07-26 14:54:27 +02:00
Jocelyn Turcotte
ff7b2381e9 shell/windows: Add missing Win32 configuration changes
The changes in build location were only done on the x64 configuration.
2016-07-26 14:53:14 +02:00
arthurchiao
7a2a439426 fix #5015 overlay icon not show: compare folder paths with no case-sensitivity 2016-07-01 13:03:42 +08:00
Jocelyn Turcotte
ba96fb89a5 shell_integration/windows: Set VS output directory in the binary submodule
This allows creating a new build simply by hitting F7 in visual studio
and then committing the changed files in the binary submodules without
having to know which files to move where.
2016-06-27 15:23:37 +02:00
Jocelyn Turcotte
70ae11fcad shell_integration/windows: Add a manually-increased build number
Since this isn't yet built together with the rest, we can't reliably
use the client version without having to rebuilt the extension manually
on each release. But it would still be nice to be able to tell if a user
has the right version or not loaded, so instead just tag each update of
the DLLs with a separate release version.

This means that every time we update those binaries we'll have to manually
increment the number in the header, but worst case we'll forget from time
to time but we'll be able to know if we didn't, and know if we can rely on
the number or not.
2016-06-27 15:13:47 +02:00
ckamm
86fd982b00 SocketAPI: Use different pipe name #4977 (#4997)
Named pipe names that contain backslashes sometimes lead to problems.
2016-06-27 15:13:08 +02:00
Daniel Molkentin
9d6701ecbe Windows Shell Integration: Fix another spot where the pipe path was constructed manually 2016-05-10 13:49:14 +02:00
Daniel Molkentin
0e9170cb36 Windows Shell Integration: Unify path lookups 2016-05-10 10:18:53 +02:00
Markus Goetz
8820bc1c17 Windows: Fix Share menu #4781 2016-05-09 14:37:46 +02:00
Daniel Molkentin
e833d01288 Re-Apply: Disambiguate socket API pathes on Windows with user name
Addresses #3411
2016-05-02 16:09:48 +02:00
Daniel Molkentin
b43a9421d2 Revert "Disambiguate socket API pathes on Windows with user name" 2016-04-28 13:52:15 +02:00
Daniel Molkentin
ce6a365328 Disambiguate socket API pathes on Windows with user name
Addresses #3411
2016-04-26 14:49:45 +02:00
Daniel Molkentin
a0827c5ef2 Remove deleted icons from resource file 2016-04-06 17:59:34 +02:00
Jocelyn Turcotte
5989a07339 [Win-shellex] Make sure to unregister obsolete CLSIDs #4595
If the user tries to install an older version of a branded client
with shell extensions, and also install the 2.1 ownCloud client
side-by-side, both shell extensions DLLs will be registered and might
lead to both DLLs versions being loaded by exlorer, causing a system
crash.

Since we don't support both branded and non-branded shell extensions
to work at the same time, at least make sure to unregister any legacy
CLSID that could cause explorer to load the previous version DLL.
2016-03-24 16:35:38 +01:00
Jocelyn Turcotte
7beb6f2234 Windows shell: Remove unneeded Winsock code #4356 2016-01-14 15:02:56 +01:00
Jocelyn Turcotte
bb5c370575 Windows: Update the overlay icon graphics #3105
The bug seems to be in Windows when it upscales an smaller icon for
HiDPI displays. It works fine if we provide a 256x256 size in the
ico files.

Use the new square icons also used on OS X that removes the share badge
and instead has a share icon only for the OK state. This means that we
can also remove 3 icons and release 3 slots in the registry for
overlay icons (only the first few are actually loaded by explorer).

This also adds a script that uses ImageMagick to convert our SVG icons
to Windows ico files. Since ImageMagick seems to have issue doing
proper antialiasing with pixels on the edge of icons, this also
slightly scale the icons to leave 2px on each edge, out of its
logical 128px width.
2016-01-12 11:46:05 +01:00
Phil Davis
bae552f386 Minor shell integration typos
all in comments or other places that have no effect on the user.
2015-09-10 17:14:08 +05:45
Jocelyn Turcotte
0d5d2c578d shell_integration on Windows: Avoid too many RETRIEVE_FILE_STATUS following UPDATE_VIEW #3122
Do not request the status of all entries in the cache. Instead force
explorer to request the ones that it deems necessary by keeping the old
statuses in a separate dictionary which are only used while the new status
arrives.
2015-05-06 16:48:34 +02:00
Jocelyn Turcotte
77679790db shell_integration on Windows: Don't fill the cache with unsolicited statuses #3122
Only keep the status updates if explorer is going to display it.
2015-05-06 16:48:33 +02:00
Jocelyn Turcotte
ad5620efb5 Disable asserts in official builds
Make sure that we define NDEBUG in all configurations.
Also remove inconsistent defines:
WIN32: We don't use
_DEBUG;_WINDOWS;_USRDLL: Should be defined by the compiler if necessary
OCCONTEXTMENU_EXPORTS: We currently don't use dllimport anyway

This also update the binary submodule with an updated build.
2015-03-23 13:53:09 +01:00
Jocelyn Turcotte
60da0a15e6 shell_integration: Remove the incorrect usage of the MIIM_BITMAP flag
This flag should only be specified if the hbmpItem member of the
MENUITEMINFO has been set.
2015-03-12 15:22:29 +01:00
Jocelyn Turcotte
d88751bb8b shell_integrations: Fix the precompiled headers usage in OCUtil
Enable it in all configurations and add the missing include.
2015-03-11 22:17:46 +01:00
Jocelyn Turcotte
c6442f67c1 shell_integration: Fix a crash on explorer startup
There is a race condition that can initialize the RemotePathChecker
instance concurrently on the same address and cause a crash when locking
the mutex. The reason is that local static initialization is not
thread-safe with MSVC2013.

Fix the issue by using call_once to initialize a static unique_ptr
instead.

This could be related to some reports of issue #2836.
2015-02-18 17:33:46 +01:00
Jocelyn Turcotte
9579102541 shell_integration: Generate a .pdb in Release for OCContextMenu_x64.dll 2015-02-16 16:47:00 +01:00
Jocelyn Turcotte
4b67429234 shell_integration: Wait longer for the Share menu title
50ms is sometimes not enough when the client is busy synchronizing.
Wait up to 500ms for the client to answer before we give up and show an
empty menu title.

Ideally we should request the title before the watched directory list, but
the list is currently sent implicitly on connect.
2015-02-13 17:18:39 +01:00
Jocelyn Turcotte
23e248b5d1 shell_integration: Fetch the share menu title from the client on Windows
The context menu will now show "Share with ownCloud" instead of "Share" as
it does on other platforms.

This also updates the submodule to point to matching binaries.
2015-02-13 16:08:39 +01:00
Jocelyn Turcotte
bed34b1ddd Fix an infinite loop when unregistering OCContextMenu without admin rights
That mistake was introduced when changing the bool return value to an
HRESULT in the imported RegDelnode code.
2015-02-12 13:35:44 +01:00
Jocelyn Turcotte
dc85ee3f0a shell_integration: Fix hangs on Windows Vista
It seems like verclsid.exe hangs on our class IDs when invoked
through explorer.exe for 5-10 seconds. It doesn't hang if I
invoke the same command line from cmd.exe, so there could be some
process parameters that don't play well with our extra thread
or to the pipe connection that we do in it.

Delay creating the RemotePathChecker thread until the first
IsMemberOf call. verclsid.exe only seems to instantiate a object
of each registered class, without actually using them, so we
can use this as a workaround.

This should be fixing issue #2680.
2015-02-11 16:45:11 +01:00
Daniel Molkentin
13aaa46a55 OCContextMenu: Also export modules for x86 2015-02-09 11:56:52 +01:00
Jocelyn Turcotte
af0001a149 [shell_integration] Remove the usage of Win32 APIs not available on XP 2015-02-05 15:15:05 +01:00
Jocelyn Turcotte
2debd5a198 [shell_integration] Setup precompiled headers properly with MSVC
This also fixes a minor compile error when using VS Express.
2015-02-05 15:14:42 +01:00
Daniel Molkentin
f84758eaac Add Resource File for OCContextMenu, adjust (c) dates. 2015-01-29 16:37:51 +01:00
Daniel Molkentin
8c58236e7c Remove template file 2015-01-29 16:13:36 +01:00
Daniel Molkentin
027328d3a6 Windows Integration: Don't use size_t in StringUtil, it's unsigned 2015-01-29 16:11:42 +01:00
Daniel Molkentin
d6c4f749a6 Windows Shell Integration: Also ensure correct TargetName on x86/release 2015-01-29 13:03:38 +01:00
Daniel Molkentin
8af2c6c397 Update MSVC Project files to a consistent state 2015-01-29 13:00:30 +01:00
Daniel Molkentin
367ef7195a Windows Shell Integration: Fix warnings 2015-01-29 13:00:29 +01:00
Olivier Goffart
fb79211514 Merge remote-tracking branch 'remotes/origin/win_context_menu' 2015-01-23 18:02:55 +01:00
Olivier Goffart
0af97156c9 Windows shell integration: Make the share entry work by adding a Sleep
Timeouts don't work with named pipe, so wait for 50ms to let time
for the client to answer
2015-01-23 15:43:03 +01:00
Daniel Molkentin
316c476bbd Revert "Revert "Windows Shell Integration: Show status icon for root folder""
This reverts commit 176413d312.
2015-01-22 19:13:12 +01:00
Daniel Molkentin
081cc0b9e8 WiP: Add Win32 Context menu integration 2015-01-22 18:45:20 +01:00
Olivier Goffart
560759ede8 Windows shell integration: Reduce the timeout time of WaitNamedPipe
This is maybe what causes the troubles of task #2576
2015-01-22 16:30:02 +01:00
Daniel Molkentin
5619947685 Relocate Windows shell extensions
The directory was redundant
2015-01-12 14:40:42 +01:00