VirtualBox

Ignore:
Timestamp:
Mar 22, 2016 7:23:35 PM (9 years ago)
Author:
vboxsync
Message:

bugref:8087: Additions/x11: support non-root X server: the Linux kernel sends cursor events to each screen, but we handle them globally. Keep track of whether the cursor is enabled for each screen, and only disable it globally if it is disabled everywhere. Also take screen offset into account when reporting cursor position to the host.

Location:
trunk/src/VBox/Additions/linux/drm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/drm/vbox_drv.h

    r60123 r60141  
    153153    unsigned crtc_id;
    154154    uint32_t fb_offset;
    155     struct drm_gem_object *cursor_bo;
    156     uint64_t cursor_addr;
    157     int cursor_width, cursor_height;
    158     u8 offset_x, offset_y;
     155    bool cursor_enabled;
    159156};
    160157
  • trunk/src/VBox/Additions/linux/drm/vbox_mode.c

    r60138 r60141  
    634634
    635635    if (!handle) {
     636        bool cursor_enabled = false;
     637        struct drm_crtc *crtci;
     638
    636639        /* Hide cursor. */
    637         VBoxHGSMIUpdatePointerShape(&vbox->submit_info, 0, 0, 0, 0, 0, NULL, 0);
     640        vbox_crtc->cursor_enabled = false;
     641        list_for_each_entry(crtci, &vbox->dev->mode_config.crtc_list, head)
     642            if (to_vbox_crtc(crtci)->cursor_enabled)
     643                cursor_enabled = true;
     644        if (!cursor_enabled)
     645            VBoxHGSMIUpdatePointerShape(&vbox->submit_info, 0, 0, 0, 0, 0, NULL, 0);
    638646        return 0;
    639647    }
     648    vbox_crtc->cursor_enabled = true;
    640649    if (   width > VBOX_MAX_CURSOR_WIDTH || height > VBOX_MAX_CURSOR_HEIGHT
    641650        || width == 0 || hot_x > width || height == 0 || hot_y > height)
     
    702711    struct vbox_private *vbox = crtc->dev->dev_private;
    703712
    704     VBoxHGSMICursorPosition(&vbox->submit_info, true, x, y, NULL, NULL);
     713    VBoxHGSMICursorPosition(&vbox->submit_info, true, x + crtc->x,
     714                            y + crtc->y, NULL, NULL);
    705715    return 0;
    706716}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette