Changeset 27601 in vbox
- Timestamp:
- Mar 22, 2010 4:22:13 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions
- Files:
-
- 1 deleted
- 7 edited
-
freebsd/Makefile.kmk (modified) (1 diff)
-
linux/Makefile.kmk (modified) (2 diffs)
-
linux/installer/vboxadd-x11.sh (modified) (5 diffs)
-
solaris/Makefile.kmk (modified) (7 diffs)
-
x11/Installer/98vboxadd-xclient (modified) (1 diff)
-
x11/Installer/VBoxRandR.sh (deleted)
-
x11/VBoxClient/Makefile.kmk (modified) (1 diff)
-
x11/VBoxClient/display.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/freebsd/Makefile.kmk
r25592 r27601 135 135 fbsd_add_inst-nobin_MODE = a+r,u+w 136 136 fbsd_add_inst-nobin_SOURCES = \ 137 ../x11/Installer/VBoxRandR.sh \138 137 ../x11/Installer/98vboxadd-xclient \ 139 138 ../x11/Installer/vboxclient.desktop \ -
trunk/src/VBox/Additions/linux/Makefile.kmk
r26551 r27601 110 110 111 111 VBOX_ADD_BIN.linux += \ 112 VBoxClient-all \ 113 VBoxRandR 112 VBoxClient-all 114 113 115 114 VBOX_ADD_STRIP_SBIN += \ … … 375 374 LnxAdd-Nostrip-Bin_MODE = a+rx,u+w 376 375 LnxAdd-Nostrip-Bin_SOURCES = \ 377 $(VBOX_REL_X11_ADD_INST)VBoxRandR.sh=>VBoxRandR \378 376 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient=>VBoxClient-all 379 377 -
trunk/src/VBox/Additions/linux/installer/vboxadd-x11.sh
r27507 r27601 297 297 nopsaux="--nopsaux" 298 298 test -c /dev/psaux && nopsaux="" 299 # And on newer servers, we want to test whether dynamic resizing will work300 testrandr="true"301 299 # The video driver to install for X.Org 6.9+ 302 300 vboxvideo_src= … … 378 376 vboxmouse_src=vboxmouse_drv_71.so 379 377 automouse="" 380 testrandr=""381 378 ;; 382 379 6.9.* | 7.0.* ) … … 385 382 vboxmouse_src=vboxmouse_drv_70.so 386 383 automouse="" 387 testrandr=""388 384 ;; 389 385 6.7* | 6.8.* | 4.2.* | 4.3.* ) … … 395 391 ln -s "$lib_dir/vboxmouse_drv.o" "$modules_dir/input/vboxmouse_drv.o" 396 392 automouse="" 397 testrandr=""398 393 succ_msg 399 394 ;; … … 410 405 ln -s "$lib_dir/$vboxmouse_src" "$modules_dir/input/vboxmouse_drv.so" && 411 406 succ_msg 412 fi413 if test -n "$testrandr"; then414 # Run VBoxRandR in test mode as it prints out useful information if415 # dynamic resizing can't be used. Don't fail here though.416 /usr/bin/VBoxRandR --test 1>&2417 else418 cat << EOF419 420 You appear to be running an older version of the X Window system in your421 guest. Seamless mode and dynamic resizing will not work!422 423 EOF424 407 fi 425 408 -
trunk/src/VBox/Additions/solaris/Makefile.kmk
r26641 r27601 111 111 $(VBOX_PATH_X11_ADDITION_INSTALLER)/x11config15sol.pl \ 112 112 $(VBOX_PATH_X11_ADDITION_INSTALLER)/x11restore.pl \ 113 $(VBOX_PATH_X11_ADDITION_INSTALLER)/VBoxRandR.sh \114 113 $(VBOX_PATH_X11_ADDITION_INSTALLER)/98vboxadd-xclient=>1099.vboxclient \ 115 114 $(VBOX_PATH_X11_ADDITION_INSTALLER)/solaris_xorg.conf \ … … 191 190 x11config15sol.pl \ 192 191 x11restore.pl \ 193 VBoxRandR.sh \194 192 VBox.sh \ 195 193 1099.vboxclient \ … … 266 264 $(VBOX_PATH_X11_ADDITION_INSTALLER)/solaris_xorg.conf \ 267 265 $(VBOX_PATH_X11_ADDITION_INSTALLER)/solaris_xorg_modeless.conf \ 268 $(VBOX_PATH_X11_ADDITION_INSTALLER)/VBoxRandR.sh \269 266 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \ 270 267 $(PATH_ROOT)/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.conf \ … … 289 286 $(call MSG_L1,Creating install package: $@) 290 287 $(QUIET)$(MKDIR) -p $(SOLARIS_ADD_ETCFS_DIR) 291 $(QUIET)$(LN_SYMLINK) -f ../..$(SOLARIS_VBOXADDINST_SUBDIR)/VBoxRandR.sh $(SOLARIS_ADD_USRBIN_DIR)/VBoxRandR292 288 $(QUIET)$(LN_SYMLINK) -f ../..$(SOLARIS_VBOXADDINST_SUBDIR)/1099.vboxclient $(SOLARIS_ADD_USRBIN_DIR)/VBoxClient-all 293 289 ifdef VBOX_WITH_COMBINED_SOLARIS_GUEST_PACKAGE … … 382 378 383 379 # 384 # Symlinks from /usr/bin/ to /opt/VirtualBoxAdditions (some like VBoxRandR created manually)380 # Symlinks from /usr/bin/ to /opt/VirtualBoxAdditions 385 381 # 386 382 $(addprefix $(SOLARIS_ADD_USRBIN_DIR)/,$(SOLARIS_ADD_USRBIN_LINKS)): \ … … 512 508 $(VBOX_PATH_X11_ADDITION_INSTALLER)/solaris_xorg_modeless.conf \ 513 509 $(VBOX_SOLPACKFILES) \ 514 $(VBOX_PATH_X11_ADDITION_INSTALLER)/VBoxRandR.sh \515 510 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \ 516 511 $(PATH_ROOT)/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.conf \ … … 547 542 $(QUIET)$(INSTALL) -m 0644 $(VBOX_PATH_X11_ADDITION_INSTALLER)/solaris_xorg.conf $(SOLARIS_ADD_INST_DIR)/solaris_xorg.conf 548 543 $(QUIET)$(INSTALL) -m 0644 $(VBOX_PATH_X11_ADDITION_INSTALLER)/solaris_xorg_modeless.conf $(SOLARIS_ADD_INST_DIR)/solaris_xorg_modeless.conf 549 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_X11_ADDITION_INSTALLER)/VBoxRandR.sh $(SOLARIS_ADD_INST_DIR)/VBoxRandR.sh550 544 $(QUIET)$(INSTALL) -m 0644 $(PATH_ROOT)/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.conf $(SOLARIS_ADD_INST_DIR)/vboxguest.conf 551 545 ifdef VBOX_WITH_COMBINED_SOLARIS_GUEST_PACKAGE -
trunk/src/VBox/Additions/x11/Installer/98vboxadd-xclient
r23941 r27601 27 27 done 28 28 29 # Check whether the display we are running on running a known buggy version 30 # of X.Org which might crash when we resize. 31 no_display= 32 xorgbin=Xorg 33 found=`which Xorg | grep "no Xorg"` 34 if test ! -z "$found"; then 35 if test -f "/usr/X11/bin/Xorg"; then 36 xorgbin=/usr/X11/bin/Xorg 37 else 38 exit 1 39 fi 40 fi 41 xout=`$xorgbin -version 2>&1` 42 if echo "$xout" | grep "1\.4\.99\.90[12345]" > /dev/null 43 then 44 no_display=1 45 fi 46 29 47 /usr/bin/VBoxClient --clipboard 30 48 /usr/bin/VBoxClient --checkhostversion 31 /usr/bin/VBoxClient --display 49 test -z "$no_display" && 50 /usr/bin/VBoxClient --display 32 51 /usr/bin/VBoxClient --seamless -
trunk/src/VBox/Additions/x11/VBoxClient/Makefile.kmk
r25473 r27601 53 53 $(VBOX_LIB_IPRT_GUEST_R3) \ 54 54 X11 \ 55 Xrandr \ 55 56 Xt 56 57 # These are static replacements for gcc-specific parts of libstdc++ -
trunk/src/VBox/Additions/x11/VBoxClient/display.cpp
r26792 r27601 29 29 #include <X11/Xlib.h> 30 30 #include <X11/cursorfont.h> 31 #include <X11/extensions/Xrandr.h> 31 32 32 33 #include <iprt/assert.h> … … 39 40 #include "VBoxClient.h" 40 41 41 static int initDisplay( )42 static int initDisplay(Display *pDisplay) 42 43 { 43 44 int rc = VINF_SUCCESS; 44 int rcSystem, rcErrno;45 45 uint32_t fMouseFeatures = 0; 46 46 47 LogFlowFunc(("enabling dynamic resizing\n")); 48 rcSystem = system("VBoxRandR --test"); 49 if (-1 == rcSystem) 50 { 51 rcErrno = errno; 52 rc = RTErrConvertFromErrno(rcErrno); 53 } 54 if (RT_SUCCESS(rc)) 55 { 56 if (0 != WEXITSTATUS(rcSystem)) 57 rc = VERR_NOT_SUPPORTED; 58 } 47 LogFlowFunc(("testing dynamic resizing\n")); 48 int iDummy; 49 if (!XRRQueryExtension(pDisplay, &iDummy, &iDummy)) 50 rc = VERR_NOT_SUPPORTED; 59 51 if (RT_SUCCESS(rc)) 60 52 rc = VbglR3CtlFilterMask(VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST, 0); … … 116 108 117 109 /** 110 * This method first resets the current resolution using RandR to wake up 111 * the graphics driver, then sets the resolution requested if it is among 112 * those offered by the driver. 113 */ 114 static void setSize(Display *pDisplay, uint32_t cx, uint32_t cy) 115 { 116 XRRScreenConfiguration *pConfig; 117 XRRScreenSize *pSizes; 118 int cSizes; 119 pConfig = XRRGetScreenInfo(pDisplay, DefaultRootWindow(pDisplay)); 120 /* Reset the current mode */ 121 LogFlowFunc(("Setting size %ux%u\n", cx, cy)); 122 if (pConfig) 123 { 124 pSizes = XRRConfigSizes(pConfig, &cSizes); 125 unsigned uDist = UINT32_MAX; 126 int iMode = -1; 127 for (int i = 0; i < cSizes; ++i) 128 { 129 #define VBCL_SQUARE(x) (x) * (x) 130 unsigned uThisDist = VBCL_SQUARE(pSizes[i].width - cx) 131 + VBCL_SQUARE(pSizes[i].height - cy); 132 LogFlowFunc(("Found size %dx%d, distance %u\n", pSizes[i].width, 133 pSizes[i].height, uThisDist)); 134 #undef VBCL_SQUARE 135 if (uThisDist < uDist) 136 { 137 uDist = uThisDist; 138 iMode = i; 139 } 140 } 141 if (iMode >= 0) 142 { 143 Time config_timestamp = 0; 144 XRRConfigTimes(pConfig, &config_timestamp); 145 LogFlowFunc(("Setting new size %d\n", iMode)); 146 XRRSetScreenConfig(pDisplay, pConfig, 147 DefaultRootWindow(pDisplay), iMode, 148 RR_Rotate_0, config_timestamp); 149 } 150 XRRFreeScreenConfigInfo(pConfig); 151 } 152 } 153 154 /** 118 155 * Display change request monitor thread function. 119 156 * Before entering the loop, we re-read the last request … … 122 159 * stale. 123 160 */ 124 int runDisplay()161 static int runDisplay(Display *pDisplay) 125 162 { 126 163 LogFlowFunc(("\n")); 127 Display *pDisplay = XOpenDisplay(NULL);128 if (pDisplay == NULL)129 return VERR_NOT_FOUND;130 164 Cursor hClockCursor = XCreateFontCursor(pDisplay, XC_watch); 131 165 Cursor hArrowCursor = XCreateFontCursor(pDisplay, XC_left_ptr); … … 140 174 | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED, 141 175 RT_INDEFINITE_WAIT, &fEvents); 176 /* Jiggle the mouse pointer to wake up the driver. */ 177 XGrabPointer(pDisplay, 178 DefaultRootWindow(pDisplay), true, 0, GrabModeAsync, 179 GrabModeAsync, None, hClockCursor, CurrentTime); 180 XFlush(pDisplay); 181 XGrabPointer(pDisplay, 182 DefaultRootWindow(pDisplay), true, 0, GrabModeAsync, 183 GrabModeAsync, None, hArrowCursor, CurrentTime); 184 XFlush(pDisplay); 185 XUngrabPointer(pDisplay, CurrentTime); 186 XFlush(pDisplay); 187 /* And if it is a size hint, set the new size now that the video 188 * driver has had a chance to update its list. */ 142 189 if (RT_SUCCESS(rc) && (fEvents & VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST)) 143 190 { … … 149 196 RTThreadYield(); 150 197 else 151 system("VBoxRandR"); 152 } 153 if ( RT_SUCCESS(rc) 154 && (fEvents & VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED)) 155 { 156 XGrabPointer(pDisplay, 157 DefaultRootWindow(pDisplay), true, 0, GrabModeAsync, 158 GrabModeAsync, None, hClockCursor, CurrentTime); 159 XFlush(pDisplay); 160 XGrabPointer(pDisplay, 161 DefaultRootWindow(pDisplay), true, 0, GrabModeAsync, 162 GrabModeAsync, None, hArrowCursor, CurrentTime); 163 XFlush(pDisplay); 164 XUngrabPointer(pDisplay, CurrentTime); 165 XFlush(pDisplay); 198 setSize(pDisplay, cx, cy); 166 199 } 167 200 } … … 179 212 virtual int run(bool fDaemonised /* = false */) 180 213 { 181 int rc = initDisplay(); 214 Display *pDisplay = XOpenDisplay(NULL); 215 if (!pDisplay) 216 return VERR_NOT_FOUND; 217 int rc = initDisplay(pDisplay); 182 218 if (RT_SUCCESS(rc)) 183 rc = runDisplay(); 219 rc = runDisplay(pDisplay); 220 XCloseDisplay(pDisplay); 184 221 return rc; 185 222 }
Note:
See TracChangeset
for help on using the changeset viewer.

