summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* vdagent-x11: Unify / share error handling between vdagent-x11 and randr codeHans de Goede2013-04-093-34/+29
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent: Open file xfer save dir on file xfer completionHans de Goede2013-04-093-6/+32
| | | | | | | | | | When not saving to the Desktop we need a way for the user to discover where we've saved the file. This patch makes the session agent call xdg-open on the file xfer save dir when a file xfer has completed in this case. This is configurable from the cmdline by passing "-o 0" or "-o 1" Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent: Add a cmdline option to select where to save file-xfersHans de Goede2013-04-093-18/+38
| | | | | | | | | | The user can pass any arbitrary directory or the special values of "xdg-desktop" or "xdg-download" to select the default xdg Desktop resp xdg Download directories. If no value is specified the default is xdg-desktop when running under a Desktop Environment which has icons on the desktop and xdg-download on other Desktop Environments. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent-x11: Add a vdagent_x11_has_icons_on_desktop functionHans de Goede2013-04-092-0/+29
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent-x11: Add a vdagent_x11_get_wm_name functionHans de Goede2013-04-092-4/+84
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent-x11: Add set_error_handler / restore_error_handler helpersHans de Goede2013-04-091-2/+21
| | | | | | This is #if 0-ified for now, to avoid breaking compilation with -Werror. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* systemd-login: Fix supression of ENOENT errorsHans de Goede2013-03-291-1/+1
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfers: Don't warn if we cannot find a file-xferHans de Goede2013-03-291-1/+2
| | | | | | | | If we cancel a file-xfer from the agent side, it is normal that there still are some data packets belongen to this xfer in the pipe. So don't warn about it, instead make this a debug message. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent-virtio-port: Improve error loggingHans de Goede2013-03-151-2/+4
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent*: Handle VDAGENTD_CLIENT_DISCONNECTED messagesHans de Goede2013-03-064-11/+41
| | | | | | | | Also add some extra detection for the client having gone away for when running on an older spice-server which does not send VDAGENTD_CLIENT_DISCONNECTED on client disconnect. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagentd: Track which file-xfer id belongs to which session-agentHans de Goede2013-03-061-12/+61
| | | | | | | | So that file-xfers which are still on progress on user-switch keep working, and so that vdagentd can send the client a file-xfer cancel if the per-session vdagent goes away while a file-xfer is active. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfers: Fix unlinking of files on error / cancelHans de Goede2013-03-061-3/+3
| | | | | | | Store the complete path, rather then just the basename in task->file_name, so that unlinking on error actually works. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfers: Handle writing errorsHans de Goede2013-03-061-16/+18
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfers: Report status to sender (the client) on xfer completionHans de Goede2013-03-061-2/+7
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfers: Create dir before trying to create the fileHans de Goede2013-03-061-3/+12
| | | | | | This is necesarry to allow the client to send folder-hierarchies. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent-virtio-port: Add vdagent_virtio_port_reset()Hans de Goede2013-03-062-0/+11
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent-virtio-port: Fix use after freeHans de Goede2013-03-061-0/+2
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent: Don't try to reconnect when not daemonizedHans de Goede2013-03-061-1/+1
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfers: Check for duplicate task idsHans de Goede2013-02-221-0/+6
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfers: Don't overwrite existing filesHans de Goede2013-02-221-7/+23
| | | | | | Instead postfix " (x)" until we have a unique filename. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* filex-xfers s/GINT_TO_POINTER/GUINT_TO_POINTER/Hans de Goede2013-02-221-3/+3
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfers: s/new/task/Hans de Goede2013-02-221-13/+13
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfers: unlink the (partial) file on cancel / errorHans de Goede2013-02-221-8/+11
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfers: Improve debug loggingHans de Goede2013-02-223-34/+54
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfers: Prefix all log messages with "file-xfer"Hans de Goede2013-02-221-15/+24
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfers: Move file xfer code to its own fileHans de Goede2013-02-223-164/+272
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* file-xfer: Add file-xfer support for linux agentriegamaths@gmail.com2013-02-212-0/+216
| | | | | | The patch makes linux agent support file-xfer feature. Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
* file-xfer: extend protocol for communication between server and clientriegamaths@gmail.com2013-02-212-0/+6
| | | | | | The new added messages correspond with vd_agent.h Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
* randr: Use xrandr to get monitor info for uinput when using XrandrHans de Goede2013-02-043-8/+31
| | | | | | | | Unlike the comment this commit removes claims, the info is not the same. When the monitor settings are "sparse", ie monitor 1 and 3 are enabled, then Xinerama will report this as a continous range ie monitor 1 and 2 are enabled. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Refactor send_daemon_guest_xorg_res()Hans de Goede2013-02-041-14/+22
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagentd-uinput: Improve debug loggingHans de Goede2013-02-041-1/+11
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Ignored previously failed client monitor configsHans de Goede2013-01-303-0/+15
| | | | | | | | If a client window is maximized or fullscreen, and we fail to set the config, the client will keep resending the config (as a result of the attempted changes + rollback), sending us into a loop until the window gets unmaximized. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Add a config_size helper functionHans de Goede2013-01-301-2/+7
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Handle XRRSetScreenSize failing betterHans de Goede2013-01-303-5/+11
| | | | | | | | | | | | | | Usually XRRSetScreenSize failing simply means that we don't have enough video memory, out current handling of this has 2 issues: 1) It leaves things in an inconsistent state 2) It sets x11->set_crtc_config_not_functional causing any futher monitor configs send by the client to get ignored This patch fixes these issues by: 1) Rolling back all changes made when XRRSetScreenSize fails 2) Not setting x11->set_crtc_config_not_functional on XRRSetScreenSize failure Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Improve client monitor config sanity checkingHans de Goede2013-01-301-3/+2
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Move client mon-config cleanup to vdagent_x11_set_monitor_configHans de Goede2013-01-301-32/+26
| | | | | | | Where it logically belongs, thus turning same_monitor_configs into a function purely comparing monitor configs. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Add a get get_current_mon_config functionHans de Goede2013-01-301-55/+71
| | | | | | | | And use it in same_monitor_configs, this is a preparation patch for restoring the current settings when changing the settings fails due to having not enough video-memory. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagentd-xorg-conf: Don't warn when there are too few qxl devices (rhbz#895004)Hans de Goede2013-01-241-3/+0
| | | | | | | | | Since we now support more then 1 monitor / qxl device don't log a warning when there are more monitors then qxl-devs. Note the warning does still get written to the generated xorg.conf file, as that is intended for use with xinerama setups, and there we do have a limit of 1 monitor / device. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent-x11: Fix crash on vdagend restart (rhbz#894365)Hans de Goede2013-01-183-6/+10
| | | | | | | | | | | | vdagent_x11_destroy() cleans up clipboard state and will tell the client it is releasing the clipboard if it owns it. But when the vdagentd is restarted the unix socket is disconnected and x11->vdagentd points to already free-ed memory, leading to a crash. This patch fixes this by not trying to send messages to the client on cleanup when the unix socket is disconnected. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Add support for VD_AGENT_CAP_SPARSE_MONITORS_CONFIG (rhbz#881072)Hans de Goede2013-01-112-16/+40
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Make all sizes and coordinates signedHans de Goede2013-01-081-16/+16
| | | | | | | | | | | | Xrandr itself has monitor sizes and coordinates as signed, and so does most of our code, but not all of it. Making it all signed fixes a compiler warning, and allows us to properly deal with the client sending negative monitor coordinates. Note: Unfortunately this does require some pointer casts when dealing with the agent monitor-config message, as width and height are unsigned there :| Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagentd: Fix building warningDunrong Huang2013-01-081-4/+8
| | | | | | Move some variable declarations to right place. Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
* vdagent-x11-randr: Fix building warningDunrong Huang2013-01-081-6/+0
| | | | | | This patch can be safely applied since it just deletes unused variables. Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
* randr: Limit searching mode by size to the current outputHans de Goede2013-01-071-5/+6
| | | | | | | Otherwise we may end up using user-modes added for one output on another one, messing up mode-deletion. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Properly delete old mode in multi-monitor configsHans de Goede2013-01-072-4/+33
| | | | | | | | | | | Using x11->width and x11->height to delete the old mode is wrong, since this contains the total screen width and height, not the per monitor width and height. And we must not only delete the mode when replacing it with a new one, but also when disabling the output. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Use XRRGetScreenResourcesCurrent (rhbz#888821)Hans de Goede2013-01-071-9/+16
| | | | | | | | | | | | | | | | | | | | | Using XRRGetScreenResources, causes the X-server to actively check for new monitors, which generates Xrandr events even if nothing is changed, which causes gnome-setting-manager to muck with the settings, racing with the agent doing the same. XRRGetScreenResourcesCurrent OTOH simply returns the last known settings without any polling of the hardware and matching events being involved. So use XRRGetScreenResourcesCurrent instead of XRRGetScreenResources, with one exception. When the number of monitors is changed, so some outputs are enabled or disabled, then the hardware polling is necessary to properly reflect the connected / disconnected state in xrandr. This requires Xrandr >= 1.3, note that since 0.12.0 we already depended on >= 1.2 anyways, this patch raises the requirement to 1.3 and makes it explict. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Properly update things if the number of monitors changesHans de Goede2013-01-072-0/+7
| | | | | | | | If the number of monitors changes, and the remaining monitors are the same as before, then same_monitor_configs() would wrongly return true, causing monitor-reconfiguarion to be skipped. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Also compare screen width & height in same_monitor_configs()Hans de Goede2013-01-071-2/+7
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Call update_randr_res() from same_monitor_configs()Hans de Goede2013-01-071-1/+4
| | | | | | | This is necessary because the randr settings may have been changed underneath us (by gnome-settings-daemon for example). Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Move same_monitor_configs() call to after zero rooting the coordinatesHans de Goede2013-01-071-4/+4
| | | | | | | | If the client is sending non 0,0 rooted monitor coordinates these won't match what we've configured in the X-server if we check them before having called zero_base_monitors(). Signed-off-by: Hans de Goede <hdegoede@redhat.com>