get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2222450/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2222450,
    "url": "http://patchwork.ozlabs.org/api/patches/2222450/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/91023e77-8838-c89f-481f-86174ee830e1@eik.bme.hu/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<91023e77-8838-c89f-481f-86174ee830e1@eik.bme.hu>",
    "list_archive_url": null,
    "date": "2026-04-11T21:53:29",
    "name": "sdl2 mouse pointer issue",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "780799c3900b59646af26a10c739f95a62a2b903",
    "submitter": {
        "id": 16148,
        "url": "http://patchwork.ozlabs.org/api/people/16148/?format=api",
        "name": "BALATON Zoltan",
        "email": "balaton@eik.bme.hu"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/91023e77-8838-c89f-481f-86174ee830e1@eik.bme.hu/mbox/",
    "series": [
        {
            "id": 499578,
            "url": "http://patchwork.ozlabs.org/api/series/499578/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=499578",
            "date": "2026-04-11T21:53:29",
            "name": "sdl2 mouse pointer issue",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499578/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2222450/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2222450/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)",
        "Received": [
            "from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4ftSBN0561z1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 12 Apr 2026 07:54:34 +1000 (AEST)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wBgGy-00088P-Q4; Sat, 11 Apr 2026 17:53:49 -0400",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <balaton@eik.bme.hu>)\n id 1wBgGr-00088A-4r\n for qemu-devel@nongnu.org; Sat, 11 Apr 2026 17:53:41 -0400",
            "from zero.eik.bme.hu ([152.66.115.2])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <balaton@eik.bme.hu>)\n id 1wBgGo-0006Ax-HV\n for qemu-devel@nongnu.org; Sat, 11 Apr 2026 17:53:40 -0400",
            "from localhost (localhost [127.0.0.1])\n by zero.eik.bme.hu (Postfix) with ESMTP id 3BB525969F2;\n Sat, 11 Apr 2026 23:53:32 +0200 (CEST)",
            "from zero.eik.bme.hu ([127.0.0.1])\n by localhost (zero.eik.bme.hu [127.0.0.1]) (amavis, port 10028) with ESMTP\n id BD_q4EQKvFkN; Sat, 11 Apr 2026 23:53:29 +0200 (CEST)",
            "by zero.eik.bme.hu (Postfix, from userid 432)\n id D992C5968DE; Sat, 11 Apr 2026 23:53:29 +0200 (CEST)",
            "from localhost (localhost [127.0.0.1])\n by zero.eik.bme.hu (Postfix) with ESMTP id D7C6A5968DD;\n Sat, 11 Apr 2026 23:53:29 +0200 (CEST)"
        ],
        "X-Virus-Scanned": "amavis at eik.bme.hu",
        "Date": "Sat, 11 Apr 2026 23:53:29 +0200 (CEST)",
        "From": "BALATON Zoltan <balaton@eik.bme.hu>",
        "To": "qemu-devel@nongnu.org",
        "cc": "Gerd Hoffmann <kraxel@redhat.com>, marcandre.lureau@redhat.com,\n Peter Maydell <peter.maydell@linaro.org>",
        "Subject": "sdl2 mouse pointer issue",
        "Message-ID": "<91023e77-8838-c89f-481f-86174ee830e1@eik.bme.hu>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Received-SPF": "pass client-ip=152.66.115.2; envelope-from=balaton@eik.bme.hu;\n helo=zero.eik.bme.hu",
        "X-Spam_score_int": "-18",
        "X-Spam_score": "-1.9",
        "X-Spam_bar": "-",
        "X-Spam_report": "(-1.9 / 5.0 requ) BAYES_00=-1.9,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no",
        "X-Spam_action": "no action",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "qemu development <qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "Hello,\n\nThere's a long standing bug with -display sdl that host side mouse pointer \ndoes not follow guest or jumps around or otherwise behaves erratically. \nThere are several tickets about this as well but gitlab does not make it \neasy to find them so these are just a few I think might be related, there \nmight be more:\n\nhttps://gitlab.com/qemu-project/qemu/-/work_items/1550\nhttps://gitlab.com/qemu-project/qemu/-/work_items/2960\nhttps://gitlab.com/qemu-project/qemu/-/work_items/2948\n\nI can also reproduce it with\n\nqemu-system-ppc -M pegasos2 -display sdl -device ati-vga -kernel boot.img -cdrom morphos.iso\n\n(boot.img is from the root dir of the morphos iso). Mouse pointer mostly \nworks as long as don't move it too fast or you don't switch to full screen \nwith Ctrl+Alt+F then it does not work even if you switch back to window. \nThis can be avoided using disabling host side cursor with -device \nati-vga,guest_hwcursor=on.\n\nAfter not finding any cause in ati-vga I've added some diagnostics to sdl \nbackend:\n\n\nand got this output just booting the iso without clicking in the window or \nmoving the mouse. First this is the guest moving the cursor by writing the \nHW cursor register for position to place the pointer in the middle:\n\nsdl_mouse_warp(1024,576,1)\nsdl_mouse_warp(1024,576,1)\nsdl_mouse_warp(1024,576,1)\nsdl_mouse_warp(1024,576,1)\n\nthen just switching to full screen with Crtl+Alt+F without moving the \nmouse in the guest I get these:\n\nhandle_mousemotion(2048,1152,2560,1440, 655,368,0,0)\nsdl_send_mouse_event(0,0,655,368,0), 1 1024,576, -> -369,-208 655,368\nsdl_mouse_warp(286,160,1)\nhandle_mousemotion(2048,1152,2560,1440, 182,102,0,0)\nsdl_send_mouse_event(0,0,182,102,0), 1 286,160, -> -104,-58 182,102\nsdl_mouse_warp(78,44,1)\nhandle_mousemotion(2048,1152,2560,1440, 49,28,0,0)\nsdl_send_mouse_event(0,0,49,28,0), 1 78,44, -> -29,-16 49,28\nsdl_mouse_warp(20,12,1)\nhandle_mousemotion(2048,1152,2560,1440, 12,7,0,0)\nsdl_send_mouse_event(0,0,12,7,0), 1 20,12, -> -8,-5 12,7\nsdl_mouse_warp(4,2,1)\nhandle_mousemotion(2048,1152,2560,1440, 2,0,0,0)\nsdl_send_mouse_event(0,0,2,0,0), 1 4,2, -> -2,-2 2,0\nsdl_mouse_warp(2,0,1)\nhandle_mousemotion(2048,1152,2560,1440, 0,0,0,0)\nsdl_send_mouse_event(0,0,0,0,0), 1 2,0, -> -2,0 0,0\nsdl_mouse_warp(0,0,1)\nhandle_mousemotion(2048,1152,2560,1440, 0,0,0,0)\nsdl_send_mouse_event(0,0,0,0,0), 1 0,0, -> 0,0 0,0\nsdl_mouse_warp(0,0,1)\nhandle_mousemotion(2048,1152,2560,1440, 0,0,0,0)\nsdl_send_mouse_event(0,0,0,0,0), 1 0,0, -> 0,0 0,0\nsdl_mouse_warp(0,0,1)\n\nThe pointer is moved to the top left without any input from the user and \ncannot leave it any more (less severe cases could cause laggy mouse \npointer or other issues). Trying to move the mouse afterwards can only \nmove vertically.\n\nOn the ati-vga side writing CUR_HORZ_VERT_POSN register that the guest \ndoes to move the HW cursor calls\n\ndpy_mouse_set(s->vga.con, s->regs.cur_hv_pos >> 16,\n              s->regs.cur_hv_pos & 0xffff, true);\n\nwhich ends up in sdl_mouse_warp that sets guest_x,guest_y but then other \nparts of sdl.c also try to also set it differently. That's what I could \nfind out but I don't understand how it should work and why it doesn't. It \nlooks like there is some confusion about what guest_x and guest_y should \nbe. Could somebody give some clue how this could be fixed? Or even better \nfix it as I'm quite lost on this.\n\nThank you,\nBALATON Zoltan",
    "diff": "diff --git a/ui/sdl2.c b/ui/sdl2.c\nindex aaaede56e0..4f625365ab 100644\n--- a/ui/sdl2.c\n+++ b/ui/sdl2.c\n@@ -333,6 +333,7 @@ static void sdl_send_mouse_event(struct sdl2_console *scon, int dx, int dy,\n         qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_Y,\n                              y, 0, surface_height(scon->surface));\n     } else {\n+fprintf(stderr,\"%s(%d,%d,%d,%d,%d), %d %d,%d,\",__func__,dx,dy,x,y,state,guest_cursor,guest_x,guest_y);\n         if (guest_cursor) {\n             x -= guest_x;\n             y -= guest_y;\n@@ -341,6 +342,7 @@ static void sdl_send_mouse_event(struct sdl2_console *scon, int dx, int dy,\n             dx = x;\n             dy = y;\n         }\n+fprintf(stderr,\" -> %d,%d %d,%d\\n\",dx,dy,guest_x,guest_y);\n         qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_X, dx);\n         qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_Y, dy);\n     }\n@@ -525,6 +527,7 @@ static void handle_mousemotion(SDL_Event *ev)\n     dx = (int64_t)ev->motion.xrel * surf_w / scr_w;\n     dy = (int64_t)ev->motion.yrel * surf_h / scr_h;\n     if (gui_grab || qemu_input_is_absolute(scon->dcl.con) || absolute_enabled) {\n+fprintf(stderr, \"%s(%d,%d,%d,%d, %d,%d,%d,%d)\\n\",__func__,surf_w,surf_h,scr_w,scr_h,x,y,dx,dy);\n         sdl_send_mouse_event(scon, dx, dy, x, y, ev->motion.state);\n     }\n }\n@@ -750,6 +753,7 @@ static void sdl_mouse_warp(DisplayChangeListener *dcl,\n     } else if (gui_grab) {\n         sdl_hide_cursor(scon);\n     }\n+fprintf(stderr,\"%s(%d,%d,%d)\\n\",__func__,x,y,on);\n     guest_cursor = on;\n     guest_x = x, guest_y = y;\n }\n",
    "prefixes": []
}