Menu

#6 Popup window position

v1.0 (example)
open-fixed
nobody
5
2007-07-03
2006-07-12
No

Hi,

Great program! It's the best gmail checker, even
compared to gmail notifier on windows. I use it at home
and office, where I have a dual monitor setup, where
I'm having a little problem: the popup window shows in
the wrong position (between the two monitors).

I'm guessing here, but I think you calculate the width
of the window, subtract the width of the popup and
than positions it. This is ok for a single monitor or
even for a dual monitor setup where the panel with the
checkgmail is positioned on the left monitor, which is
not my configuration.

I know it's a very rare setup, so I've been delaying
this post, so please feel absolutely free to ignore me.

Thanks,

Rilson

Discussion

  • Owen Marshall

    Owen Marshall - 2006-07-14

    Logged In: YES
    user_id=874762

    It might be a rare setup, but it should still be possible to
    handle it. Problem is that I don't have a dual monitor
    setup to debug with ...

    I'll have a look at it when I've got a moment - it probably
    isn't that difficult to fix. Probably best if you email me
    directly so I can send you something to see if it works or
    not ...

    Owen

     
  • Philip Jagielski

    Logged In: YES
    user_id=1673661
    Originator: NO

    I have the same problem. I don't know any Perl or GTK libary, so there's probably a better way to do this. I changed the lines (in the show_notify and popup functions) that say:

    my $width = $rect->width;

    to

    my $width = $rect->width * $eventbox->get_screen->get_n_monitors;

    As far as I can tell this will work for any placement on any number of monitors as long as they are all the same resolution.

    Philip

     
  • Nobody/Anonymous

    Logged In: NO

    Thanks - although that's a bit of a hack. There should be a neat way of doing this via GTK, some way in which you can find and specify the monitor to display on. It's just that, as you probably know, the GTK documentation is rather poor and finding little esoteric things like this in the toolkit can be time consuming.

    Cheers,
    Owen

     
  • Philip Jagielski

    Logged In: YES
    user_id=1673661
    Originator: NO

    OK, as far as I understand it the bug stems from the incorrect width value. When the script calls get_monitor_geometry it only uses the width of that one monitor where the eventbox resides. Multiplying the width by the number of monitors should work for 95% of the dual monitor setups out there, but it won't work if the monitors aren't all the same resolution. So, add the values of all the widths:

    #we want to use the height of the monitor we're going to display on
    my $height = $eventbox->get_screen->get_monitor_geometry($monitor)->height;
    my $width = 0;

    #but add the width of all the monitors
    for(my $i=0; $i < $eventbox->get_screen->get_n_monitors; $i++ )
    {
    $width += $eventbox->get_screen->get_monitor_geometry($i)->width;
    }

    This works for me no matter where I drag the gnome-panel on either of my monitors. I've never used perl before so please enlighten me if there's a better way to do the loopy thing. :)
    Hope this helps!

    Philip

     
  • Owen Marshall

    Owen Marshall - 2006-12-22

    Logged In: YES
    user_id=874762
    Originator: NO

    Yeah, OK! :) I still think there ought to be a more direct way of doing it, but seeing as I have no time to delve into esoteric GTK things, I'll happily adopt that solution :)

    Thanks! Incidentally, since you asked, the loop in Perl could also be written

    for my $i (0 .. ($eventbox->get_screen->get_n_monitors-1)) { ... }

    basically creating an anonymous array which then gets operated upon, which is a tiny bit faster (both to write and to execute! :) - not that it really matters at all in this case!

    Cheers,
    Owen

     
  • Nobody/Anonymous

    Logged In: NO

    I'm having a similar problem I thought I'd comment on. I have a dual monitor setup, and the gnome menu panel is on the right monitor. But the popup window for checkgmail shows up on the left panel. I'm using Nvidia's TwinView and it looks like my default monitor is the right one. Other than that this program is great.

     
  • Owen Marshall

    Owen Marshall - 2007-05-09

    Logged In: YES
    user_id=874762
    Originator: NO

    Hopefully fixed in SVN. Sorry for taking so long on this issue!

    Please let me know if this works for you ...

    Cheers,
    Owen

     
  • Nobody/Anonymous

    Logged In: NO

    great program but i am experiencing the same problem

     
  • Owen Marshall

    Owen Marshall - 2007-06-05

    Logged In: YES
    user_id=874762
    Originator: NO

    Have you tried the version from SVN?

     
  • Nobody/Anonymous

    Logged In: NO

    sorry yes that did fix the problem

     
  • Nobody/Anonymous

    Logged In: NO

    I can confirm this behavior with v1.10.1. My primary monitor is on the right (task bar, notify area, etc) and checkgmail's popup box shows on my left monitor.

    BTW, bug submission reports are not for praise and use cases ;)

     
  • Owen Marshall

    Owen Marshall - 2007-07-03

    Logged In: YES
    user_id=874762
    Originator: NO

    > I can confirm this behavior with v1.10.1. My primary monitor is on the
    > right (task bar, notify area, etc) and checkgmail's popup box shows on my
    > left monitor.

    Please try the latest SVN (significantly more up-to-date than 1.10.1) ... This issue is not perfectly fixed (as I can't take into account vertical monitor setups), but as far as I know it should work with standard xinerama setups. If this is not the case, please post again and I'll look into it - I simply don't have a dual monitor setup to test checkgmail on, and debugging this is solely dependent on bug reports ...

    > BTW, bug submission reports are not for praise and use cases ;)

    I have no idea what you mean by this ... but since I'm the software author, I'll decide what bug reports are for and not for, thanks all the same! :)

    Cheers,
    Owen

     
  • Owen Marshall

    Owen Marshall - 2007-07-03
    • status: open --> open-fixed
     
  • Nobody/Anonymous

    Logged In: NO

    Can confirm this bug still exists (reappeared?) in the latest version: 1.13svn (14/2/2008). Same scenario as the others, dual monitor setup (big desktop) with panels on the right side while the information popup is shown on the left monitor. This is observed on a machine running Ubuntu Gutsy (8.04) alpha.

    If I remember correctly it worked on Ubuntu Feisty (7.10), I will check to see if the bug is present there as soon as I get the chance.

     
  • Brendan

    Brendan - 2008-04-14

    Logged In: YES
    user_id=1490241
    Originator: NO

    I also still have this problem, tried stable release 1.13, svn, and Ubuntu Hardy (8.04)'s v1.12.1svn. All have this problem, I use twinview with my taskbar on the right monitor. My Monitors each run at different resolutions.

     
  • Brendan

    Brendan - 2008-04-24

    Logged In: YES
    user_id=1490241
    Originator: NO

    I've been playing around with the checkgmail code from the svn. why don't you do this? it works with my dual screen setup with the primary monitor on the right.

    --- checkgmail 2008-04-24 09:08:59.000000000 -0400
    +++ checkgmail (copy) 2008-04-24 09:17:02.000000000 -0400
    @@ -1870,15 +1870,8 @@
    my $height = $rect->height;

    # support multiple monitors (thanks to Philip Jagielski for this simple solution!)
    - my $width;
    - unless ($disable_monitors_check) {
    - for my $i (0 .. $monitor) {
    - $width += $eventbox->get_screen->get_monitor_geometry($i)->width;
    - }
    - } else {
    - $width = $eventbox->get_screen->get_monitor_geometry($monitor)->width;
    - }
    -
    + my $width = $eventbox->get_screen->get_width();
    +
    return ($monitor,$rect,$width,$height);
    }

     
  • Nobody/Anonymous

    Logged In: NO

    That's my setup too and I have the same problem. I'm trying to fix it but I don't know much of Perl.

     
  • Nobody/Anonymous

    Logged In: NO

    Problem still seems to persist. I am content to run it on the left monitor, just wanted to let you know.

     
  • Nobody/Anonymous

    Logged In: NO

    I'm having the same issue! I would love to see this resolved either automatically or by allowing us to manually set the x and y offsets for the popup window.

    Great program!

     
  • Keith Schawel

    Keith Schawel - 2008-10-27

    dahlb's patch works well. My popup finally shows up on the primary (right) monitor.

     
  • DraXus

    DraXus - 2008-12-23

    This issue is not yet fixed in v1.13svn. dahlb's patch works great, thanks! :)

     
  • Anonymous

    Anonymous - 2009-11-16

    Clean install on Ubuntu Karmic, and ran checkgmail --update immediately afterwards. v1.13svn

    Problem still exists, and I can't get dahlb's patch to work... the patch command returns:
    patch: **** malformed patch at line 4: my $height = $rect->height;

    At any rate: If dahlb's patch works, why not integrate it into checkgmail? By the date posted, it's been awhile...

     

Log in to post a comment.