Closed Bug 63640 Opened 24 years ago Closed 23 years ago

Mouse cursor are not working under BeOS

Categories

(Core :: XUL, defect, P2)

x86
BeOS
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: ykoehler, Assigned: beos)

References

Details

Attachments

(1 file, 13 obsolete files)

27.59 KB, patch
Details | Diff | Splinter Review
need to implement nsWindow::SetCursor.  Should be fairly easy.  Logging a bug to remind.
Status: NEW → ASSIGNED
Priority: -- → P5
Looks like there are only two, B_HAND_CURSOR (B_CURSOR_SYSTEM_DEFAULT) and
B_I_BEAM_CURSOR.  See:

http://www-classic.be.com/documentation/be_book/The%20Application%20Kit/Applicat
ion.html#SetCursor()

I guess any other cursors will have to be drawn by hand...?
There is a other, I had implemented it some time ago... I will check it back 
but I know there's more than the I BEAM.  Check the header files.
the patch is also wrong, it should keep the switch structure not put it in 
comment.  Also the lock/unlock should be done after the switch.  A bool should 
be used to see if the cursor changed and if so then call lock/setcursor/unlock.
*** Bug 65246 has been marked as a duplicate of this bug. ***
The switch was commented out because I didn't want to bother setting all of
those entries to SYSTEM_DEFAULT.  I checked the header files and all I saw was
SYSTEM_DEFAULT & I_BEAM.  I checked BeBook and it only had those listed as well.
There's another variation in the attachment to bug 65246.

http://bugzilla.mozilla.org/showattachment.cgi?attach_id=22481
Attached patch revised patch of 22638 (obsolete) — Splinter Review
thanks for nice cursors!!

But the 22638 patch forgot to set the mCursor.
So sometimes cursor was not changed to default.

Other changes from 22638 might be a problem of a taste.
Takashi,

True, I'm not an artist and not aspiring to become one.  That patch is not in 
the tree yet, if you have better cursor please do send them.  I'll fix the 
thing you're mentioning.

And don't forget that  16x16 one color is Small...
I'm sorry Yannick.
I'm afraid of that my poor expression cause a misunderstanding...
Nice cursors, it's not sarcasm.

Main change of 22638 is the following additional line only.
>mCursor = aCursor;
But there are other changes in 22638.
I change BCursor constructions style from
>static const BCursor *B_CURSOR_HYPERLINK = new BCursor(cursorHyperlink);
to
>#define B_CURSOR_HYPERLINK &bCursorHyperlink
>static const BCursor bCursorHyperlink(cursorHyperlink);

But I dont't know which style is better.
This is the point I wanted to mean with the word 'taste'.
It never mean the problem of design.
Ha ;-)  Well you still have the right to dislike my pointer ;-)  
I think your way is better as I don't have to do if(...) {}
Attached patch corrected patch (obsolete) — Splinter Review
Marking as resolved.  patch commited.  missing cursor would be treated in other
bug if they are needed.  All essentials cursors implemented
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
This checkin has stopped the app from working for me.  Still trying to track
down why.
Severity: enhancement → blocker
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I heard that BApplication should be initialized before 
the excution of BCursor's constructor.
(I heard this from toyoshima..)

In current patch, cursors are created like this.
>static const BCursor bCursorAlias(cursorAlias);
So, the BCursor's constructor will be executed before
initialization of BApplication.

Isn't it the cause of error?
That sounds like it.  For now, I've backed out the changes to nsWindow.cpp and you guys can hash out the proper method for fixing this problem.
Severity: blocker → critical
Priority: P5 → P2
Does it crash or just doesn't start?

To my memory when I had created the cursor before the BApp it actually crash... 
That's also why I had put them in the function in the first place.  Will change 
that.  

Sorry...
Status: REOPENED → ASSIGNED
Chris,

Is this last patch ok?
Attached patch Patch for Cls problem (obsolete) — Splinter Review
Before it was just crashing and printing 'Kill thread' in the terminal window. 
With the latest patch (attach 23130), it crashes and brings up the debugger. 
Here's the trace:

loading symbols
You need a valid BApplication object before interacting with the app_server
_debugger:
_debugger:
+0007  ec084853:   *            c3    retn
mozilla-bin:sc
   frame         retaddr
fcfff194   ec16256d  _BAppServerLink_::_BAppServerLink_(void) + 0000005d
fcfff1a8   ec163640  BCursor::BCursor(void const *) + 00000048
fcfff1c4   ec901081  global constructors keyed to nsWindow::nsWindow(void) +
00000025
fcfff1d8   ec907b66  __do_global_ctors_aux + 00000026
fcfff1e8   ec8ee341  ._init + 0000001c
fcfff1f4   ec083eae  call_routine_in_order + 0000012e
fd00065c   ec083feb  load_add_on + 000000eb
fd000ab0   ed96698a  #File libnspr4.so text + 0000e98a
fd001320   ed96684a  #File libnspr4.so text + 0000e84a
fd001334   ed966882  #File libnspr4.so text + 0000e882
fd00135c   ed905b80  nsDll::Load(void) + 000000c0
fd001384   ed8fe56c  nsNativeComponentLoader::GetFactory(nsID const &, char
const *, char const *, nsIFactory **) + 000000d4
fd0017b4   ed8fb243  nsComponentManagerImpl::FindFactory(nsID const &,
nsIFactory **) + 000000f3
fd001800   ed8fb601  nsComponentManagerImpl::CreateInstance(nsID const &,
nsISupports *, nsID const &, void **) + 00000061
fd001828   ed902ee9  nsComponentManager::CreateInstance(nsID const &,
nsISupports *, nsID const &, void **) + 00000045
fd00184c   edb06309  nsAppShellService::Initialize(nsICmdLineService *,
nsISupports *) + 000001a5
fd0018b0   8000916a  main1(int, char **, nsISupports *) + 00000792
fd001a08   8000991b  main + 0000011b
fd001a34   80006695  _start + 00000061
mozilla-bin:                              

I suggest the move of implementation of BApplication.
It's required by splash window too.
(please see http://bugzilla.mozilla.org/show_bug.cgi?id=65425 )
With this patch, 23130 seem to work certainly.

The trace of chris say we should create BApplication instance
previous to constructors of BCursor.
I still don't get it...  If it was the case I would have get the same crash on 
my machine... how can the BApplication be created in different order based on 2 
computers.

nsAppShell is the first thing to get created (disregard splash screen)... why 
is it that it fail...  
Yannick,
maybe you shold provide revised version of nsBeOSCursors.h ?

It seems that your revised nsWindows.cpp has local BCursor's but 
also current nsBeOSCursors.h has its own definition of global BCursor's .
Chris,
  Can you retry with attachment 23130 [details] [diff] [review] and 23239.
Ok, the changes from 23130 & 23239 work for me.  Nice cursors. ;-)
I have created a new patch for this bug.  There were some comments about some of
the cursors by the BeOS community
and I thought this would be an easy project for me to start with.  But, instead
of just chaning the icons, I also animated
the spinning cursor icon I created.  The code I wrote to do this should really
be reviewed, as this is the first work that I have
done for mozilla.  I attached the AnimateBeOSCursor class I created to nsWindow,
but it seems that multiple nsWindows are
created for one "physical" BWindow.  From what I can tell, the nsWindow
represents both BWindows and BViews.  So, for each
window/view, it is possible that a spinningCursor thread may be started, even if
it is not active very long.  The thread remains 
until the nsWindow object is deleted.  There is probably a better way to
implement this, I just did not see it at my first look at
the code.  Though, this implementation is better than me trying to attach the
AnimateBeOSCursor object to the nsViewBeOS!

Anyway, that patch is below.  It is a zip file containing the patch to nsWindow,
a new nsBeOSCursors.h, and a new class, 
AnimateBeOSCursor.

Also, if you email me about this, I might not get back to you right away, as I'm
going away for a week. 
Timeless asked me to attach that image, I guess as a reference to how custom 
cursors look on a platform with a similar visual cursor style?
No more working on Bezilla
Assignee: koehler → nobody
Status: ASSIGNED → NEW
The cursors I submitted are close to those on the mac.  The main difference is
that the default beos cursor
is a hand, where on a mac it is an arrow.  So, from the picture posted, the only
cursor that I don't have something
"beos" like for is 146, which I'm guessing is to indicate a drop down list
(eCursor_context_menu), which I will add and
update the patche for.  Also, I don't see a difference between 142 and 147.  I
will also make an eCursor_grab cursor,
which will be an open hand, while I already have an eCursor_grabbing, but I
think I'm currently rendering as the
eCursor_grab.  I'll fix that also.

On another note, someone mentioned putting the cursors into a resource file. 
There currently is a resource file, but 
it is also changed in another patch that has not been submitted yet.   Also,
that patch registers mozilla as a bappl.ication
at a different point in the startup process, IIRC, to be able to get to the
resources in the file.  If this is true, I don't want to 
move the cursors to the resource file, until that patch is comitted.  If I'm
wrong on this, let me know.
146 is needed for mac because macs have one button so people press a key 
(option?) which changes the behavior of clicking (popup menu).  Given BeOS 
doesn't really behave like this i don't think it's necessary.

Yannick decided to use .h instead of a resource file because it allows for 
cvsblame.  Unless there's a real need to use a resource file I think I like the 
benefits of cvsblame.

Thanks for volunteering to work on this.
Assignee: nobody → arougthopher
some quick comments:
please use |if {| consistently (you have at least one instance of |if(|).
please don't use tabs in code files (I think 2 spaces is correct, not sure... 
-- see modeline at top of file).
generally, if (cond) return ...; should be split across two lines to aid 
debugging.

+//	commented code doesn't make sense.
probably use one of
+#if 0
+#ifdef DEBUG_baron
(whatever whoami returns)
  live code+=which-wont*get/executed;
#endif

for the final patch, don't #include <stdio.h> or fprintf...

this just doesn't look right
	   if (&view && view->LockLooper())

bool is a native type, the correct values are true and false. please be 
consistent when using non NSPR types.  

this looks like a for loop
    int32 i = 0;
    while( i < qty )
    {
      i++;
    }

contributed code should reference MPL not NPL. The fact that Yannick or someone 
else was careless when they wrote other pieces of the BeZilla code doesn't 
justify perpetuating the problem. http://www.mozilla.org/MPL/boilerplate-1.1/
Keywords: patch
Same icons in previous patch, just no animation.  The animation code created
multiple threads, and could use some work, so it's been removed.
I need an r= on this to get it into the tree and closed.
Your patch removes the triple license in nsBeOSCursors.h.  Any reason?

http://mozilla.org/MPL/relicensing-faq.html
Oops, sorry about that.  I had just saved the file from before, and ran the diff
against that.  I would definitely put the new triple license in.  If need be, I
can do this, and post a new patch.
This is a non-animate cursor patch.  Thought the novelty of an animated
spinninig cursor is nice, it used native beos threads, with a new thread
created for every view, which was not ideal.  This just gives mozilla under
BeOS the different cursors it needs.  I left the extra cursor definitions used
for the spinning cursor in the nsBeOSCursors.h file, for possible future use.
Attachment #58295 - Attachment is obsolete: true
Marking Assigned
Status: NEW → ASSIGNED
Can I get an r= on this?  Or, do I not need one, since this is BeOS specific?
Attachment #21975 - Attachment is obsolete: true
Attachment #22638 - Attachment is obsolete: true
Attachment #22875 - Attachment is obsolete: true
Attachment #23075 - Attachment is obsolete: true
Attachment #23130 - Attachment is obsolete: true
Attachment #23239 - Attachment is obsolete: true
Attachment #40590 - Attachment is obsolete: true
Attachment #40598 - Attachment is obsolete: true
Attachment #42681 - Attachment is obsolete: true
Attachment #43328 - Attachment is obsolete: true
Attachment #45341 - Attachment is obsolete: true
Attachment #61034 - Attachment is obsolete: true
Adding Daniel to CC list, since he will be working on the widget code.
The last patch looks good, let's get it checked in. r=mozilla@switkin.com
The last patch has been checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago23 years ago
Resolution: --- → FIXED
v
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: