Allow mocking remote clients

This commit is contained in:
Kovid Goyal
2026-04-19 20:42:43 +05:30
parent 51b0e9c4ad
commit 0ddbffdf79
6 changed files with 47 additions and 18 deletions

View File

@@ -2184,9 +2184,18 @@ dnd_test_probe_state(PyObject *self UNUSED, PyObject *args) {
if (!PyArg_ParseTuple(args, "Ks", &window_id, &q)) return NULL;
Window *w = window_for_window_id((id_type)window_id);
if (!w) { PyErr_SetString(PyExc_ValueError, "Window not found"); return NULL; }
if (strcmp(q, "drop_wanted") == 0) {
return Py_NewRef(w->drop.wanted ? Py_True : Py_False);
}
if (strcmp(q, "drag_can_offer") == 0) {
return Py_NewRef(w->drag_source.can_offer ? Py_True : Py_False);
}
if (strcmp(q, "drop_is_remote_client") == 0) {
return Py_NewRef(w->drop.is_remote_client ? Py_True : Py_False);
}
if (strcmp(q, "drag_is_remote_client") == 0) {
return Py_NewRef(w->drag_source.is_remote_client ? Py_True : Py_False);
}
Py_RETURN_NONE;
}