Closed Bug 19559 Opened 25 years ago Closed 24 years ago

[dogfood] Plugin can not draw itself on linux and solaris.

Categories

(Core Graveyard :: Plug-ins, defect, P3)

x86
Linux

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: blackconnect, Assigned: blizzard)

References

Details

(Whiteboard: [PDT+])

This bug is a regression, it was working week ago.

PluginInstance::SetWindow(nsPluginWindow *window)
get pointer to invalid PluginWindow structure.

window->window has to point to valid GtkWidget, but it points to NULL.

Step to reproduce.
1. Apply this patch to mozilla/modules/plugin/test/npsimple.cpp

----------------------
Index: npsimple.cpp
===================================================================
RCS file: /cvsroot/mozilla/modules/plugin/test/npsimple.cpp,v
retrieving revision 1.14
diff -c -r1.14 npsimple.cpp
*** npsimple.cpp        1999/11/06 03:32:49     1.14
--- npsimple.cpp        1999/11/22 19:10:52
***************
*** 804,810 ****

  NS_METHOD
  SimplePluginInstance::SetWindow(nsPluginWindow* window)
! {
  #ifdef NS_DEBUG
      printf("SimplePluginInstance::SetWindow\n");
  #endif
--- 804,814 ----

  NS_METHOD
  SimplePluginInstance::SetWindow(nsPluginWindow* window)
! {
!     if (window) {
!       printf("--SetWindow window->window %d window->type %d \n",
!              window->window, window->type);
!     }
  #ifdef NS_DEBUG
      printf("SimplePluginInstance::SetWindow\n");
  #endif

----------------------

2. Make npsimple.
3. Run mozilla and load mozilla/modules/plugin/test/samples/embed-test.html

Expected results:
1. Non zero window->window on stdout
2. Some plugin gui on the page
------------
Summary: [dogfood] Plugin can not draw itself on linux and solaris. → [dogfood] Plugin can not draw itself on linux and solaris.
Whiteboard: [PDT+]
Putting on the PDT+ radar.
It's very likely that you aren't getting back a GtkWidget * from that call
because we don't return those for the plugin type anymore.  Sorry, I should have
made that clear.  Is nsPluginWindow * cast to a GtkWidget * on unix?  It needs
to be a GdkSuperWindow *.  From there you should be able to use the
SuperWin->bin_window or SuperWin->shell_window, depending on what you need.
>Is nsPluginWindow * cast to a GtkWidget * on unix?
-- nspluginplugindefs.h  --
struct nsPluginWindow {
    nsPluginPort* window;       /* Platform specific window handle */
                                /* OS/2: x - Position of bottom left corner  */
                                /* OS/2: y - relative to visible netscape window
*/
    PRUint32      x;            /* Position of top left corner relative */
    PRUint32      y;            /*      to a netscape
page.                                     */
    PRUint32      width;        /* Maximum window size */
    PRUint32      height;
    nsPluginRect  clipRect;     /* Clipping rectangle in port coordinates */
                                /* Used by MAC only.                      */
#ifdef XP_UNIX
    void*         ws_info;      /* Platform-dependent additonal data */
#endif /* XP_UNIX */
    nsPluginWindowType type;    /* Is this a window or a drawable? */
};

---------------------------
nsPluginPort is cast to a GtkWidget on Unix.
>It needs to be a GdkSuperWindow *
Do you mean GdkSuperWin?
Do you mean nsPluginWindow or nsPluginPort ?
Sorry, you do need to cast it to a GdkSuperWin * and I mean the nsPluginPort.
Is that returned via an NS_NATIVE_WINDOW or NS_NATIVE_WIDGET in
nsIWidget::GetNativeData()?  I'm guessing it's _WIDGET since in the past you've
always cast it to a GtkWidget *.
The problem is nsPluginPort (window->window) equal to NULL.
It has to point to GdkSuperWin, as you said.
(before it pointed to GtkWidget)
I tried to change npsimple.cpp in function
SimplePluginInstance::PlatformSetWindow to fPlatform.widget =
GDK_SUPERWIN(window->window); but I get an error

npsimple.cpp:1081: type `GtkWidget' is not a base type for type `GdkSuperWin'
gmake: *** [npsimple.o] Error 1

Where else do we need to change this?
Assignee: av → blizzard
*** Bug 20472 has been marked as a duplicate of this bug. ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
There's example code of how to fix this problem in the webshell/embed directory

now.  Follow that and you should be able to figure out how it works.
QA Contact: elig → shrir
Setting shrir as qa contact, shrir, can you see if you can verify this with 12/7
builds?
Status: RESOLVED → REOPENED
Oops, I should have read this more carefully.  This shouldn't be closed.
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
Fix checked in.
Blocks: 21564
Status: RESOLVED → VERIFIED
Marking Verified/Fixed
Please ignore the spam.  Changing address.
Assignee: blizzard → blizzard
Status: VERIFIED → NEW
bustage from my reassign
Status: NEW → RESOLVED
Closed: 25 years ago24 years ago
bustage from my reassign
Status: RESOLVED → VERIFIED
No longer blocks: 21564
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.