Mouse Events "Falling Through" During Window Activation

I'm implementing a "tool pallette" in my application (much like tools in an application like Photoshop) and I want the user to be able to immediately click on options on this pallete without having to make the window active. Since Swing doesn't have an explicit "Pallete" window that would give this to me for free, I'm assuming I need to subclass JDialog to make this happen.
Even if window activation still must happen, it's crucial that the user only needs to click once to press the button on an inactive window.
I know I can detect WindowEvents like WINDOW_ACTIVATED by simply adding my own window listener, but I don't know how I'd go about having mouse events "fall through" the window listeners and cause the appropriate action on the underlying component. It's almost as if I need to tell the window itself to listen for nothing.
I thought glass planes may be the answer, but that doesn't seem to be what's preventing the intial click in an inactive window from falling through to the underlying component.
Any thoughts, comments, or experiences regarding this are greatly appreciated!

The solution to this problem was posted in the Swing forum. Turns out to be a simple difference of JWindow and JDialog, but a difference I wasn't seeing under all L&Fs (i.e., Windows L&F handles JDialog properly, MacOSX (Aqua) L&F seems to treat it like any other window... I've filed a bug with them).

Similar Messages

  • Allowing Mouse Events to "Fall Through" When Window Activated

    I'm implementing a "tool pallette" in my application (much like tools in an application like Photoshop) and I want the user to be able to immediately click on options on this pallete without having to make the window active. Since Swing doesn't have an explicit "Pallete" window that would give this to me for free, I'm assuming I need to subclass JDialog to make this happen.
    Even if window activation still must happen, it's crucial that the user only needs to click once to press the button on an inactive window.
    I know I can detect WindowEvents like WINDOW_ACTIVATED by simply adding my own window listener, but I don't know how I'd go about having mouse events "fall through" the window listeners and cause the appropriate action on the underlying component. It's almost as if I need to tell the window itself to listen for nothing.
    I thought glass planes may be the answer, but that doesn't seem to be what's preventing the intial click in an inactive window from falling through to the underlying component.
    Any thoughts, comments, or experiences regarding this are greatly appreciated!

    Such a simple solution to such a perplexing problem. You are absolutely right. It turns out I was experience a bug in my particular L&F. Trying this with the Windows L&F proves that simply changing from JWindow to a non-modal JDialog works. Now I'll have to go about getting the bug fixed in the MacOSX (Aqua) L&F so I have equivalent behavior across all our supported platforms.
    Thanks for the quick response.

  • Event ID 31138 "during the active directory update not -uc enabled agents were found"

    Hi All,
    I have Lync standard 2013 server on-premise and Exchange Office 365. I have enabled my users for Voice. 
    When I add a user to a response group I get the warning that the user is not enterprise voice enabled. This is strange as the user is enterprise enabled and can make and receive calls. 
    I also have Event ID 31138 on my Front End server. 
    "during the active directory update not -uc enabled agents were found
    The following agents are specified as agents but are not UC enabled:
    sip:[email protected]"
    Any thoughts? 

    Hi,
    Did you change the default SIP Domain before?
    If yes. You may need to remove agent from database. As the agents of a Response Group are added to the rgsconfigdatabase, within the database you will find a table called dbo.Agents. When open it you will see an overview of theagents which are member
    of the groups. You can do the following steps to remove an agent from this table:
    Right click on the dbo.Agents table and select the option Edit Top 200 rows
    Search for the user and remove the specific record.
    More details:
    http://troubleshootinglync.blogspot.com/2013/05/event-id-31137-unable-to-removeadd.html
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
    Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • Mouse events directed to one window in Xorg 1.7.x

    Hi there,
    There has been much talk about Xorg 1.7.x, and this one is another tale [Searched the forum 1st and googled but did not find a similar problem, so if mistaken, sorry ] I have and Dell XPS m1210 and using KDE4 (KDEMod) on Arch64. On xorg 1.7.x (all the version from the repos) after a while the mouse begins to behave strangely: I can not select any window with the mouse or touchpad it keeps sending the events (clicks for instance) to the active window. (even if I click out of the window)! And when change the window using alt+tab, the same thing happens but for the new active window.
    This is my Xorg.conf. I use hotplugging:
    Section "ServerLayout"
    Identifier "Layout0"
    Screen 0 "Screen0"
    InputDevice "Keyboard0" "CoreKeyboard"
    EndSection
    Section "Files"
    EndSection
    Section "Module"
    Load "dbe"
    Load "extmod"
    Load "glx"
    EndSection
    Section "InputDevice"
    # generated from default
    Identifier "Keyboard0"
    Driver "kbd"
    EndSection
    Section "Monitor"
    Identifier "Monitor0"
    VendorName "Unknown"
    ModelName "Unknown"
    HorizSync 28.0 - 33.0
    VertRefresh 43.0 - 72.0
    Option "DPMS"
    EndSection
    Section "Device"
    Identifier "Device0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    EndSection
    Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    EndSubSection
    EndSection

    AndyRTR wrote:When you want to use packages from testing repo you need to -Syu ALL packages. There are also new keyboard and evdev drivers and more. You should read around how to deal with upgrading Arch and how to use the testing repo. It's not recommended and expected to work when you only pick a few packages.
    Ok. System upgraded from testing repo. Keyboard and mouse are works. But strange area on screen is still there. It's a strange framebuffer or smth same I think.
    Here is screenshot: http://img340.imageshack.us/img340/306/ … 4x600s.png
    Area with "OPENBOX" text is it. There are no "EE" in Xorg.0.log
    Last edited by darklion (2009-10-29 11:17:27)

  • Error during Windows Activation

    Original title: when i going to actives windows error come                                 
    this app does not support the contract specified or is not installed

    If I interpret your post correctly, you are reporting that this error occurs when you attempt to activate Windows. Other users who have experienced this error have reported that running
    DISM \Online \Cleanup-Image \RestoreHealth to repair system corruption resolved their issue and allowed them to activate.
    I have changed the title of this thread to reflect this scenario, if you are experiencing a different issue, please help clarify the problem you are encountering.
    Brandon
    Windows Outreach Team- IT Pro
    Windows for IT Pros on TechNet

  • Mouse events during Thread.sleep

    hi.
    I have an applet .
    I have a alghoritm simulator.
    Everytime I find a solution I call the method Thread.sleep .
    I want to pause the application and I create a JToggleButton Pause .
    When I press the Pause during sleep mouse event are managed at the end of alghoritm.
    How can I manage mouse events during sleep?

    All UI events (such as mouse events) occur on the event dispatch thread (EDT).
    That means if you sleep on the EDT, you lock up the UI. For this reason, you shouldn't be sleeping on the EDT.
    I'm not sure what your sleep is trying to do but you need to manage your threads a little more carefully. For instance, any time consuming process which is invoked as a result of a UI event needs to be fired on a new thread to prevent the UI freezing. The fun starts when you have to update the UI as a result of that process, because you should then hook back onto the EDT to avoid the risk of deadlock.
    Some utility classes are provided, such as SwingUtilities, and other example code is provided on Sun's site, such as SwingWorker - but if you do much UI work you'll probably end up with your own core set of threading tools and so on to make life easier.

  • Event case missing mouse events on active-x component

    I am using a Treeview and capturing selections in the tree using mouse events (event structure). I have a problem where approx 3 out of 15 mouse events are not actioned by the event structure - has anyone else had this problem or is there any suggestions?
    Thanks.

    Could you post a copy of your code that demonstates this?
    I have experimented with this control and its events.
    We may be able to help if we have soething to look at.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • No mouse cursor during Windows 8.1 OSD

    Hi,
    I have a problem that is bugging me. Not really a biggie but a frustrating one.
    When deploying Windows 8.1 using a MDT 2013 TS from CM12R2 the mouse cursor gets disabled when the OS reboots into minisetup/windows.
    As long as the TS is in WinPE all is fine, but once rebooted the cursor goes away and comes back only when the TS completes.
    The mouse is enabled as I can fool around with it and find where it is by clicking like a madman until a window gets highlighted.
    Deploying different DELL workstations/laptops, all with the same symptom.
    BR /T

    To my knowledge this is simply because of the Z-ordering of the windows during Windows setup.
    The question though is why does it matter? You shouldn't be doing anything interactive a this point in the TS.
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • Capture All Mouse and Keyboard events even if java window NOT in FOCUS

    Hi All,
    Is this possible to capture all mouse and keyboard events even if java window is not in focus or is minimized. This java program should cature each and every event from the user once the program is started. Any help in this regard is appreciated!
    Thanks&Regards
    Sam

    I don't think you can. (without JNI)

  • Why my mouse pointer often freeze during heavy hard disk activity?

    Hi!
    My mouse pointer often freeze during heavy disk activity: copying files, extracting archives, downloading and encrypting files from mega.co.nz, etc. The whole system becomes unresponsive. Currently I am using linux-pf kernel with BFS scheduler and I/O scheduler elevator BFQ. What can I do to avoid this annoyance?

    Konstantin_hu wrote:Only 200 MB of swap space of 4 GB is in use.
    Swap space is extremely slow, so you don't want it to be used except as a last resort. Try in /etc/sysctl.conf:
    vm.swappiness=0

  • Iocane: poison the rodent (simulate X11 mouse events from keyboard)

    Iocane: the colorless, oderless, tasteless poision that will rid your system of its rodent infestation.  Though no promises about its effectiveness against Rodents Of Unusual Size.
    Iocane simulates mouse events from the keyboard.  Iocane can be passed a few parameters which - ideally - could each have a key binding in your favorite window manager.
    If iocane is called with no parameters it starts in interactive mode (which currently lacks documentation ... hey, I just wrote this this morning).  In interactive mode the directional arrows or h/j/k/l keys move the mouse cursor.  The number keys simulate button presses (1 = left button, 2 = middle, 3 = right).  The page up and page down keys simulate mouse wheel activation.  "q" quits from interactive mode returning any grabbed keys to their normal behavior.  Key bindings are all controlled from a simple rc file.
    Iocane can also be passed a series of commands on the command line or the filename for a script file with a list of iocane commands.  Iocane can also read command from its standard input.
    Iocane is conceptually similar to some functions of xdotool, but iocane should work under any window manager (or no wm at all), is much smaller, and the interactive mode allows for a sequence of many actions without the program having to start up and close down many times in rapid succession.
    Please report bugs or feature requests here.  Iocane is currently 127 lines of C, and it will remain small; in other words, features will only be added if the can be added without substantially increasing resource use.
    EDIT: Version 0.2 is now in the AUR
    Last edited by Trilby (2012-11-03 02:23:15)

    Any arbitrary number of buttons should be easy enough to simulate - provided the Xserver actually responds to events with that button number.  An update I'll push to github tomorrow will include a few changes, including buttons 1-9, but if there is need/desire I could increase that.  Sticking to 1-9 allows for the computationally cheaper hack of converting a string to a number by simple substracting 48 from the value of the first character; numbers greater than 9 would require the use of atoi() or some funky conditionals.  In the grand scheme of things this is fairly trivial, but unless there is a real reason to use more than 9 mouse buttons I'd prefer to keep the lighter code.
    Passing a window name and getting it's coordinates is possible but after considering it I've decided it wouldn't fit well in iocane.  The reason being that to do a half-arsed job of it would be pretty easy.  To do it properly, however, it would take quite a bit of scanning through recursive calls to XQueryTree, polling atoms/wmhints, matching strings, checking for subwindows in the case of reparenting window managers, and a bunch of other nonsense ... all to get two coordinates.
    However iocane will play nicely with any tool that will provide those coordinates from a given window name, so I can imagine and invocation such as the following to move the mouse 10 pixels right and down from the top left of a window - lets call it FlamingSquirrel - and simulate a click there:
    iocane $(cool_app FlamingSquirrel) : move 10 10 : button 1
    Currently that could only be done from a command line invocation, not from a script or interactive session, as it requires shell processing for the command substitution.  I can add support for this type of invocation in scripts and interactive mode as well.  Then all you need to do is find (or write) a program that will give coordinates for a window given a title/name.  I suspect such a program probably exists out there, or if you are comfortable with C, I could give you the starting framework for it as I made something that would have much code in common for another task on these forums (it's in jumpstart.c in the "misc" repo on my github).
    In fact, you could use the following
    xdotool mousemove --window FlamingSquirrel 0 0 && iocane offset 10 10 : button 1
    Though if you are using xdotool anyways, I'm not sure if iocane would serve much of a purpose, unless you just prefer iocane's syntax.
    Last edited by Trilby (2012-11-01 00:21:14)

  • Non modal PopUpManager blocking mouse events

    In our application we have a header, footer and center area.  We have a situation where we want to block the header and center area with a popup, but leave the footer area so it can be clicked on.  The code works fine and it all looks good, except the mouse events are blocked to the footer.  If we slightly resize the window (either with the mouse or programatically) it all "wakes up" and starts working.  I have tried all sorts of invalidateDisplayList, validateDisplayList, validateNow, etc.  I am throwing this out there to see if anyone else has had this problem and if there is something I am missing.  I can't easily share my code, but if I don't get a reply I'll put together a code example to see if I can recreate it.  Any ideas are very welcome.  Been scratching my head at this one for 3 days now. 

    I should point out that we are using "false" for the modal flag, just in case anyone was thinking that.  It all works fine once it "wakes up" through resizing, but I need to make that happen without the resizing.
    And we have tried all sorts of "callLater" behavior in conjuction with the invalidate/validate calls. 

  • HTML/JS: Capturing mouse events while Air is out of focus

    Hi,
    I've been trying to determine if it is possible to receive mouse events (like MOUSE_WHEEL) if the Air window does not currently have focus. I'd like my application to support the mouse wheel for scrolling while the cursor is over the application, without requiring the user to click the application and gain focus. My application uses JavaScript to scroll an unordered list within a DIV set to overflow:hidden (to prevent the native scrollbar from appearing).
    Thanks for your help!
    Andrew

    I doubt that AIR would pick up events fired while not having focus. Perhaps you could fake it by creating an AIR project that runs "fullscreen", but has a smaller active window. Anywhere your mouse went it would still capture the scrolling event, but you could conditionalize it so that it only worked in certain areas.

  • Mouse Events at the icon in systray.

    My program call library function to add, modify or delete icon into systray.
    Additionaly I'd like to get back information when any mouse event had happen under icon in systray like move mouse, right/left button click etc. to display popup menu (as an standart behaviour).
    I've tried Windows Message Queue, but it only works inside application window area.
    How could I do it ?
    Any suggestions, examples or advises ?
    Rumcajs.

    Requirements    Price: $29.95
     Application Software:
    LabVIEW 7.0+
     Toolkits Software:
     Additional Software:
     Language's:
    LabVIEW
    INVtray LabVIEW Toolkit allows the programmer to create a LabVIEW program that can be hidden from the task bar and accessed through the System Tray.  Comes with a sample VI that demonstrates all the features of the toolkit.

  • Using activex component in openGL app:  mouse event issues.....

    i'm trying to get the Flash ActiveX control to work in an
    OpenGL app. so far i've managed to get the bitmap data and map it
    to a texture succesfully. but i'm having problems getting the mouse
    interaction to work.
    i get an hWnd from IShockWaveFlash's IOleWindow. when i send
    mouse messages to it, the mouse is interpreted correctly by
    actionscript (for example, i have a custom mouse cursor tracking
    _xmouse, _ymouse which works fine).
    however, buttons do not behave correctly. rollover is
    erratic, and only in rare circumstances can i get a button's
    onPress handler to fire.
    am i sending the mouse events in correctly? any ideas of any
    other way to send them in?

    Thank you for you mail,
    After I read this article
    http://digital.ni.com/public.nsf/3efedde4322fef198​62567740067f3cc/610540bb3ea4ebdd862568960055e498?O​penDocument
    I realized that ActiveX events are not supported on CVI 5.01 at all since
    its introduced as a new feature of CVI 5.5
    "Azucena" wrote:
    >Daniel,>>Have you tried the function CA_RegisterEventCallback function?
    (I am using>CVI 5.5)>>This function is used by the functions generated by
    the Automation>Controller Instrument Driver Wizard.>It is not intended to
    be used directly.>>It basically registers a callback for an ActiveX Automation
    server object>event.>To register the callback, you must specify the CAObjHandle
    of the server>object from which you want to receive events.>>W
    ith CVI 5.5,
    there is an example for IE with Active X under the>samples/activeX directory.>>Hope
    this helps,>>Azucena>>"Daniel Bentolila" wrote in message>news:[email protected]..>>>>
    Has anybody tried to capture an ActiveX component event in a CVI>application>>
    ?>>>> for example I've created a new instance of the Internet Explorer>application>>
    from the CVI , using the ActiveX Automation controler I choosed the>Microsoft>>
    internet controls then I selected IWebBrowser2 and the IWebBrowserEvents2>>
    classes and generated the fp file for the CVI.>> Under the the IWebBrowserEvents2
    I see there are events fucntion for>example>> OnQuit, and I wanted my CVI
    app. to attach the quit event when the user>closes>> the IE window.>> Now
    at this point I expected to find some mechanism that let me to install>>
    some callback function where I can put my customised code to the quit>event,>>
    somehow I have to tell the IE to call my function whenever the OnQuit>callback>>
    fun
    ction is attached and I don't know how to do this.>>

Maybe you are looking for

  • Print report on network/local printer(plz help)

    Plz Forms gurus, help me to solve this problem it's very very importante for me We have at a lot application witch work in client/server mode using forms/Reports 6i.With these applications we haven't problem to print report on printer using RUN_PRODU

  • Mega 180 sold out?

    I waited too long to get around to buying one and now newegg and zipzoomfly are both out of stock... They are few and far between on ebay... are they being discontinued?  Hopefully there are still some out there (pref. under $300)...

  • How do I look up a web page I visited last week?

    I received confirmation of an event I registered for, but I hadn't printed it out yet, before that tab disappeared when I hibernated the computer. Is there a way I can retrieve it? The history tool only shows February or earlier; this was in March. T

  • No sound is coming from speakers

    there is sound when I plug in headphones. this problem started after I updated to ios 6.1.6. I tried cleaning the headphone jack and reseting the phone.

  • What is Data Detection in iMessage Menu

    Please, somebody can explain to me the function of the Edition Menu Command "Data Detection" in Message.apps (iMessage) . I can't find any help anywhere for this. (I translate the Command from a french Os X system). Thank you for help.