• 1 Post
  • 190 Comments
Joined 2 years ago
cake
Cake day: September 24th, 2023

help-circle







  • So, Windows has fully optimal behaviour here:

    If you click on an area of the window that cannot be dragged from, it raises it on mouse-down.

    If you click on an area of the window that can be dragged on, it doesn’t raise if you start a drag, otherwise it raises it on mouse-up.

    That’s the desired behaviour. I agree people didn’t really explain that clearly.

    I haven’t looked into it for over 20 years but as I recall it is impossible to do this with X11. I have no idea if Wayland added some kind of support for this, but I would be quite surprised given how long it took them to do screenshots.

    Part of the difficulty is that you need to somehow query an app on mouse-down if it might start a drag. I have no idea how Windows does that… but… they solved it decades ago.



  • Honestly I don’t need to know anything about it at all except that it’s a payment system designed by GNU to know that it stands zero chance of success.

    GNU are uber-geeks that do not comprehend usability at all. They think everyone is happy to go to key exchange parties and run their own servers and so on. There’s absolutely no chance this is understandable by normal people.



  • The linked patch actually explains it really well.

    If you want two processes to communicate (IPC) normally, you would set up some shared memory, so that in each process’s virtual memory some pages are shared between them both, so when process A writes to that memory it is visible to process B and vice versa. There are other ways to do IPC but this is the fastest since it doesn’t involve any syscalls (context switch to the kernel which is slow).

    However it still requires each process to copy its private data into and out of the shared memory. Also it still requires a context switch from process A to process B.

    A common use of IPC is for RPC (Remote Procedure Calls). Basically you want to run a function in the other process. This solution does that but differently and faster.

    1. First, both processes share the same virtual memory. This is normally a recipe for disaster since it completely destroys the normal process memory sandboxing (a memory error in one process can now crash the other one!). However they use a new Intel MPK hardware feature that allows splitting the pages into one of 16 groups (“keys”), and you can control read/write access to each group independently.

    2. Next when process A wants to call a function in process B, the RPAL code does a lightweight context switch in user space. I guess this just means changing the MPK key, and normal saving of registers for the function call. I’m not sure what else you’d need to change. It’s a little unclear about how you pass heap data from process A to process B. I guess both processes just have read access to the entire address space? That doesn’t really change the security model on Unix since any process can already debug any other process with no extra permissions.

    It sounds very similar to running two processes as if they were threads in the same process. Why not just use threads? Probably a better option if you can, but I guess if you are e.g. running processes written in different languages that might be tricky?







  • I don’t think it’s quite a titanic enough endeavour to put slow in quotes. It’s been in development for 16 years and only got a stable support for screenshots a few months ago. Does drag and drop work yet?

    IMO at this point it is reasonable to say that the idea of having a shared protocol and then making every desktop environment implement the entire display server was not a good one. The Linux community does not have enough manpower to make that work well.