Changeset a9c19174a0f3c1230e8b29eaaebfda077b0efbef
- Timestamp:
- 03/24/09 17:40:02 (3 years ago)
- Author:
- Lincoln de Sousa <lincoln@…>
- Children:
- 8fd387306e4b1be05ca3f43e95e8cb5238d8f0d9
- Parents:
- 014842639ffec88ea516166f1a40e612591a1d63
- git-author:
- Aleksandar Krsteski <alekrsteski@…> (03/20/09 00:07:48)
- git-committer:
- Lincoln de Sousa <lincoln@…> (03/24/09 17:40:02)
- Message:
-
Fix dual monitor problem.
Fix the dual monitor problem that manifested with guake appearing on the
monitor with the width of the other monitor. The problem was that guake
assumed that left monitor is always the default monitor, which is not
always the case, and always appeared on position 0,0 (top left of the
left monitor). In my case it took the width of the monitor0 1680 but
appeared on the left monitor which has width of 1280. To fix this,
rework the get_final_window_size to get_final_window_rect that will
return the rectangle (x,y,width,height) of the window. Also remove some
ilogical code that compared the monitor height with height preference
(height preference is in percents and monitor height is in pixels).
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r0148426
|
ra9c1917
|
|
| 146 | 146 | be called and will call the resize function in guake. |
| 147 | 147 | """ |
| 148 | | width, height = self.guake.get_final_window_size() |
| 149 | | self.guake.window.resize(width, height) |
| | 148 | window_rect = self.guake.get_final_window_rect() |
| | 149 | self.guake.window.resize(window_rect.width, window_rect.height) |
| 150 | 150 | |
| 151 | 151 | def scrollbar_toggled(self, client, connection_id, entry, data): |
| … |
… |
|
| 690 | 690 | self.add_tab() |
| 691 | 691 | |
| 692 | | width, height = self.get_final_window_size() |
| 693 | | self.window.resize(width, height) |
| | 692 | window_rect = self.get_final_window_rect() |
| | 693 | self.window.resize(window_rect.width, window_rect.height) |
| 694 | 694 | self.window.show_all() |
| 695 | | self.window.move(0, 0) |
| | 695 | self.window.move(window_rect.x, window_rect.y) |
| 696 | 696 | |
| 697 | 697 | try: |
| … |
… |
|
| 715 | 715 | self.window.hide() # Don't use hide_all here! |
| 716 | 716 | |
| 717 | | def get_final_window_size(self): |
| | 717 | def get_final_window_rect(self): |
| 718 | 718 | """Gets the final size of the main window of guake. The height |
| 719 | 719 | is just the window_size property. But width is calculated as |
| … |
… |
|
| 724 | 724 | height = self.client.get_int(KEY('/general/window_size')) |
| 725 | 725 | |
| 726 | | # avoiding X Window system error |
| 727 | | max_height = screen.get_height() |
| 728 | | if height > max_height: |
| 729 | | height = max_height |
| 730 | | |
| 731 | | # get the width just from the first/default monitor in the |
| | 726 | # get the rectangle just from the first/default monitor in the |
| 732 | 727 | # future we might create a field to select which monitor you |
| 733 | 728 | # wanna use |
| 734 | | width = screen.get_monitor_geometry(0).width |
| 735 | | |
| 736 | | total_height = self.window.get_screen().get_height() |
| 737 | | final_height = total_height * height / 100 |
| 738 | | return width, final_height |
| | 729 | window_rect = screen.get_monitor_geometry(0) |
| | 730 | |
| | 731 | window_rect.height = window_rect.height * height / 100 |
| | 732 | return window_rect |
| 739 | 733 | |
| 740 | 734 | # -- configuration -- |