LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-07-2016, 03:08 AM   #1
linuxs64
Member
 
Registered: Jun 2010
Posts: 116

Rep: Reputation: 47
Help in patching wine to NOT filter keyboard/mouse messages


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, &current->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( &current->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;
        }
 
Old 09-08-2016, 05:26 PM   #2
zk1234
4MLinux Maintainer
 
Registered: Oct 2010
Location: Poland
Distribution: 4MLinux, Slackware
Posts: 1,253

Rep: Reputation: 220Reputation: 220Reputation: 220
Hi,

Your post is about hacking the Wine code. I think that it's a good idea to address it to the Wine developers and/or enthusiasts. Perhaps you should visit their official forum.

.
 
Old 09-13-2016, 05:11 AM   #3
linuxs64
Member
 
Registered: Jun 2010
Posts: 116

Original Poster
Rep: Reputation: 47
I did post at winehq forums, it's been a week now, no response
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hp wireless keyboard & mouse, keyboard works, mouse do not work not working john hughes Linux - Desktop 2 04-04-2016 11:00 AM
Is it possible to filter messages in rsyslog? ust Linux - Newbie 3 10-02-2013 04:21 AM
filter /etc/messages for certain IP table entries don_wombat Linux - Software 0 12-14-2004 03:45 PM
Wine, Keyboard & Mouse problem ! Baran Linux - Software 1 10-23-2003 10:25 AM
Starcraft on Wine Mouse and Keyboard don't work! kierwind Linux - Software 1 06-20-2003 04:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration