As I need to buy a new display anyway, I wanted to make my life easier with an USB-C one cable connection to my laptop (Razer Blade Stealth, it shouldn't matter for the question though).
Let say I would pick DELL S2718D display. A relevant piece from its user manual:
I would like being able to switch the display between the laptop and a desktop PC with the least cable swapping possible whilst peripherals (mouse and keyboard) stay connected to the monitor's USB downstream ports.
Now comes the tricky part, desktop PC doesn't have an USB-C port. Input source is not an issue as desktop would be connected over HDMI.
How about the peripherals though? Is there any chance it would work if a female USB-C to male USB 3.0 adapter or cable was used between the desktop and the display? If there is no chance, any other solution?
An example adapter:
From its description:
USB-C USB 3.1 Type C Female to USB 3.0 A Male Data Adapter for Macbook Tablet Mobile Phone
This adapter can convert the data which is USB-C head used into the ordinary USB 3.0 data cable.
Type C connector is the new design for USB 3.1 and can support charging and data transfer.
Type C connector can support Reversible plug orientation and Cable direction.
Perhaps it's worth mentioning, this display supports charging over USB-C (45 Watt) and I would like to use this feature for charging laptop, not sure wouldn't it 'try charging' the desktop PC over the adapter and damage it.
EDIT: A relevant piece from LG 27UD88 display user manual for the discussion in comments.
EDIT2: I've got an answer from DELL customer service so if anyone was interested it's no.
USB-C upstream port on the S2718D display is not capable of acting as a Hub
And as I've found out the LG could do it, I can turn to pick this one. There is an other risk though. The predecessor of my laptop was not charging when connected to this display model. This would surely exclude it.
Conclusion: such a setup is possible, it's wrong though to assume an USB-C upstream with USB 3.0 downstream ports built in display imply the display does have an USB hub. This was my initial assumption as this was always the case when a built in display upstream USB port was of an older type USB-A (regardless 2.0 or 3.0).
2020 EDIT: I'd gone with Lenovo ThinkVision P27h monitor for quite a while and it worked as I wanted it to. One cable switch. Now I've started using Dell U3419W and it's even better. Overall similar in terms of ports but it has a built-in kvm switch so I have to change no cables at all.