summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* Prepare for 0.12.1 releasespice-vdagent-0.12.1Hans de Goede2013-01-081-1/+1
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Buildsys: Add default CFLAGS to be used when no CFLAGS are specifiedHans de Goede2013-01-081-0/+15
| | | | 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-073-10/+23
| | | | | | | | | | | | | | | | | | | | | 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>
* randr: Round x monitor coordinates to a multiple of 8Hans de Goede2013-01-071-0/+4
| | | | | | | | | | | | | | | | | We already do this when comparing new received monitor settings from the client with the current ones, since the X-server rounds the width / x coordinates to a multiple of 8 when we set them. Currently what happens is: 1) We get a monitor-config with a non multiple 8 width 2) We set the crtc to this width 3) We set the screen to this width 4) We configure the uinput tablet with this width 5) The X-server adjusts things to a multiple of 8 6) We re-configure the uinput tablet with the new width By rounding the width and x coordinates before applying them we safe all this back and forth to the X-server. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* randr: Add some more debugging messagesHans de Goede2013-01-071-2/+14
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagentd: send monitors config to currently active agent onlyHans de Goede2012-11-261-10/+9
|
* randr: do not set crtc mode to NULL when changing resolutionMarc-André Lureau2012-11-261-24/+29
| | | | | | | | | | | | | | | | | The agent creates a unique mode vdagent-N per output, that is deleted when the custom resolution is changed. In order to be deleted, it can't be the current active crtc config. Now, the vdagent just sets the mode to NULL, but that causes a change of resolution probably due to gnome-settings-daemon (in RHEL6, it switches to max resultion 2560x1600 before switching back to custom resolution). We can avoid deleting current mode by creating a different mode, switching to it, and then deleting the previous mode. Also, we can ignore some Create/Delete races with other XRandR clients that may modify the mode simultaneously. This shouldn't be fatal, as long as the rest of the resolution switching can take place.
* make a few functions staticMarc-André Lureau2012-11-261-4/+4
|
* Add a proper copyright header to src/vdagent-x11-randr.cHans de Goede2012-11-191-0/+23
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Fix running on a vm with multiple qxl devs without Xinerama (rhbz#855110)Hans de Goede2012-10-101-4/+9
| | | | | | | | In this case the client will always send info for qxl-devs monitors, and set unused monitors to 0x0, deal properly with this, otherwise the mouse ends up confused. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* x11-randr: Fix setting of mode on non arbitrary resolution capable X driverHans de Goede2012-10-101-9/+19
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Prepare for 0.12.0 releasespice-vdagent-0.12.0Hans de Goede2012-09-013-2/+11
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Only install modules-load.d and tmpfiles.d files when using the systemd serviceHans de Goede2012-09-011-6/+7
| | | | | | Both these files are more or less systemd specific. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Makefile.am: Add a bunch of missing files for "make dist"Hans de Goede2012-09-011-0/+4
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Fix various compiler warningsHans de Goede2012-09-012-54/+23
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* x11-randr: Make "delete_mode of in use mode" a debug messageHans de Goede2012-09-011-1/+1
| | | | | | This is a normal thing to happen, so it should not be an error message. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent-x11-randr: Get rid of the_mode variableHans de Goede2012-08-271-7/+3
| | | | | | | | delete_mode() sets a the_mode variable, but then in the actual following XRR calls uses mode->id, not the_mode->id, which works since they are the same. As they are the same anyway, lets just get rid of the_mode completely. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Set systemd service file type to forkingHans de Goede2012-08-271-0/+1
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Use hardware activation for systemd serviceHans de Goede2012-08-264-5/+9
| | | | | | | Make the systemd service trigger on the addition of /dev/virtio-ports/com.redhat.spice.0 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Add rsyslog config file to put spice-vdagent logs into their own fileHans de Goede2012-08-242-1/+6
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Install tmpfiles.d file in $prefix/lib/tmpfiles.d (rhbz#840194)Hans de Goede2012-08-241-1/+1
| | | | | | /etc/tmpfiles.d is reserved for local customization. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Add --with-init-script with systemd supportMarc-André Lureau2012-08-242-4/+63
|
* Add systemd scriptsMarc-André Lureau2012-08-243-2/+31
|
* repo: move to tmpfiles.d/spice-vdagentd.confMarc-André Lureau2012-08-242-1/+1
| | | | There are other spice-vdagentd.conf files coming.
* Replace file-logging with syslogHans de Goede2012-08-2417-421/+321
| | | | | | | | This resolves: http://bugzilla.redhat.com/show_bug.cgi?id=747894 http://bugzilla.freedesktop.org/show_bug.cgi?id=49092 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* vdagent-x11-randr: Don't discard events on XSyncHans de Goede2012-08-231-1/+1
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Disable extra monitorsMarc-André Lureau2012-07-081-0/+22
|
* Close monitor position configuration by %8 are sameMarc-André Lureau2012-07-061-1/+1
| | | | Avoids some extra reconfiguration with the client.
* Do not set crtc config to 0Marc-André Lureau2012-07-061-24/+10
| | | | | | I presume the reason to disable Crtc was to pass some XRandr check that all crtc can fit in the screen. However, it is not a requirement if the driver handles it.