I'm trying to send stimulated keyboard/mouse events via xdotool, to wine applications (minimized) but not getting any response, found a lead that could solve this issue.
But I am not good in programming
Some info about the patch/hack, responsible for filtering keyboard messages for inactive windows in wine
from
wine source, /wine/server/queue.c
function find_hardware_message_window
Please change to allow messages to non-focused/minimized windows, thank you
line 1402
Code:
/* find the window that should receive a given hardware message */
static user_handle_t find_hardware_message_window( struct desktop *desktop, struct thread_input *input,
struct message *msg, unsigned int *msg_code,
struct thread **thread )
{
user_handle_t win = 0;
*thread = NULL;
*msg_code = msg->msg;
if (msg->msg == WM_INPUT)
{
if (!(win = msg->win) && input) win = input->focus;
}
else if (is_keyboard_msg( msg ))
{
if (input && !(win = input->focus))
{
win = input->active;
if (*msg_code < WM_SYSKEYDOWN) *msg_code += WM_SYSKEYDOWN - WM_KEYDOWN;
}
}
else if (!input || !(win = input->capture)) /* mouse message */
{
if (is_window_visible( msg->win ) && !is_window_transparent( msg->win )) win = msg->win;
else win = shallow_window_from_point( desktop, msg->x, msg->y );
*thread = window_thread_from_point( win, msg->x, msg->y );
}
if (!*thread)
*thread = get_window_thread( win );
return win;
}
static struct rawinput_device_entry *find_rawinput_device( unsigned short usage_page, unsigned short usage )
{
struct rawinput_device_entry *e;
LIST_FOR_EACH_ENTRY( e, ¤t->process->rawinput_devices, struct rawinput_device_entry, entry )
{
if (e->device.usage_page != usage_page || e->device.usage != usage) continue;
return e;
}
return NULL;
}
static void update_rawinput_device(const struct rawinput_device *device)
{
struct rawinput_device_entry *e;
if (!(e = find_rawinput_device( device->usage_page, device->usage )))
{
if (!(e = mem_alloc( sizeof(*e) ))) return;
list_add_tail( ¤t->process->rawinput_devices, &e->entry );
}
if (device->flags & RIDEV_REMOVE)
{
list_remove( &e->entry );
free( e );
return;
}
e->device = *device;
e->device.target = get_user_full_handle( e->device.target );
}
line 1517
Code:
win = find_hardware_message_window( desktop, input, msg, &msg_code, &thread );
if (!win || !thread)
{
if (input) update_input_key_state( input->desktop, input->keystate, msg );
free_message( msg );
return;
}
line 1958
Code:
win = find_hardware_message_window( input->desktop, input, msg, &msg_code, &win_thread );
if (!win || !win_thread)
{
/* no window at all, remove it */
update_input_key_state( input->desktop, input->keystate, msg );
list_remove( &msg->entry );
free_message( msg );
continue;
}