How to show cursor shape changes with libvncclient? - c++

I am developing a multi-viewer VNC client using libvncclient (part of libvncserver) and Qt. It's been a little challenging but I finally have the app working fairly well, except that it will not show cursor shape changes from the server. I would like to overcome this issue so I can share this software project with the world, as I do with most of my other projects.
I have tried this to make libvncclient show cursor shape changes:
client->appData.useRemoteCursor = false;
and that doesn't show cursor changes in the framebuffer. Next, I tried handling the cursor changes myself, using:
client->appData.useRemoteCursor = true;
client->GotCursorShape = got_cursor_shape_change;
and while the got_cursor_shape_change callback would be called when a cursor shape change happened on the server, the buffer for the cursor image, rcSource, and the buffer for the cursor mask, rcMask, were not valid images.
I have done searches on the internet for help on this problem but resources besides the official documentation are pretty slim. I contacted the developers about this issue, but they say that what I've tried should work.
EDIT: Also, other viewers, such as TightVNC, TigerVNC, gtk-vnc, etc are all displaying the cursor shape changes from the server, so I know it's sending the changes properly.
Does anyone have any clues as to what I should try?
Thank you in advance. :-)

This is resolved.
The problem was that a very old version of TightVNC (2.0.x) was installed on the remote machine I was testing with. Once updated (to 2.7.x), the remote machine's cursor is visible and shape changes happen in my viewer. The following is what is working:
client->appData.useRemoteCursor = false;

Related

python / Photoshop foreground color changing

i have very basic knowledge base in python, and i am working on a project to interact with Photoshop.
i managed to do most what i want expect a last issue
as my program is continuously reading from Photoshop (foreground colour) and writing to Photoshop the same hing. my issue is when the program is busy and not ready to accept data such as when a dialog window is open, python try to send data and fail and stop the application
i am using python 2.7 and following some of the codes I am using
I guess I need to check the port if it is ready before sending anything
psApp = win32com.client.Dispatch("Photoshop.Application")
psApp.foregroundColor = solidcolor #to send the new data to Photoshop
thanks
Many thanks to all who tried to help me with this issue...
I managed to solve it buy using try, except ... also I figured it out that the break was happens to the timer that apply the values not to the protocol itself
many thanks again

DroneKit mission not sent to drone

I'm trying to create simple mission using Drone-Kit android.
Mission myMission = new Mission();
myMission.clear();
Takeoff to = new Takeoff();
ReturnToLaunch rtl = new ReturnToLaunch();
//set Altitude in meters
rtl.setReturnAltitude(2);
to.setTakeoffAltitude(2);
myMission.addMissionItem(to);
myMission.addMissionItem(rtl);
MissionApi.getApi(this.drone).setMission(myMission,true);
The problem is that sometimes it works, and sometimes it's doesn't...
I don't know why it not working... I'm not getting any errors in the code.
I'm listening to the
AttributeEvent.MISSION_UPDATED
AttributeEvent.MISSION_SENT
AttributeEvent.MISSION_RECEIVED
but only the AttributeEvent.MISSION_UPDATED is fired when I run the code.
And even if its fired, this doesn't mean that the mission updated correctly.
I'm checking the mission with Mission Planer.
I just don't understand why it is working sometimes and sometimes not.
I did make sure that the drone connected to the app.
Also I made sure that the drone is OK and arm-able.
I really stuck here... and any help will be appreciated.
I have not tried dronekit-android before but I think it is better to open an issue here.
The source code for android project has not been updated for more than two years!
In general,there is a protocol to upload/download a mission. It is not easy to implement but you can implement it. I did that in c++. You should always check the acknowledgment from the drone before going in the next step. Check the protocol here.
I will answer my question, in case someone have the same problem.
I have contacted the developers, and it seems that I'm not the only one who have this BUG.
It seems that when you add ReturnToLaunch to Mission something happening in the API and the mission is not sent to the drone. As soon as I removed ReturnToLaunch object from the Mission all worked properly.
Work-Around: To overcome the issue, I am putting the drone in RTL mode, when the Mission is done.

X11 - Blank out the screen

I am currently using a remote software to access a computer of mine. The problem is now: I dont want anyone to see what I am doing, so I am trying to write a little tool or script that will blank out the screen.
The software is accessing the picture data using the MIT-SHM extension of X11, so I seek a possiblity to keep X11 rendering the data into the SHM, but simply not forward it to the Monitor (as if the monitor is turned off). Is there any way? As a last resort I would use XVFB, but I would rather not...
P.S.: I am seeking a programmatic attempt. Either via BASH script or C/C++.
x11vnc has options like -clientdpms, -forcedpms.
What they essentially do is - to call dpms commands to blank out display, every time there is a mouse/keyboard action. So, the monitor is unblanked & blanked again. This is not really visible to eyes, because of the hysteresis of the monitor.
NOW, if you have access to that proprietary software's code, you can add a code to blank using dpms commands, after every kbd/mouse event.
Alternately, you can use a dirty hack to keep x11vnc -forcedpms -forever -allow 127.0.0.1 -clip 1x1+0+0 running in the background.

Black frames when using easyrtc with socket.io

we use EasyRTC for sending image captures from iPad (we create screenshots "manually" and send them via socket.io) to web browser. On the server we have EasyRTC v.1.0.12 and Socket.IO v.0.9.16. It's hard to say what happened (i've just joined the project and encountered this issue. PM says that it was ok some time ago) but recently we started to notice that some frames are blacked-out. We are debugging this issue for few days and we're running out of ideas. We are not sure where the problem is.
We now that we send correct images from the device. We noticed that it happens only when the image is different from previous one (but not always... it's easier to observe it on the weaker internet connection). When the image is "repeated" (i mean it looks the same but from iPad perspective we create it as new instance) everything is fine.
In attachment you can find info from Chrome network debugger. As you can see in thumbnails or images are ok. These with Size/Content from cache are ok but there with Size 0 and Content > 0 are ones which gives black screens when we want to draw them on the canvas.
Any idea what we're doing wrong? How to debug it? It seems that images are somehow downloaded later than we try to draw them?
Our server is on AWS.
You are trying to send the images up as base 64 encoded jpegs. Basically big text strings. The first thing you should be asking yourself is: is the text string I'm sending up getting to the server, or is it getting truncated? Check the length of the string being sent versus the length of the string being sent, and then check the start and ends of the string.
Finally we found the solution which is pretty easy. It turned out that we was trying to draw an image before it was fully loaded. So what we did was to move drawing code to image.onLoad method and now it works as expected.
img.src = "data:image/png;base64, <img content>";
img.onload = function(){
canvas.drawImage(img);
}

GDK picture intent gets stuck on Tap to accept

Today the picture function on my Glass app stopped working. It was fine yesterday, but now it gets stuck on the Tap to Accept Picture. I think it may have something to do with the new (to me at least) way it handles pictures as well as the viewfinder. What I can find on the glass developers site is deprecated and doesn't work. My hope/belief is that the new idea is for the intent to go to the viewfinder and then take the picture. I'd prefer to still use the glass method, but I am aware of the android API camera method. Here's the code
startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE), REQUEST_PIC);
and in onActivityResult
switch(requestCode)
{
case REQUEST_PIC:
String picturePath = data.getStringExtra(Intents.EXTRA_PICTURE_FILE_PATH);
processPictureWhenReady(picturePath);
break;
}
I have got the same problem since upgraded to XE18.3. Instead of spending time to look for a workaround, I've implemented the preview mode with SurfaceView. You could access the camera directly with Camera.Open(), the sample codes can be found at: (search for "camerasample.zip" in the page)
https://code.google.com/p/google-glass-api/issues/detail?id=351
Hope this helps.
This is a problem being experienced after the XE18.3 update. It has been logged in the google-glass-api issue tracker here.
You can try downgrading the firmware as mentioned in the comments, but be sure to note that doing that voids your warranty.
I have the same issue happening to me as well, however if you plug Glass into your computer that is running Eclipse and the adb is running the Intent will complete successfully. This is not a solution but hopefully it'll keep you from getting behind in work until there is an answer available.