Ticket #201 (new defect)

Opened 3 years ago

Last modified 5 months ago

Terminal appears on wrong monitor if primary screen is right of secondary one

Reported by: maweaver Owned by: somebody
Priority: Fix available Milestone: 0.5.0
Component: guake Version:
Keywords: Cc: perperenator@…, alex@…

Description

get_final_window_rect, assumes window_rect.x is 0, which may not always be the case. If the starting X coordinate is > 0 it gets reset to 0 by the calculations. The X coordinates should be added to, not set directly:

if halignment == ALIGN_CENTER:

window_rect.x += (total_width - window_rect.width) / 2

if halignment == ALIGN_LEFT:

window_rect_x += 0

elif halignment == ALIGN_RIGHT:

window_rect.x += total_width - window_rect.width

Attachments

0001-Fix-for-positioning-terminal-on-display-with-non-zer.patch Download (1.0 KB) - added by maweaver 3 years ago.
0002-make-guake-appear-on-primary-screen.patch Download (1.2 KB) - added by perper 6 months ago.
Patch that makes guake appear on the user's primary screen
0003-prefs-dialog-screen.png Download (69.4 KB) - added by alhirzel 5 months ago.
Screenshot of prefs dialog after applying 0003 patch
0003-prefs-dialog-screen.2.png Download (69.4 KB) - added by alhirzel 5 months ago.
Add multiple display support (including UI)
0003-multi-display-gui.patch Download (111.3 KB) - added by alhirzel 5 months ago.
Add multiple display support (including UI) (the patch this time!)

Change History

  Changed 3 years ago by maweaver

Sorry I created a typo in my fix. The only change should have been changing the '=' to '+='s, and the fourth line should read

window_rect.x += 0

not

window_rect_x += 0

  Changed 3 years ago by pingou

It would be nice if you could provide a git format-patch for your patch :-)

Thanks for contributing

  Changed 3 years ago by maweaver

Hopefully I did that right, I'm not too familiar with git.

  Changed 3 years ago by emanuelez

I tried changing the file manually on my machine according to the patch and it seems to work fine. Release it soon! :)

  Changed 3 years ago by sh_sh

Thx for the patch, much appreciated :]

follow-up: ↓ 7   Changed 19 months ago by pabloab

If just like me someone want to have guake on the second screen, change the hardcoded "0" to "1" on:

# get the rectangle just from the first/default monitor in the
# future we might create a field to select which monitor you
# wanna use
window_rect = screen.get_monitor_geometry(0)

in reply to: ↑ 6   Changed 8 months ago by ankel.bgx

Replying to pabloab:

If just like me someone want to have guake on the second screen, change the hardcoded "0" to "1" on: {{{ # get the rectangle just from the first/default monitor in the # future we might create a field to select which monitor you # wanna use window_rect = screen.get_monitor_geometry(0) }}}

Maybe someone would like that when there are 2 monitors guake appears on the second monitor and when no more than one appears on the first monitor.

monitors = int(screen.get_n_monitors())
    for m in range(0, monitors):
        window_rect = screen.get_monitor_geometry(m)

Changed 6 months ago by perper

Patch that makes guake appear on the user's primary screen

  Changed 6 months ago by perper

  • cc perperenator@… added

The attached patch 0001-Fix-for-positioning-terminal-on-display-with-non-zer.patch is not enough to fix the defect. The source of the problem is the hardcoded value of the monitor. User expects that guake window will appear on his primary monitor and monitor number 0 is not always primary one - it's only the first one on the left. So what is needed here is a method that gets the primary monitor and here you got it:

screen.get_primary_monitor()

I've already send the patch.

Changed 5 months ago by alhirzel

Screenshot of prefs dialog after applying 0003 patch

Changed 5 months ago by alhirzel

Add multiple display support (including UI)

  Changed 5 months ago by alhirzel

Patch 0003 rolls up everything so far into one, fixes #266 and resolves this bug. See screenshot for UI changed.

  Changed 5 months ago by alhirzel

  • cc alex@… added

Changed 5 months ago by alhirzel

Add multiple display support (including UI) (the patch this time!)

Note: See TracTickets for help on using tickets.