Author Topic: Multi-monitor dialog positioning bug [patch]  (Read 50397 times)

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Multi-monitor dialog positioning bug [patch]
« on: December 15, 2005, 06:27:46 am »
Dialogs open on the primary display in Windows regardless of which monitor the codeblocks window is open on. Dialogs should open on the same monitor as Code::Blocks is currently displayed on.

This patch fixes the issue. :) Patch applies using TortoiseSVN in codeblocks/src.

Code
Topic: Multi-monitor dialog position update
Description:
  ! Dialogs would not open on the same screen as the parent dialog when the parent
    is not on the primary display in a multi-monitor Windows environment

I followed the tabs/spaces pattern of each file. In files where I saw that the entire file followed one pattern (say hard tabs) except for one or two lines in a function I updated (that used spaces) I fixed those two lines. In files that were "mixed content" through the file, I left those alone.

If you look at the patch copy in a whitespace viewer, you will see that I was consistent for each file and did not change any patterns.

[attachment deleted by admin]
« Last Edit: December 15, 2005, 08:55:47 am by 280Z28 »
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug
« Reply #1 on: December 15, 2005, 07:37:17 am »
By the way, I have just assumed that I'm not supposed to have commit access to the repository. That's why I've just posted patches. If y'all are expecting me to commit my changes you'll have to let me know or it'll never get done.
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
Re: Multi-monitor dialog positioning bug
« Reply #2 on: December 15, 2005, 07:38:23 am »
vey well done, this is indeed very annoying, if you need to switch monitors because that dialog popped up somewhere else.
Waiting for an svn update where Yiannis applied yoiur changes .........  8)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Multi-monitor dialog positioning bug
« Reply #3 on: December 15, 2005, 07:51:02 am »
i've applied your patch to my working copy and it is a big improvement ! thanks

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Multi-monitor dialog positioning bug [patch]
« Reply #4 on: December 15, 2005, 10:01:00 am »
Lol, don't get a wrong idea because I say something opposing every time you come up with something. :lol:
Dialogs should open on the same monitor as Code::Blocks is currently displayed on.
This is very much a matter of taste, and in my opinion not generally true.

It depends how you use your secondary monitor, and on the size of your monitors. I often send a program to the secondary screen when working with two apps (that may even be two instances of Code::Blocks), but I expect message boxes and dialogs to open on the primary screen.
This has a simple biological reason. The main screen is within the central 30° of my field of view, but the secondary screen in the peripheral field. Objects in the peripheral field are not seen as good as the ones in the central field, obviously, so you have to look aside or turn your head.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #5 on: December 15, 2005, 12:53:55 pm »
Lol, don't get a wrong idea because I say something opposing every time you come up with something. :lol:
Dialogs should open on the same monitor as Code::Blocks is currently displayed on.
This is very much a matter of taste, and in my opinion not generally true.

It depends how you use your secondary monitor, and on the size of your monitors. I often send a program to the secondary screen when working with two apps (that may even be two instances of Code::Blocks), but I expect message boxes and dialogs to open on the primary screen.
This has a simple biological reason. The main screen is within the central 30° of my field of view, but the secondary screen in the peripheral field. Objects in the peripheral field are not seen as good as the ones in the central field, obviously, so you have to look aside or turn your head.

Generally I'm all for customizability, but in this case I'm going to just say that is the wrong action. I use two monitors because I do two different things on two different screens, and the monitor something appears on should be associated with the program I placed there to start with. Having to drag the mouse back and forth and back and forth is extremely irritating. Also, they open in the corner of the main monitor. You may be used to the dialogs always opening on the primary screen, but that is because you've become used to improper program behavior. This program should behave like a every other program and not be the one program to decide to do things differently. It should definitely be changed from the way it is now.
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Multi-monitor dialog positioning bug [patch]
« Reply #6 on: December 15, 2005, 01:23:33 pm »
You may be used to the dialogs always opening on the primary screen, but that is because you've become used to improper program behavior.
That is not the case, it is a choice of ergonomy. Which solution is best for you depends on how large your monitors are and where you place them (and what kind of work you do).

This program should behave like a every other program and not be the one program to decide to do things differently.
The decision where a window (or a dialog for that matter) opens should not be the application's choice unless there is a good reason for this. One notable case where making this kind of decision in the application is the window that shows code completion tips. It is of course quite silly to show this window on a display different than the one holding the main window. But for all other cases, it is the window manager's choice where to put a window, not the application's.
Whatever the user prefers (same display, primary display, centered, on top) can be configured inside the window manager (or in desktop settings under MS Windows).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #7 on: December 15, 2005, 01:30:25 pm »
Can we please let this be a user preference then? I'll go back and change every single line to allow it to be optional, but please, please let there be at least an option for them to open on the same screen.
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Multi-monitor dialog positioning bug [patch]
« Reply #8 on: December 15, 2005, 01:37:19 pm »
...Whatever the user prefers (same display, primary display, centered, on top) can be configured inside the window manager (or in desktop settings under MS Windows).
how does this work ??? i never found a setting in windows which would allow me to specify where a dialog from any program pops up ?
i'm using WinXP SP2

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #9 on: December 15, 2005, 01:38:17 pm »
...Whatever the user prefers (same display, primary display, centered, on top) can be configured inside the window manager (or in desktop settings under MS Windows).
how does this work ??? i never found a setting in windows which would allow me to specify where a dialog from any program pops up ?
i'm using WinXP SP2

You can't ;)
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Multi-monitor dialog positioning bug [patch]
« Reply #10 on: December 15, 2005, 01:42:55 pm »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #11 on: December 15, 2005, 01:44:04 pm »
You can't ;)
Yeah right, you can't. ;)



That's an option in your video card drivers, not a normal one at all.

Edit: Hey, now we see that you have no reason not to patch it now. ;)
« Last Edit: December 15, 2005, 01:46:03 pm by 280Z28 »
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Multi-monitor dialog positioning bug [patch]
« Reply #12 on: December 15, 2005, 01:50:27 pm »
Well, I assume you don't run Windows XP using the VGA driver ;)
All mainstream video card drivers for Windows let you do such customizations.
Linux is another story, but there it is the window manager's business.

EDIT:
Edit: Hey, now we see that you have no reason not to patch it now. ;)
Not only do I not have a reason not to patch it, but I really don't want to. If an application explicitely asks for a window to be put onto some display, then it is really placed there. So this would not only have no advantage, but it would actually interfere with the "normal" operation.
« Last Edit: December 15, 2005, 01:53:47 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #13 on: December 15, 2005, 01:59:11 pm »
So if I make it an option will you add it?
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Multi-monitor dialog positioning bug [patch]
« Reply #14 on: December 15, 2005, 02:10:49 pm »
No objection from my side if it is an option.

What about simple message boxes? Are those consistent with the other dialogs  with your modifications?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."