[sip-comm-dev] [PATCH] Fix for dialog and frame position on dual screen


#1

Hi,
on a dual screen using TwinView configuration with Ubuntu, the dialogs were
appearing between the two Screens.
One half on each screen.
The reason is that
Toolkit.getDefaultToolkit().getScreenSize()
considers the display as a big large screen of 2560 (2*1280) and the middle
of that is at the exact separation of the screens.
I replaced that with the method setLocationRelativeTo() that can accept null
as argument and will center the window on the main screen

Matthieu

Fix_for_dialog_location_on_dual_screen.patch (1.92 KB)


#2

Hi Matthieu,

good catch!! Committed and ack-ed (r6759).

Cheers,
Yana

···

On Feb 5, 2010, at 12:23 PM, Matthieu Casanova wrote:

Hi,
on a dual screen using TwinView configuration with Ubuntu, the dialogs were appearing between the two Screens.
One half on each screen.
The reason is that
Toolkit.getDefaultToolkit().getScreenSize()
considers the display as a big large screen of 2560 (2*1280) and the middle of that is at the exact separation of the screens.
I replaced that with the method setLocationRelativeTo() that can accept null as argument and will center the window on the main screen

Matthieu
<Fix_for_dialog_location_on_dual_screen.patch>---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Matthieu, all,

I think that I'm experiencing problems with the new setCenterLocation implementation in SIPCommDialog. My dialog is sometimes shown in the top left corner of the screen instead of the center. I didn't have much time to investigate, so I just wanted to share the problem here in case you or someone else has experienced the same issue. I don't know if this has something to do with the problem, but for now the problem appeared only with dialogs (not frames). In my case the problematic dialogs are AddContactDialog and CreateGroupDialog. I wonder if it has something to do with the dialog owner or something like that.

Cheers,
Yana

···

On Feb 15, 2010, at 5:02 AM, Yana Stamcheva wrote:

Hi Matthieu,

good catch!! Committed and ack-ed (r6759).

Cheers,
Yana

On Feb 5, 2010, at 12:23 PM, Matthieu Casanova wrote:

Hi,
on a dual screen using TwinView configuration with Ubuntu, the dialogs were appearing between the two Screens.
One half on each screen.
The reason is that
Toolkit.getDefaultToolkit().getScreenSize()
considers the display as a big large screen of 2560 (2*1280) and the middle of that is at the exact separation of the screens.
I replaced that with the method setLocationRelativeTo() that can accept null as argument and will center the window on the main screen

Matthieu
<Fix_for_dialog_location_on_dual_screen.patch>---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hi,
Seing the patch I think the only problem can be about the getParent() return
value, maybe it is not what expected.
The method
setLocationRelativeTo(...);
center the dialog in the middle of the argument position, if the argument is
a Frame it will be centered on the frame, if it is null it will be the
middle of the screen.
I just tried and the AddContactDialog appears in the middle of my screen (I
open it using the menu of sip-communicator),
the CreateGroupDialog appears in the middle of the sip-communicator dialog,
and it seems after that it remembers it's position.

It seems I can reproduce your problem if the sip-communicator frame is
closed and if I open the AddContactDialog using the popup menu of the tray
icon if sip-communicator.
I'll try to investigate to find what is the parent in that case

Matthieu

···

2010/3/17 Yana Stamcheva <yana@sip-communicator.org>

Hi Matthieu, all,

I think that I'm experiencing problems with the new setCenterLocation
implementation in SIPCommDialog. My dialog is sometimes shown in the top
left corner of the screen instead of the center. I didn't have much time to
investigate, so I just wanted to share the problem here in case you or
someone else has experienced the same issue. I don't know if this has
something to do with the problem, but for now the problem appeared only with
dialogs (not frames). In my case the problematic dialogs are
AddContactDialog and CreateGroupDialog. I wonder if it has something to do
with the dialog owner or something like that.

Cheers,
Yana

On Feb 15, 2010, at 5:02 AM, Yana Stamcheva wrote:

> Hi Matthieu,
>
> good catch!! Committed and ack-ed (r6759).
>
> Cheers,
> Yana
>
> On Feb 5, 2010, at 12:23 PM, Matthieu Casanova wrote:
>
>> Hi,
>> on a dual screen using TwinView configuration with Ubuntu, the dialogs
were appearing between the two Screens.
>> One half on each screen.
>> The reason is that
>> Toolkit.getDefaultToolkit().getScreenSize()
>> considers the display as a big large screen of 2560 (2*1280) and the
middle of that is at the exact separation of the screens.
>> I replaced that with the method setLocationRelativeTo() that can accept
null as argument and will center the window on the main screen
>>
>> Matthieu
>>
<Fix_for_dialog_location_on_dual_screen.patch>---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
>> For additional commands, e-mail: dev-help@sip-communicator.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
> For additional commands, e-mail: dev-help@sip-communicator.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net