Changeset 65de9dd76f0ec5cfff4a84d3fbd818942321114d

Show
Ignore:
Timestamp:
01/19/08 15:54:38 (7 months ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1200754478 +0000
git-parent:

[cbeed9092767db95a97ea79f6c8afbcf1dec2ea9]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1200754478 +0000
Message:

Patch by Frans van Veen and Jasper Alias with modifications by me.

New;
- Mozilla/firefox toolbar for Linux
- Play, Pause, Stop, Fullscreen and Mute buttons
- Timeline, you can click on any place in the timeline and the movie will jump to it

Fixed:
- Coding style, readibility
- Maximum 80 characters per line
- Major memory leak, due to not releasing image data

Known bugs:
- updating timeline not working well because callback function not working "libvlc_event_attach......"
- white line below the toolbar
- play/pause toggle not working well because ticket #1065

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • THANKS

    r8f3d5d0 r65de9dd  
    8585François Seingier <francois.seingier at club-internet.fr> - TTL setting in the wx stream output dialog 
    8686Frank Chao <frank0624 at gmail.com> - Chinese Traditional translation 
     87Frans van Veen <f.m.j.c.vanveen at student.hhs.nl> - Mozilla plugin toolbar 
    8788Fumio Nakayama <endymion at ca2.so-net.ne.jp> - Japanese translation 
    8889Gabor Kelemen <kelemeng at gnome dot hu> - Hungarian translation 
     
    104105Jan Gerber <j at v2v dot org> - patch theora decoding aspect ratio 
    105106Jan Van Boghout <vlc at macrabbit.com> - iTunes like slider for OSX intf 
    106 Javier Varela <tonxabar at hotmail.com> - Spanish translation 
    107 Jean-Alexis Montignies <ja at sente.ch> - coreaudio multiple streams fix 
     107Jasper Alias <j.alias at student.hhs.nl>- Mozilla plugin toolbar 
     108Javier Varela <tonxabar at hotmail.com> - Spanish translation Jean-Alexis Montignies <ja at sente.ch> - coreaudio multiple streams fix 
    108109Jean-Baptiste Le Stang <jp.lestand at lestang.org> - Equalizer-GUI-fixes (OSX), Universal Binary Script 
    109110Jean-Philippe Grimaldi <jeanphi at via.ecp.fr> - bug fixes 
  • configure.ac

    rbc77ed1 r65de9dd  
    58065806        fi 
    58075807        if grep '^#define MOZ_X11 1' ${MOZILLA_CONFIG_H} 2>&1 > /dev/null ; then 
    5808             VLC_ADD_LIBS([mozilla], [${X_LIBS} ${X_PRE_LIBS} -lX11 -lXt]) 
     5808            VLC_ADD_LIBS([mozilla], [${X_LIBS} ${X_PRE_LIBS} -lX11 -lXt -lXpm]) 
    58095809        fi 
    58105810        VLC_ADD_CPPFLAGS([mozilla],[${CPPFLAGS}]) 
     
    58435843         [ 
    58445844           VLC_ADD_CPPFLAGS([mozilla],[${X_CFLAGS}]) 
    5845            VLC_ADD_LIBS([mozilla],[${X_LIBS} ${X_PRE_LIBS} -lXt -lX11 -lSM -lICE]) 
     5845           VLC_ADD_LIBS([mozilla],[${X_LIBS} ${X_PRE_LIBS} -lXt -lX11 -lSM -lICE -lXpm]) 
    58465846         ], 
    58475847         [], 
    5848          [[${X_LIBS} ${X_PRE_LIBS} -lX11 -lSM -lICE
     5848         [[${X_LIBS} ${X_PRE_LIBS} -lX11 -lSM -lICE -lXpm
    58495849        ]) 
    58505850        LDFLAGS="${LDFLAGS_save}" 
  • mozilla/vlcplugin.h

    r7db3162 r65de9dd  
    5353#   include <X11/Intrinsic.h> 
    5454#   include <X11/StringDefs.h> 
     55#   include <X11/X.h> 
    5556#endif 
    5657 
     
    8889#if XP_UNIX 
    8990    int                 setSize(unsigned width, unsigned height); 
     91    Window              getVideoWindow() 
     92                            { return npvideo; }; 
     93    void                setVideoWindow(Window window) 
     94                            { npvideo = window; }; 
     95    Window              getControlWindow() 
     96                            { return npcontrol; }; 
     97    void                setControlWindow(Window window) 
     98                            { npcontrol = window; }; 
    9099#endif 
    91100 
     
    114123#if XP_UNIX 
    115124    unsigned int     i_width, i_height; 
     125    Window           npvideo, npcontrol; 
    116126#endif 
    117127}; 
     
    152162    "application/x-mplayer2::Windows Media;" \ 
    153163    "video/x-ms-wmv:wmv:Windows Media;" \ 
     164    "video/x-ms-wvx:wvx:Windows Media Video;" \ 
    154165    /* Google VLC */ \ 
    155166    "application/x-google-vlc-plugin::Google VLC plugin;" \ 
  • mozilla/vlcshell.cpp

    r6ee1e19 r65de9dd  
    3030#include <string.h> 
    3131#include <stdlib.h> 
     32#include <X11/xpm.h> 
    3233 
    3334/* Mozilla stuff */ 
     
    4647#undef X11_RESIZE_DEBUG 
    4748 
    48 #define WINDOW_TEXT "(no video)" 
     49#define WINDOW_TEXT "Video is loading..." 
     50#define CONTROL_HEIGHT 45 
    4951 
    5052/***************************************************************************** 
     
    5456 
    5557static void Redraw( Widget w, XtPointer closure, XEvent *event ); 
     58static void ControlHandler( Widget w, XtPointer closure, XEvent *event ); 
    5659static void Resize( Widget w, XtPointer closure, XEvent *event ); 
    5760 
     
    185188                    if( libvlc_playlist_isplaying(p_vlc, NULL) ) 
    186189                    { 
    187                         libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_vlc, NULL); 
     190                        libvlc_media_instance_t *p_md = 
     191                            libvlc_playlist_get_media_instance(p_vlc, NULL); 
    188192                        if( p_md ) 
    189193                        { 
     
    215219                    if( libvlc_playlist_isplaying(p_vlc, NULL) ) 
    216220                    { 
    217                         libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_vlc, NULL); 
     221                        libvlc_media_instance_t *p_md = 
     222                            libvlc_playlist_get_media_instance(p_vlc, NULL); 
    218223                        if( p_md ) 
    219224                        { 
     
    241246 
    242247                    /* seems that firefox forgets to set the following on occasion (reload) */ 
    243                     SetOrigin(((NP_Port *)npwindow.window)->portx, ((NP_Port *)npwindow.window)->porty); 
     248                    SetOrigin(((NP_Port *)npwindow.window)->portx, 
     249                              ((NP_Port *)npwindow.window)->porty); 
    244250 
    245251                    Rect rect; 
     
    439445            } 
    440446            /* attach our plugin object */ 
    441             SetWindowLongPtr((HWND)drawable, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(p_plugin)); 
     447            SetWindowLongPtr((HWND)drawable, GWLP_USERDATA, 
     448                             reinterpret_cast<LONG_PTR>(p_plugin)); 
    442449 
    443450            /* install our WNDPROC */ 
    444451            p_plugin->setWindowProc( (WNDPROC)SetWindowLong( drawable, 
    445                                                            GWL_WNDPROC, (LONG)Manage ) ); 
     452                                             GWL_WNDPROC, (LONG)Manage ) ); 
    446453 
    447454            /* change window style to our liking */ 
     
    476483    if( window && window->window ) 
    477484    { 
    478         Window  drawable   = (Window) window->window; 
    479         if( !curwin.window || drawable != (Window)curwin.window
     485        Window  parent   = (Window) window->window; 
     486        if( !curwin.window || (parent != (Window)curwin.window)
    480487        { 
    481488            Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display; 
    482489 
    483             XResizeWindow( p_display, drawable, window->width, window->height ); 
    484             Widget w = XtWindowToWidget( p_display, drawable ); 
    485  
    486             XtAddEventHandler( w, ExposureMask, FALSE, (XtEventHandler)Redraw, p_plugin ); 
    487             XtAddEventHandler( w, StructureNotifyMask, FALSE, (XtEventHandler)Resize, p_plugin ); 
     490            XResizeWindow( p_display, parent, window->width, window->height ); 
     491 
     492            int i_blackColor = BlackPixel(p_display, DefaultScreen(p_display)); 
     493 
     494            Window video = XCreateSimpleWindow( p_display, parent, 0, 0, 
     495                           window->width, window->height - CONTROL_HEIGHT, 0, 
     496                           i_blackColor, i_blackColor ); 
     497            Window controls = XCreateSimpleWindow( p_display, parent, 0, 
     498                            window->height - CONTROL_HEIGHT-1, window->width, 
     499                            CONTROL_HEIGHT-1, 0, i_blackColor, i_blackColor ); 
     500 
     501            XMapWindow( p_display, parent ); 
     502            XMapWindow( p_display, video ); 
     503            XMapWindow( p_display, controls ); 
     504 
     505            XFlush(p_display); 
     506 
     507            Widget w = XtWindowToWidget( p_display, parent ); 
     508 
     509            XtAddEventHandler( w, ExposureMask, FALSE, 
     510                               (XtEventHandler)Redraw, p_plugin ); 
     511            XtAddEventHandler( w, StructureNotifyMask, FALSE, 
     512                               (XtEventHandler)Resize, p_plugin ); 
     513            XtAddEventHandler( w, ButtonReleaseMask, FALSE, 
     514                               (XtEventHandler)ControlHandler, p_plugin ); 
     515 
     516            /* callback */ 
     517/* 
     518            libvlc_media_instance_t *p_md; 
     519 
     520            libvlc_exception_t ex; 
     521            libvlc_exception_init(& ex ); 
     522            p_md = libvlc_playlist_get_media_instance( p_plugin->getVLC(), &ex ); 
     523            libvlc_exception_init( &ex ); 
     524            libvlc_event_attach( libvlc_media_instance_event_manager( p_md, &ex ), 
     525                                 libvlc_MediaInstancePositionChanged, Redraw, NULL, &ex ); 
     526*/ 
    488527 
    489528            /* set/change parent window */ 
    490             libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, NULL); 
     529            libvlc_video_set_parent( p_vlc, (libvlc_drawable_t) video, NULL ); 
    491530 
    492531            /* remember window */ 
    493             p_plugin->setWindow(*window); 
     532            p_plugin->setWindow( *window ); 
     533            p_plugin->setVideoWindow( video ); 
     534            p_plugin->setControlWindow( controls ); 
    494535 
    495536            Redraw( w, (XtPointer)p_plugin, NULL ); 
     
    508549        if( p_plugin->psz_target ) 
    509550        { 
    510             if( libvlc_playlist_add( p_vlc, p_plugin->psz_target, NULL, NULL ) != -1 ) 
     551            if( libvlc_playlist_add( p_vlc, p_plugin->psz_target, 
     552                                     NULL, NULL ) != -1 ) 
    511553            { 
    512554                if( p_plugin->b_autoplay ) 
     
    703745            SetTextColor(hdc, RGB(255, 255, 255)); 
    704746            SetBkColor(hdc, RGB(0, 0, 0)); 
    705             DrawText( hdc, WINDOW_TEXT, strlen(WINDOW_TEXT), &rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE); 
     747            DrawText( hdc, WINDOW_TEXT, strlen(WINDOW_TEXT), &rect, 
     748                      DT_CENTER|DT_VCENTER|DT_SINGLELINE); 
    706749 
    707750            EndPaint( p_hwnd, &paintstruct ); 
     
    726769    XGCValues gcv; 
    727770 
    728     Window  drawable   = (Window) window.window; 
     771    /* Toolbar */ 
     772    XImage *p_playIcon = NULL; 
     773    XImage *p_pauseIcon = NULL; 
     774    XImage *p_stopIcon = NULL; 
     775    XImage *p_timeline = NULL; 
     776    XImage *p_timeKnob = NULL; 
     777    XImage *p_fscreen = NULL; 
     778    XImage *p_muteIcon = NULL; 
     779    XImage *p_unmuteIcon = NULL; 
     780 
     781    libvlc_media_instance_t *p_md = NULL; 
     782    float f_position = 0; 
     783    int i_playing = 0; 
     784    bool b_mute = false; 
     785 
     786    Window video = p_plugin->getVideoWindow(); 
     787    Window control = p_plugin->getControlWindow(); 
    729788    Display *p_display = ((NPSetWindowCallbackStruct *)window.ws_info)->display; 
    730789 
    731790    gcv.foreground = BlackPixel( p_display, 0 ); 
    732     gc = XCreateGC( p_display, drawable, GCForeground, &gcv ); 
    733  
    734     XFillRectangle( p_display, drawable, gc, 
    735                     0, 0, window.width, window.height ); 
     791    gc = XCreateGC( p_display, video, GCForeground, &gcv ); 
     792 
     793    XFillRectangle( p_display, video, gc, 
     794                    0, 0, window.width, window.height - CONTROL_HEIGHT ); 
    736795 
    737796    gcv.foreground = WhitePixel( p_display, 0 ); 
    738797    XChangeGC( p_display, gc, GCForeground, &gcv ); 
    739798 
    740     XDrawString( p_display, drawable, gc, 
    741                  window.width / 2 - 40, window.height / 2, 
     799    XDrawString( p_display, video, gc, 
     800                 window.width / 2 - 40, (window.height - CONTROL_HEIGHT) / 2, 
    742801                 WINDOW_TEXT, strlen(WINDOW_TEXT) ); 
    743802 
     803    /* RedrawToolbar */ 
     804    gcv.foreground = BlackPixel( p_display, 0 ); 
     805    gc = XCreateGC( p_display, control, GCForeground, &gcv ); 
     806 
     807    XFillRectangle( p_display, control, gc, 
     808                    0, 0, window.width, CONTROL_HEIGHT ); 
     809 
     810 
     811    gcv.foreground = WhitePixel( p_display, 0 ); 
     812    XChangeGC( p_display, gc, GCForeground, &gcv ); 
     813 
     814    /* get media instance */ 
     815    libvlc_exception_t ex; 
     816    libvlc_exception_init( &ex ); 
     817    p_md = libvlc_playlist_get_media_instance( p_plugin->getVLC(), &ex ); 
     818    libvlc_exception_clear( &ex ); 
     819 
     820    /* get isplaying */ 
     821    libvlc_exception_init( &ex ); 
     822    i_playing = libvlc_playlist_isplaying( p_plugin->getVLC(), &ex ); 
     823    libvlc_exception_clear( &ex ); 
     824 
     825    /* get mute info */ 
     826    libvlc_exception_init(&ex); 
     827    b_mute = libvlc_audio_get_mute( p_plugin->getVLC(), &ex ); 
     828    libvlc_exception_clear( &ex ); 
     829 
     830    /* get movie position in % */ 
     831    if( i_playing == 1 ) 
     832    { 
     833        libvlc_exception_init( &ex ); 
     834        f_position = libvlc_media_instance_get_position(p_md, &ex)*100; 
     835        libvlc_exception_clear( &ex ); 
     836    } 
     837    libvlc_media_instance_release(p_md); 
     838 
     839    /* load icons */ 
     840    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/play.xpm", 
     841                        &p_playIcon, NULL, NULL); 
     842    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/pause.xpm", 
     843                        &p_pauseIcon, NULL, NULL); 
     844    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/stop.xpm", 
     845                        &p_stopIcon, NULL, NULL ); 
     846    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/time_line.xpm", 
     847                        &p_timeline, NULL, NULL); 
     848    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/time_icon.xpm", 
     849                        &p_timeKnob, NULL, NULL); 
     850    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/fullscreen.xpm", 
     851                        &p_fscreen, NULL, NULL); 
     852    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/volume_max.xpm", 
     853                        &p_muteIcon, NULL, NULL); 
     854    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/volume_mute.xpm", 
     855                        &p_unmuteIcon, NULL, NULL); 
     856 
     857#if 1 /* DEBUG */ 
     858    if( !p_playIcon ) 
     859    { 
     860        fprintf(stderr, "Error: playImage not found\n"); 
     861    } 
     862    if( !p_pauseIcon ) 
     863    { 
     864        fprintf(stderr, "Error: pauseImage not found\n"); 
     865    } 
     866    if( !p_stopIcon ) 
     867    { 
     868        fprintf(stderr, "Error: stopImage not found\n"); 
     869    } 
     870    if( !p_timeline ) 
     871    { 
     872        fprintf(stderr, "Error: TimeLineImage not found\n"); 
     873    } 
     874    if( !p_timeKnob ) 
     875    { 
     876        fprintf(stderr, "Error: TimeIcon not found\n"); 
     877    } 
     878    if( !p_fscreen ) 
     879    { 
     880        fprintf(stderr, "Error: FullscreenImage not found\n"); 
     881    } 
     882    if( !p_muteIcon ) 
     883    { 
     884        fprintf(stderr, "Error: MuteImage not found\n"); 
     885    } 
     886    if( !p_unmuteIcon ) 
     887    { 
     888        fprintf(stderr, "Error: UnMuteImage not found\n"); 
     889    } 
     890#endif 
     891 
     892    /* position icons */ 
     893    if( p_pauseIcon && (i_playing == 1) ) 
     894    { 
     895        XPutImage( p_display, control, gc, p_pauseIcon, 0, 0, 4, 14, 
     896                   p_pauseIcon->width, p_pauseIcon->height ); 
     897    } 
     898    else if( p_playIcon ) 
     899    { 
     900        XPutImage( p_display, control, gc, p_playIcon, 0, 0, 4, 14, 
     901                   p_playIcon->width, p_playIcon->height ); 
     902    } 
     903 
     904    if( p_stopIcon ) 
     905        XPutImage( p_display, control, gc, p_stopIcon, 0, 0, 39, 14, 
     906                   p_stopIcon->width, p_stopIcon->height ); 
     907    if( p_fscreen ) 
     908        XPutImage( p_display, control, gc, p_fscreen, 0, 0, 67, 21, 
     909                   p_fscreen->width, p_fscreen->height ); 
     910 
     911    if( p_unmuteIcon && b_mute ) 
     912    { 
     913        XPutImage( p_display, control, gc, p_unmuteIcon, 0, 0, 94, 30, 
     914                 p_unmuteIcon->width, p_unmuteIcon->height ); 
     915    } 
     916    else if( p_muteIcon ) 
     917    { 
     918        XPutImage( p_display, control, gc, p_muteIcon, 0, 0, 94, 30, 
     919                   p_muteIcon->width, p_muteIcon->height ); 
     920    } 
     921 
     922    if( p_timeline ) 
     923        XPutImage( p_display, control, gc, p_timeline, 0, 0, 4, 4, 
     924                   (window.width-8), p_timeline->height ); 
     925    if( p_timeKnob && (f_position > 0) ) 
     926    { 
     927        f_position = (((float)window.width-8)/100)*f_position; 
     928        XPutImage( p_display, control, gc, p_timeKnob, 0, 0, (4+f_position), 2, 
     929                   p_timeKnob->width, p_timeKnob->height ); 
     930    } 
     931 
     932    /* Cleanup */ 
     933    if( p_playIcon )   XDestroyImage( p_playIcon ); 
     934    if( p_pauseIcon )  XDestroyImage( p_pauseIcon ); 
     935    if( p_stopIcon )   XDestroyImage( p_stopIcon ); 
     936    if( p_timeline )   XDestroyImage( p_timeline ); 
     937    if( p_timeKnob )   XDestroyImage( p_timeKnob ); 
     938    if( p_fscreen )    XDestroyImage( p_fscreen ); 
     939    if( p_muteIcon )   XDestroyImage( p_muteIcon ); 
     940    if( p_unmuteIcon ) XDestroyImage( p_unmuteIcon ); 
     941 
    744942    XFreeGC( p_display, gc ); 
    745943} 
    746944 
    747 static void Resize ( Widget w, XtPointer closure, XEvent *event ) 
     945static void ControlHandler( Widget w, XtPointer closure, XEvent *event ) 
    748946{ 
    749947    VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure); 
    750948    const NPWindow& window = p_plugin->getWindow(); 
    751     Window  drawable   = (Window) window.window; 
     949 
     950    int i_height = window.height; 
     951    int i_width = window.width; 
     952    int i_xPos = event->xbutton.x; 
     953    int i_yPos = event->xbutton.y; 
     954 
     955    libvlc_exception_t ex; 
     956    libvlc_exception_init( &ex ); 
     957    libvlc_media_instance_t *p_md = 
     958            libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex); 
     959    libvlc_exception_clear( &ex ); 
     960 
     961    /* jump in the movie */ 
     962    if( i_yPos <= (i_height-30) ) 
     963    { 
     964        vlc_int64_t f_length; 
     965        libvlc_exception_init( &ex ); 
     966        f_length = libvlc_media_instance_get_length( p_md, &ex ) / 100; 
     967        libvlc_exception_clear( &ex ); 
     968 
     969        f_length = (float)f_length * 
     970                   ( ((float)i_xPos-4 ) / ( ((float)i_width-8)/100) ); 
     971 
     972        libvlc_exception_init( &ex ); 
     973        libvlc_media_instance_set_time( p_md, f_length, &ex ); 
     974        libvlc_exception_clear( &ex ); 
     975    } 
     976 
     977    /* play/pause toggle */ 
     978    if( (i_yPos > (i_height-30)) && (i_xPos > 4) && (i_xPos <= 39) ) 
     979    { 
     980        int i_playing; 
     981        libvlc_exception_init( &ex ); 
     982        i_playing = libvlc_playlist_isplaying( p_plugin->getVLC(), &ex ); 
     983        libvlc_exception_clear( &ex ); 
     984 
     985        libvlc_exception_init( &ex ); 
     986        if( i_playing == 1 ) 
     987            libvlc_playlist_pause( p_plugin->getVLC(), &ex ); 
     988        else 
     989            libvlc_playlist_play( p_plugin->getVLC(), -1, 0, NULL, &ex ); 
     990        libvlc_exception_clear( &ex ); 
     991    } 
     992 
     993    /* stop */ 
     994    if( (i_yPos > (i_height-30)) && (i_xPos > 39) && (i_xPos < 67) ) 
     995    { 
     996        libvlc_exception_init( &ex ); 
     997        libvlc_playlist_stop( p_plugin->getVLC(), &ex ); 
     998        libvlc_exception_clear( &ex ); 
     999    } 
     1000 
     1001    /* fullscreen */ 
     1002    if( (i_yPos > (i_height-30)) && (i_xPos >= 67) && (i_xPos < 94) ) 
     1003    { 
     1004        libvlc_exception_init( &ex ); 
     1005        libvlc_set_fullscreen( p_md, 1, &ex ); 
     1006        libvlc_exception_clear( &ex ); 
     1007    } 
     1008 
     1009    /* mute toggle */ 
     1010    if( (i_yPos > (i_height-30)) && (i_xPos >= 94) && (i_xPos < 109)) 
     1011    { 
     1012        libvlc_exception_init( &ex ); 
     1013        libvlc_audio_toggle_mute( p_plugin->getVLC(), &ex ); 
     1014        libvlc_exception_clear( &ex ); 
     1015    } 
     1016    libvlc_media_instance_release( p_md ); 
     1017 
     1018    Redraw( w, closure, event ); 
     1019
     1020 
     1021static void Resize ( Widget w, XtPointer closure, XEvent *event ) 
     1022
     1023    VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure); 
     1024    const NPWindow& window = p_plugin->getWindow(); 
     1025    Window  drawable   = p_plugin->getVideoWindow(); 
    7521026    Display *p_display = ((NPSetWindowCallbackStruct *)window.ws_info)->display; 
    7531027 
     
    7691043#endif /* X11_RESIZE_DEBUG */ 
    7701044 
    771     if( ! p_plugin->setSize(window.width, window.height) ) 
     1045    if( ! p_plugin->setSize(window.width, (window.height - CONTROL_HEIGHT)) ) 
    7721046    { 
    7731047        /* size already set */ 
     
    7761050 
    7771051 
    778     i_ret = XResizeWindow( p_display, drawable, window.width, window.height ); 
     1052    i_ret = XResizeWindow( p_display, drawable, window.width, (window.height - CONTROL_HEIGHT) ); 
    7791053 
    7801054#ifdef X11_RESIZE_DEBUG 
     
    8081082 
    8091083        i_ret = XResizeWindow( p_display, base_window, 
    810                 window.width, window.height ); 
     1084                window.width, ( window.height - CONTROL_HEIGHT ) ); 
    8111085 
    8121086#ifdef X11_RESIZE_DEBUG