LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-23-2012, 01:18 AM   #1
Vinay L
LQ Newbie
 
Registered: Jun 2012
Posts: 6

Rep: Reputation: Disabled
How to detect real desktop and remotely accessed(screen shared) desktop?


Hi All,

On Mac Os the Screen Sharing feature is similar to Remote Desktop Service. Is there a way to determine whether the terminal where we are starting the application(our own application) is real desktop or remotely accessed (screen shared) desktop?

For Ex:

I have booted(logged in) the Mac A sytem with user1 account. From another Mac B machine, i will login to user2 account of Mac A sytem using Screen sharing feature. My application has to run only on real desktop, not on remotely accessed desktop(screen shared). So Is there a way(programmatically) to determine whether the terminal where I am starting the application is real desktop or remotely accessed (screen shared) desktop?

Thanks & Regards,
Vinay
 
Old 08-23-2012, 08:59 AM   #2
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
every process has parent id - try checking for parent id for given child process id .
 
Old 08-24-2012, 12:03 PM   #3
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
But the program runs always local on Mac A. And although you “connect” as user2, you get the output of the currently logged in user1.

So, you just want to detect whether anyone connected at all using screen sharing?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remotely access Kubuntu (Ubuntu Server with KDE Desktop) with windows Remote Desktop brunellehomenet Linux - Newbie 3 10-21-2012 09:20 AM
LXer: The MATE desktop brings back the power of a real desktop environment. LXer Syndicated Linux News 0 03-27-2012 07:20 AM
Easy Peasy file in desktop folder does not show in screen desktop Robertson Tay Linux - Laptop and Netbook 4 07-07-2011 09:45 AM
ubuntu-desktop vs. kubuntu-desktop vs. xubuntu-desktop vs. lubuntu-desktop vs. unity Kenny_Strawn Ubuntu 18 05-13-2011 09:20 AM
VNC client window as a virtual desktop to the left of my real screen cram869 Linux - Desktop 2 08-07-2009 08:42 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration