chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.38k stars 467 forks source link

taskbar pinning issues started recently #3830

Closed llexel closed 1 week ago

llexel commented 1 week ago

We're using cefsharp, both in an outlook plugin and a separate application. After upgrading from v125 to v127 of CefSharp (sorry don't know corresponding cef version but recent - i.e. mid-late 2024) we have found that our windows taskbar pinned application and our pinned outlook are both affected and grouped together so one of them always loses the pin to the taskbar. From a security perspective this shouldn't even be possible for an embedded browser inside an outlook plugin to affect the parent outlook applications taskbar pin, however rolling back resolves and upgrading again causes the issue, we have proven it experimentally multiple times in many different environments.

magreenblatt commented 1 week ago

This issue tracker is for CEF issues that reproduce in supported versions.

Your issue is likely related to the Chrome runtime. Usage is optional in CefSharp at version 127. See https://github.com/cefsharp/CefSharp/discussions/4123

llexel commented 1 week ago

apologies I should have mentioned but it exists in all newer versions, not just 127, thats just when we noticed it

magreenblatt commented 1 week ago

How are you launching your CefSharp application from Outlook? Is it running in the same process? Are you doing anything in code to change the default taskbar behavior?

llexel commented 1 week ago

It's an outlook addin, using NetOffice, and displays a browser page in a panel next to the appointments.

We are not doing anything to change the taskbar behaviour at all. We have been through a process of weeks of trying to work around the new introduced problem, where we started attempting to give the applications different application ids manually to stop the taskbar pinning issues, but none of these proved to work so we have for now given up and gone back to v125 of cefsharp and do not plan to upgrade again until this has been resolved

magreenblatt commented 1 week ago

displays a browser page in a panel next to the appointments.

Usually, only top-level windows have a taskbar icon. It sounds like this window should be parented to some Outlook window, and therefore should not have its own taskbar icon.

llexel commented 1 week ago

it is when people double click to open an appointment, so it opens in its own window, which has an outlook icon, but cefsharp climbs up the stack somehow and overrides it. We have even now seen outlook add an 'envelope' showing new mail over the top of our other applications icon, which is very confusing for users

llexel commented 1 week ago

if i had to guess, maybe chrome itself had a bug where newly opened windows get opened without being correctly grouped, and someone has fixed this in too brutal a way

magreenblatt commented 1 week ago

it is when people double click to open an appointment, so it opens in its own window, which has an outlook icon

When unpinned, is this window's taskbar button grouped with Outlook's taskbar button? If so, that sounds like correct behavior. See issue #3641 as related.

llexel commented 1 week ago

outlook appointments are grouped under outlook yes whether pinned or not.

What we are seeing is user opens application A, then they use that, open windows, etc, cefsharp, all working as it should. A is pinned to the taskbar.

Next they have outlook also pinned to their taskbar, and when they open appointments, which also loads cefsharp, usually those windows are grouped under the outlook pin. INSTEAD what is happening here is that the outlook taskbar pin is getting DELETED and outlook and all of its windows disappear from the taskbar and we later find they are hidden grouped under application A. Outlook is even putting the new mail envelope on top of our completely different application icon somehow.

After closing all applications, you have to use the start menu to find outlook and repin it to the taskbar if you want it back, but then as soon as you open an appointment it disappears again and regroups under the other application

magreenblatt commented 1 week ago

Is application A and the CefSharp outlook appointment both initializing CEF with the same CefSettings.cache_path/root_cache_path?

llexel commented 1 week ago

Not the same no, I'm using a processID subdirectory to prevent clashes between different processes. Before that we'd have locks and failure to run more than one application at a time

settings.RootCachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\Cache\" + Process.GetCurrentProcess().Id.ToString() + "\");

magreenblatt commented 1 week ago

INSTEAD what is happening here is that the outlook taskbar pin is getting DELETED and outlook and all of its windows disappear from the taskbar and we later find they are hidden grouped under application A

Can you try reproducing this behavior using two instances of the CEF sample application with different --cache-path=<path> values? You might also need to add --use-native if using cefclient/cefsimple.