Closed Bug 829717 Opened 12 years ago Closed 12 years ago

Fire unique observer events for view state changes

Categories

(Core :: Widget: Win32, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jimm, Assigned: jimm)

References

Details

Attachments

(1 file, 1 obsolete file)

This will have to be done in FrameworkView's OnWindowSizeChanged. We can cache the view state and check to see if it's changed, then fire an appropriate observer.
Attached patch patch (obsolete) (deleted) — Splinter Review
This won't fire on start up but will fire for changes. So front end script will have to query for the start up value when it initializes.
Assignee: nobody → jmathies
Attachment #701240 - Flags: review?(netzen)
Comment on attachment 701240 [details] [diff] [review]
patch

Review of attachment 701240 [details] [diff] [review]:
-----------------------------------------------------------------

::: widget/windows/winrt/FrameworkView.cpp
@@ +385,5 @@
> +FrameworkView::FireViewStateObservers()
> +{
> +  ApplicationViewState state;
> +  MetroUtils::GetViewState(state);
> +  if (state == mViewState) {

nit: add a comment that says only fire when we have a new view state.
Attachment #701240 - Flags: review?(netzen) → review+
Comment on attachment 701240 [details] [diff] [review]
patch

Drive-by feedback: Can we use a single notification subject (like "metro_viewstate_changed"), so that observers only need to subscribe once?  Then they can use MetroUtils.snappedState to see what the new state is, and/or you can pass it as the "data" parameter to NotifyObservers.
(In reply to Matt Brubeck (:mbrubeck) from comment #3)
> Comment on attachment 701240 [details] [diff] [review]
> patch
> 
> Drive-by feedback: Can we use a single notification subject (like
> "metro_viewstate_changed"), so that observers only need to subscribe once? 
> Then they can use MetroUtils.snappedState to see what the new state is,
> and/or you can pass it as the "data" parameter to NotifyObservers.

great idea, will update.
Attachment #701240 - Flags: review+
Attached patch patch (deleted) — Splinter Review
Attachment #701240 - Attachment is obsolete: true
Attachment #706170 - Flags: review?(mbrubeck)
Attachment #706170 - Flags: review?(mbrubeck) → review+
http://hg.mozilla.org/projects/elm/rev/8131bf55cc78
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
minor call ordering fix up - 

https://hg.mozilla.org/projects/elm/rev/675ee8600930
Blocks: 831894
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: