Privacy Mode (Blacken the screen) #52

Closed
opened 2026-02-20 22:21:22 -05:00 by deekerman · 38 comments
Owner

Originally created by @rustdesk on GitHub (Jun 6, 2021).

Need your help, I have no idea how to implement it yet.

Originally created by @rustdesk on GitHub (Jun 6, 2021). Need your help, I have no idea how to implement it yet.
deekerman 2026-02-20 22:21:22 -05:00
Author
Owner

@vmfunc commented on GitHub (Jun 21, 2021):

You mean, clicking on a button to hide the screen ? But still keep the audio?
Sorry for bumping by the way

@vmfunc commented on GitHub (Jun 21, 2021): You mean, clicking on a button to hide the screen ? But still keep the audio? Sorry for bumping by the way
Author
Owner

@rustdesk commented on GitHub (Jun 21, 2021):

You mean, clicking on a button to hide the screen ? But still keep the audio?
Sorry for bumping by the way

Blacken the physical screen, but remote display still works

@rustdesk commented on GitHub (Jun 21, 2021): > You mean, clicking on a button to hide the screen ? But still keep the audio? > Sorry for bumping by the way Blacken the physical screen, but remote display still works
Author
Owner

@rustdesk commented on GitHub (Jun 21, 2021):

You mean, clicking on a button to hide the screen ? But still keep the audio?
Sorry for bumping by the way

Blacken the physical screen, but remote display still works

Need to write display card driver.

@rustdesk commented on GitHub (Jun 21, 2021): > > You mean, clicking on a button to hide the screen ? But still keep the audio? > > Sorry for bumping by the way > > Blacken the physical screen, but remote display still works Need to write display card driver.
Author
Owner

@rustdesk commented on GitHub (Jun 21, 2021):

https://www.wowza.com/community/t/blocking-screen-capture/38423/5

Actually blocking screen captures probably requires hooking into the video drivers to detect if anything else hooks into the video drivers.

@rustdesk commented on GitHub (Jun 21, 2021): https://www.wowza.com/community/t/blocking-screen-capture/38423/5 > Actually blocking screen captures probably requires hooking into the video drivers to detect if anything else hooks into the video drivers.
Author
Owner

@vmfunc commented on GitHub (Jun 21, 2021):

You mean, clicking on a button to hide the screen ? But still keep the audio?
Sorry for bumping by the way

Blacken the physical screen, but remote display still works

Need to write display card driver.

Oh I see ! But how will you re-enable it after ? If you want to enable it from the physical pc ? A keybind ?

@vmfunc commented on GitHub (Jun 21, 2021): > > > > > You mean, clicking on a button to hide the screen ? But still keep the audio? > > > Sorry for bumping by the way > > > > > > Blacken the physical screen, but remote display still works > > Need to write display card driver. Oh I see ! But how will you re-enable it after ? If you want to enable it from the physical pc ? A keybind ?
Author
Owner

@vmfunc commented on GitHub (Jun 21, 2021):

https://en.wikipedia.org/wiki/Hardware_overlay
Something like this ?

@vmfunc commented on GitHub (Jun 21, 2021): https://en.wikipedia.org/wiki/Hardware_overlay Something like this ?
Author
Owner

@rustdesk commented on GitHub (Jun 21, 2021):

https://en.wikipedia.org/wiki/Hardware_overlay
Something like this ?

Maybe, I am not sure if "hardware overlay window" affects remote display

@rustdesk commented on GitHub (Jun 21, 2021): > https://en.wikipedia.org/wiki/Hardware_overlay > Something like this ? Maybe, I am not sure if "hardware overlay window" affects remote display
Author
Owner

@rustdesk commented on GitHub (Jun 21, 2021):

re-enable

After connection closed

@rustdesk commented on GitHub (Jun 21, 2021): > re-enable After connection closed
Author
Owner

@vmfunc commented on GitHub (Jun 21, 2021):

After connection closed

Ok

Maybe, I am not sure if "hardware overlay window" affects remote display

I will try to learn more info about this ASAP

@vmfunc commented on GitHub (Jun 21, 2021): > After connection closed Ok > Maybe, I am not sure if "hardware overlay window" affects remote display I will try to learn more info about this ASAP
Author
Owner

@rustdesk commented on GitHub (Jun 21, 2021):

@geshii Thanks

@rustdesk commented on GitHub (Jun 21, 2021): @geshii Thanks
Author
Owner

@atomsos commented on GitHub (Oct 16, 2021):

Software 向日葵(https://sunlogin.oray.com/download/) and teamviewer has the function. It seems involving a driver hacking.

e.g.

@atomsos commented on GitHub (Oct 16, 2021): Software 向日葵(https://sunlogin.oray.com/download/) and teamviewer has the function. It seems involving a driver hacking. e.g. ![](https://pic2.zhimg.com/80/v2-bd0711fd67d0a9f9b5d0a7222b2ea1e9_720w.jpg) ![](https://pic3.zhimg.com/80/v2-9e93c9d17e8628af2033670856b2bb96_720w.jpg)
Author
Owner

@rustdesk commented on GitHub (Oct 17, 2021):

It seems involving a driver hacking.

any idea how to hack?

@rustdesk commented on GitHub (Oct 17, 2021): > It seems involving a driver hacking. > any idea how to hack?
Author
Owner

@rustdesk commented on GitHub (Nov 14, 2021):

toDesk: https://docs.todesk.com/zh-CN/privacyscreen

@rustdesk commented on GitHub (Nov 14, 2021): toDesk: https://docs.todesk.com/zh-CN/privacyscreen
Author
Owner

@Veiintc commented on GitHub (Feb 6, 2022):

toDesk: https://docs.todesk.com/zh-CN/privacyscreen

it seems use "Magnification.dll"(MagSetWindowFilterList) to Windows 8 or later

@Veiintc commented on GitHub (Feb 6, 2022): > toDesk: https://docs.todesk.com/zh-CN/privacyscreen it seems use "Magnification.dll"(MagSetWindowFilterList) to Windows 8 or later
Author
Owner

@rustdesk commented on GitHub (Feb 6, 2022):

MagSetWindowFilterList

@fufesou

@rustdesk commented on GitHub (Feb 6, 2022): > MagSetWindowFilterList @fufesou
Author
Owner

@fufesou commented on GitHub (Feb 6, 2022):

toDesk: https://docs.todesk.com/zh-CN/privacyscreen

it seems use "Magnification.dll"(MagSetWindowFilterList) to Windows 8 or later

Thank you. I'll learn that function.

@fufesou commented on GitHub (Feb 6, 2022): > > toDesk: https://docs.todesk.com/zh-CN/privacyscreen > > it seems use "Magnification.dll"(MagSetWindowFilterList) to Windows 8 or later Thank you. I'll learn that function.
Author
Owner

@zhangxaochen commented on GitHub (Nov 5, 2022):

is there a 'Privacy Mode' button when using the PC(win11) client? I'm using the latest version v1.1.9, but I dont find a button/option to toggle on this...
image

@zhangxaochen commented on GitHub (Nov 5, 2022): is there a 'Privacy Mode' button when using the PC(win11) client? I'm using the latest version v1.1.9, but I dont find a button/option to toggle on this... ![image](https://user-images.githubusercontent.com/3416677/200150310-f64fdcef-95c7-4d69-99d2-94f6a60e4433.png)
Author
Owner

@rustdesk commented on GitHub (Nov 8, 2022):

try out nightly build (Windows) on both side for privacy mode.

@rustdesk commented on GitHub (Nov 8, 2022): try out nightly build (Windows) on both side for privacy mode.
Author
Owner

@Tchiimy commented on GitHub (Dec 20, 2022):

try out nightly build (Windows) on both side for privacy mode.

Hello,

I'm a new user and I wanted to try the privacy mode so I installed the nightly build (windows) on both computers. But I don't see where can I can enable this option ? Is it actually available ?

@Tchiimy commented on GitHub (Dec 20, 2022): > try out nightly build (Windows) on both side for privacy mode. Hello, I'm a new user and I wanted to try the privacy mode so I installed the nightly build (windows) on both computers. But I don't see where can I can enable this option ? Is it actually available ?
Author
Owner

@fufesou commented on GitHub (Dec 20, 2022):

@Tchiimy
20221220231844

@fufesou commented on GitHub (Dec 20, 2022): @Tchiimy ![20221220231844](https://user-images.githubusercontent.com/13586388/208701520-fc3caee2-6de8-44c4-abbf-f10f5f4180b8.png)
Author
Owner

@Tchiimy commented on GitHub (Dec 20, 2022):

image

Hmmm it seems that I don't have this option available (tested with 2 nighly version of rustdesk in 2 computers, a dell with windows 10 and an asus with windows 11).

I suppose the problem might come from the difference windows 10 / 11 ?

What version do you use ? Did you installed some drivers on your computer ?

Edit : a recent test I did with the firewall deactivated for both computers :

  • Rustdesk Windows 11 --> Rustdesk Windows 10 (privacy mode possible and working)
  • Rustdesk W10 --> Rustdesk W11 (privacy mode not available/working, the W11 is not activated for the moment)

Do you have any ideas about this ?

@Tchiimy commented on GitHub (Dec 20, 2022): ![image](https://user-images.githubusercontent.com/75799578/208706182-6bc77a09-ff06-4795-975d-9d0340f78acc.png) Hmmm it seems that I don't have this option available (tested with 2 nighly version of rustdesk in 2 computers, a dell with windows 10 and an asus with windows 11). I suppose the problem might come from the difference windows 10 / 11 ? What version do you use ? Did you installed some drivers on your computer ? Edit : a recent test I did with the firewall deactivated for both computers : - Rustdesk Windows 11 --> Rustdesk Windows 10 (privacy mode possible and working) - Rustdesk W10 --> Rustdesk W11 (privacy mode not available/working, the W11 is not activated for the moment) Do you have any ideas about this ?
Author
Owner

@fufesou commented on GitHub (Dec 21, 2022):

@Tchiimy I've tested Win11, the provacy mode is supported.

Privacy mode need Magnification support. Maybe you have multiple screens. Or Magnification is not supported on you system (x86?). BTW, Magnification's api may be removed in the future. We'll consider another privacy mode implemetation.
github.com/rustdesk/rustdesk@7f006102b5/src/server/connection.rs (L768)
github.com/rustdesk/rustdesk@7f006102b5/src/server/video_service.rs (L76)
github.com/rustdesk/rustdesk@7f006102b5/libs/scrap/src/dxgi/mag.rs (L271)
github.com/rustdesk/rustdesk@7f006102b5/libs/scrap/src/dxgi/mag.rs (L130)

@fufesou commented on GitHub (Dec 21, 2022): @Tchiimy I've tested Win11, the provacy mode is supported. Privacy mode need [`Magnification`](https://learn.microsoft.com/en-us/previous-versions/windows/desktop/magapi/entry-magapi-sdk) support. Maybe you have multiple screens. Or Magnification is not supported on you system (x86?). BTW, Magnification's api may be removed in the future. We'll consider another privacy mode implemetation. https://github.com/rustdesk/rustdesk/blob/7f006102b5a018575cc3fc1a9c0e458dbb8a8993/src/server/connection.rs#L768 https://github.com/rustdesk/rustdesk/blob/7f006102b5a018575cc3fc1a9c0e458dbb8a8993/src/server/video_service.rs#L76 https://github.com/rustdesk/rustdesk/blob/7f006102b5a018575cc3fc1a9c0e458dbb8a8993/libs/scrap/src/dxgi/mag.rs#L271 https://github.com/rustdesk/rustdesk/blob/7f006102b5a018575cc3fc1a9c0e458dbb8a8993/libs/scrap/src/dxgi/mag.rs#L130
Author
Owner

@Tchiimy commented on GitHub (Dec 21, 2022):

@Tchiimy I've tested Win11, the provacy mode is supported.

I don't know if it's linked but activating the license of W11 seems to have resolved the problem thanks !

@Tchiimy commented on GitHub (Dec 21, 2022): > @Tchiimy I've tested Win11, the provacy mode is supported. I don't know if it's linked but activating the license of W11 seems to have resolved the problem thanks !
Author
Owner

@Zhang-0952 commented on GitHub (Jan 16, 2023):

所有终端都有这个隐私屏选项么?
Do all terminals have this privacy screen option?

@Zhang-0952 commented on GitHub (Jan 16, 2023): 所有终端都有这个隐私屏选项么? Do all terminals have this privacy screen option?
Author
Owner

@fufesou commented on GitHub (Jan 20, 2023):

Do all terminals have this privacy screen option?

@Zhang-0952 The remote side should be at lease Win10.

@fufesou commented on GitHub (Jan 20, 2023): > Do all terminals have this privacy screen option? @Zhang-0952 The remote side should be at lease Win10.
Author
Owner

@rustdesk commented on GitHub (Mar 28, 2023):

Some point about this for android (borrowed from srccpy, not sure if depends on adb) https://github.com/rustdesk/rustdesk/pull/3815

@rustdesk commented on GitHub (Mar 28, 2023): Some point about this for android (borrowed from srccpy, not sure if depends on adb) https://github.com/rustdesk/rustdesk/pull/3815
Author
Owner

@sabxp commented on GitHub (Mar 30, 2023):

Some point about this for android (borrowed from srccpy, not sure if depends on adb) #3815

It's not depending on adb, it's java code from API setDisplayPowerMode():

import android.os.Build;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
public class DisplayToggle {

    private static final Class<?> CLASS;
	static {
        	try {
            		CLASS = Class.forName("android.view.SurfaceControl");
		} catch (ClassNotFoundException e) {
        	throw new AssertionError(e);
     	 }
    }

    public static void main(String... args) throws Exception {
	System.out.print("Display mode: "+args[0]);
	Method method = CLASS.getMethod("setDisplayPowerMode", IBinder.class, int.class);
	try {
            method.invoke(null, getBuiltInDisplay(),Integer.parseInt(args[0]));
        } catch (InvocationTargetException | IllegalAccessException e) {
	    e.printStackTrace();
        }
    }

    private static Method getGetBuiltInDisplayMethod() throws NoSuchMethodException {
       Method getBuiltInDisplayMethod;
            // the method signature has changed in Android Q
            // <https://github.com/Genymobile/scrcpy/issues/586>
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
                getBuiltInDisplayMethod = CLASS.getMethod("getBuiltInDisplay", int.class);
            } else {
                getBuiltInDisplayMethod = CLASS.getMethod("getInternalDisplayToken");
            }
        return getBuiltInDisplayMethod;
    }

    public static IBinder getBuiltInDisplay() {
        try {
            Method method = getGetBuiltInDisplayMethod();
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
                // call getBuiltInDisplay(0)
                return (IBinder) method.invoke(null, 0);
            }
            // call getInternalDisplayToken()
            return (IBinder) method.invoke(null);
           } catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException e) {
            e.printStackTrace();
            return null;
        }
    }
}

passing the display mode as the argument - 0 for screen off and 2 for screen on

@sabxp commented on GitHub (Mar 30, 2023): > Some point about this for android (borrowed from srccpy, not sure if depends on adb) #3815 It's not depending on adb, it's java code from API setDisplayPowerMode(): ``` import android.os.Build; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; public class DisplayToggle { private static final Class<?> CLASS; static { try { CLASS = Class.forName("android.view.SurfaceControl"); } catch (ClassNotFoundException e) { throw new AssertionError(e); } } public static void main(String... args) throws Exception { System.out.print("Display mode: "+args[0]); Method method = CLASS.getMethod("setDisplayPowerMode", IBinder.class, int.class); try { method.invoke(null, getBuiltInDisplay(),Integer.parseInt(args[0])); } catch (InvocationTargetException | IllegalAccessException e) { e.printStackTrace(); } } private static Method getGetBuiltInDisplayMethod() throws NoSuchMethodException { Method getBuiltInDisplayMethod; // the method signature has changed in Android Q // <https://github.com/Genymobile/scrcpy/issues/586> if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { getBuiltInDisplayMethod = CLASS.getMethod("getBuiltInDisplay", int.class); } else { getBuiltInDisplayMethod = CLASS.getMethod("getInternalDisplayToken"); } return getBuiltInDisplayMethod; } public static IBinder getBuiltInDisplay() { try { Method method = getGetBuiltInDisplayMethod(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { // call getBuiltInDisplay(0) return (IBinder) method.invoke(null, 0); } // call getInternalDisplayToken() return (IBinder) method.invoke(null); } catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException e) { e.printStackTrace(); return null; } } } ``` passing the display mode as the argument - 0 for screen off and 2 for screen on
Author
Owner

@Karbust commented on GitHub (May 24, 2023):

Privacy Mode is not working when connecting from Windows 11 to Windows 10 when using the portable executable.

I haven't tested with the full installation as I don't have admin permissions.

Do I need to make any changes on the remote computer (Windows 10)?

I also tried enabling "RDP Session Sharing", also didn't work.

From iPhone (iOS 16.5) to Windows 10 it works.

@Karbust commented on GitHub (May 24, 2023): Privacy Mode is not working when connecting from Windows 11 to Windows 10 when using the portable executable. I haven't tested with the full installation as I don't have admin permissions. Do I need to make any changes on the remote computer (Windows 10)? I also tried enabling "RDP Session Sharing", also didn't work. From iPhone (iOS 16.5) to Windows 10 it works.
Author
Owner

@fufesou commented on GitHub (May 24, 2023):

Do I need to make any changes on the remote computer (Windows 10)?

No. It's where we don't do well enough.

PR 4473 will enable privacy mode on the portable version.

@fufesou commented on GitHub (May 24, 2023): > Do I need to make any changes on the remote computer (Windows 10)? No. It's where we don't do well enough. PR 4473 will enable privacy mode on the portable version.
Author
Owner

@Karbust commented on GitHub (May 24, 2023):

Do I need to make any changes on the remote computer (Windows 10)?

No. It's where we don't do well enough.

PR 4473 will enable privacy mode on the portable version.

After trying the Nightly version, the option shows up, so I guess it wasn't needed any changes.

I'm assuming it works, I haven't tried being next to the computer... (from iPhone it works, that I already tried)

@Karbust commented on GitHub (May 24, 2023): > > Do I need to make any changes on the remote computer (Windows 10)? > > No. It's where we don't do well enough. > > PR 4473 will enable privacy mode on the portable version. After trying the Nightly version, the option shows up, so I guess it wasn't needed any changes. I'm assuming it works, I haven't tried being next to the computer... (from iPhone it works, that I already tried)
Author
Owner

@fufesou commented on GitHub (May 24, 2023):

from iPhone it works, that I already tried

Do you mean the Privacy mode works on iPhone -> Windows portable?
I'm confused. But it should not work before PR 4473.

@fufesou commented on GitHub (May 24, 2023): > from iPhone it works, that I already tried Do you mean the Privacy mode works on iPhone -> Windows portable? I'm confused. But it should not work before PR 4473.
Author
Owner

@Karbust commented on GitHub (May 24, 2023):

from iPhone it works, that I already tried

Do you mean the Privacy mode works on iPhone -> Windows portable? I'm confused. But it should not work before PR 4473.

On both the host and the client I'm running the nightly version: rustdesk-1.2.0-x86_64.exe
https://github.com/rustdesk/rustdesk/releases/tag/nightly

The iPhone worked without any issues on the desktop running the nightly version.

Running the same version on the host and client computers, the client is running in Portable, the host is installed.

image

@Karbust commented on GitHub (May 24, 2023): > > from iPhone it works, that I already tried > > Do you mean the Privacy mode works on iPhone -> Windows portable? I'm confused. But it should not work before PR 4473. On both the host and the client I'm running the nightly version: [rustdesk-1.2.0-x86_64.exe](https://github.com/rustdesk/rustdesk/releases/download/nightly/rustdesk-1.2.0-x86_64.exe) https://github.com/rustdesk/rustdesk/releases/tag/nightly The iPhone worked without any issues on the desktop running the nightly version. Running the same version on the host and client computers, the client is running in Portable, the host is installed. ![image](https://github.com/rustdesk/rustdesk/assets/20361229/0d735869-44b5-4c14-92e2-05b55fdddcee)
Author
Owner

@fufesou commented on GitHub (May 24, 2023):

It is the controlled side that causes the failing.

The installed version has this file, while the portable version does not have this file.

image

@fufesou commented on GitHub (May 24, 2023): It is the controlled side that causes the failing. The installed version has this file, while the portable version does not have this file. ![image](https://github.com/rustdesk/rustdesk/assets/13586388/7c91a97c-3325-4e43-9840-8b0538726791)
Author
Owner

@Karbust commented on GitHub (May 24, 2023):

It is the controlled side that causes the failing.

The installed version has this file, while the portable version does not have this file.

image

But the Privacy Mode is working on Nightly, and I'm connecting to the host using the Portable. (both computers using Nightly, host is using the installed version).

Not entirely sure what your changes on #4473 are for, I don't know Rust, but so far it's working.

@Karbust commented on GitHub (May 24, 2023): > It is the controlled side that causes the failing. > > The installed version has this file, while the portable version does not have this file. > > ![image](https://user-images.githubusercontent.com/13586388/240633471-7c91a97c-3325-4e43-9840-8b0538726791.png) But the Privacy Mode is working on Nightly, and I'm connecting to the host using the Portable. (both computers using Nightly, host is using the installed version). Not entirely sure what your changes on #4473 are for, I don't know Rust, but so far it's working.
Author
Owner

@cxtem commented on GitHub (Jun 29, 2023):

do you have any solution that leaves the android screen black in privacy mode, do I need my clients android to dim while I do support ??

@cxtem commented on GitHub (Jun 29, 2023): do you have any solution that leaves the android screen black in privacy mode, do I need my clients android to dim while I do support ??
Author
Owner

@cxtem commented on GitHub (Jun 29, 2023):

tell me whatsapp +551195928027

@cxtem commented on GitHub (Jun 29, 2023): tell me whatsapp +551195928027
Author
Owner

@hooligans44 commented on GitHub (Sep 29, 2023):

You mean, clicking on a button to hide the screen ? But still keep the audio? Sorry for bumping by the way

Its called curtain mode.

@hooligans44 commented on GitHub (Sep 29, 2023): > You mean, clicking on a button to hide the screen ? But still keep the audio? Sorry for bumping by the way Its called curtain mode.
Author
Owner

@bartquant commented on GitHub (Mar 31, 2025):

@hooligans44 can you explain more? I have enabled privacy mode on the android and macos application but it keeps the screen on.

@bartquant commented on GitHub (Mar 31, 2025): @hooligans44 can you explain more? I have enabled privacy mode on the android and macos application but it keeps the screen on.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rustdesk-rustdesk#52
No description provided.