Closed Bug 239227 Opened 20 years ago Closed 20 years ago

nsScreenGTK::GetAvailRect() should take the taskbar/panel/dock/etc into account if possible

Categories

(Core Graveyard :: GFX: Gtk, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: caillon, Assigned: caillon)

References

()

Details

(Keywords: fixed1.7)

Attachments

(2 files, 2 obsolete files)

Currently, getting the avail rect is wrong if you have a taskbar.  This causes
some bugs like the initial firefox window opening too large.

I'll attach a patch.
Attached patch Patch (obsolete) — Splinter Review
Attachment #145140 - Flags: superreview?(bryner)
Attachment #145140 - Flags: review?(blizzard)
Attachment #145140 - Flags: review?(blizzard)
Attachment #145140 - Flags: review?(blizzard)
Attachment #145141 - Attachment mime type: text/plain → text/html
Comment on attachment 145140 [details] [diff] [review]
Patch

Oops, I meant to declare the member variables of nsScreenGTK private.  Changed
locally.
Attachment #145140 - Flags: review?(blizzard) → review+
Comment on attachment 145140 [details] [diff] [review]
Patch

>+void
>+nsScreenGtk :: Init ()
>+{
>+  mAvailRect = mRect = nsRect(0, 0, gdk_screen_width(), gdk_screen_height());
>+
>+#if GTK_CHECK_VERSION(2,2,0)
>+  // We need to account for the taskbar, etc in the available rect.
>+  // See http://freedesktop.org/Standards/wm-spec/index.html#id2767771
>+
>+  // XXX It doesn't change that often, but we should probably
>+  // listen changes to _NET_WORKAREA.
>+  // XXX do we care about _NET_WM_STRUT_PARTIAL?  That will
>+  // add much more complexity to the code here, but should
>+  // lead to greater accuracy.
>+
>+  long *workareas;
>+  GdkAtom type_returned;
>+  int format_returned;
>+  int length_returned;
>+
>+  GdkWindow *root_window = gdk_screen_get_root_window(gdk_screen_get_default());

Hm, I'd really like if we could make this not require gtk+ 2.2.0.  At a minimum
I'd suggest using GDK_ROOT_WINDOW() here if the gtk version is < 2.2.  Or,
better, look up the symbol for gdk_screen_get_root_window dynamically, i.e. 
PR_FindFunctionSymbolAndLibrary(), and only use GDK_ROOT_WINDOW if it's not
present.  We really want this fix for firefox but I don't think we want to bump
the gtk version requirement for the binaries at this time.
Attachment #145140 - Flags: superreview?(bryner) → superreview-
Attached patch Patch with older gtk support (obsolete) — Splinter Review
Let's try this.
Attachment #145140 - Attachment is obsolete: true
Attachment #146104 - Flags: superreview?(bryner)
Attachment #146104 - Flags: superreview?(bryner) → superreview+
Checked in to trunk 2004-04-19 08:34 PDT.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment on attachment 146104 [details] [diff] [review]
Patch with older gtk support

I think this would be a good fix to get for 1.7 -- it is a harmless change
which fixes our window positioning to not consume more space than the window
manager gives it.
Attachment #146104 - Flags: approval1.7?
Note to self to also pick up the gtk1 bustage fixes when landing on a branch.
Comment on attachment 146104 [details] [diff] [review]
Patch with older gtk support

a=asa (on behalf of drivers) for checkin to 1.7
Attachment #146104 - Flags: approval1.7? → approval1.7+
when you land this on the 1.7 branch, please do not forget about the patch for
bug 241036.
adding fixed keyword. bug 241036 is approved now.
Keywords: fixed1.7
Attached patch Final patchSplinter Review
This is the patch as it was checked in including bustage fixes and the like
(including darin's followup patch).
Attachment #146104 - Attachment is obsolete: true
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: