Mercurial > mplayer.hg
annotate Gui/mplayer/sw.c @ 8918:3168cfe4f7d1
-geometry fix (untested!)
author | arpi |
---|---|
date | Sun, 12 Jan 2003 17:59:47 +0000 |
parents | b8c271750450 |
children | 0a665389cf2b |
rev | line source |
---|---|
1693 | 1 |
2 // sub window | |
3 | |
8864 | 4 #include <inttypes.h> |
5 | |
6 #include "../../config.h" | |
7 #include "../../libvo/x11_common.h" | |
8 | |
8055 | 9 #include "../app.h" |
10 #include "../interface.h" | |
11 #include "../../help_mp.h" | |
12 #include "widgets.h" | |
13 | |
6794 | 14 int mplSubRender = 0; |
1852 | 15 int SubVisible = 0; |
1812 | 16 |
8055 | 17 extern int boxMoved; |
18 extern int sx,sy; | |
19 extern int i,pot; | |
20 | |
8058 | 21 void mplSubDraw( void ) |
1693 | 22 { |
5919 | 23 if ( appMPlayer.subWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit ); |
24 | |
2045 | 25 if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++; |
8864 | 26 if ( appMPlayer.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) SubVisible--; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
27 |
1852 | 28 if ( !appMPlayer.subWindow.Mapped || |
29 appMPlayer.subWindow.Visible == wsWindowNotVisible ) return; | |
1823 | 30 |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
31 if ( guiIntfStruct.Playing ) mplSubRender=0; |
1693 | 32 |
6794 | 33 if ( mplSubRender && appMPlayer.subWindow.State == wsWindowExpose ) |
1693 | 34 { |
2029 | 35 if ( appMPlayer.sub.Bitmap.Image ) wsPutImage( &appMPlayer.subWindow ); |
1693 | 36 } |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
37 appMPlayer.subWindow.State=0; |
1693 | 38 } |
39 | |
40 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) | |
41 { | |
1812 | 42 static int mplSubMoved = 0; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
43 static int msButton = 0; |
1812 | 44 |
1693 | 45 switch( Button ) |
46 { | |
6651 | 47 case wsPRMouseButton: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
48 gtkShow( evShowPopUpMenu,NULL ); |
2980 | 49 break; |
6651 | 50 case wsPMMouseButton: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
51 gtkShow( evHidePopUpMenu,NULL ); |
1693 | 52 mplShowMenu( RX,RY ); |
6651 | 53 msButton=wsPMMouseButton; |
1693 | 54 break; |
6651 | 55 case wsRMMouseButton: |
5919 | 56 mplHideMenu( RX,RY,1 ); |
1693 | 57 msButton=0; |
58 break; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
59 // --- |
1693 | 60 case wsPLMouseButton: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
61 gtkShow( evHidePopUpMenu,NULL ); |
1693 | 62 sx=X; sy=Y; |
63 msButton=wsPLMouseButton; | |
64 mplSubMoved=0; | |
65 break; | |
66 case wsMoveMouse: | |
67 switch ( msButton ) | |
68 { | |
69 case wsPLMouseButton: | |
70 mplSubMoved=1; | |
2854 | 71 if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,False,RX - sx,RY - sy ); |
1693 | 72 break; |
6651 | 73 case wsPMMouseButton: |
1693 | 74 mplMenuMouseHandle( X,Y,RX,RY ); |
75 break; | |
76 } | |
77 break; | |
78 case wsRLMouseButton: | |
5997
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5919
diff
changeset
|
79 if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) ) |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2045
diff
changeset
|
80 { |
6146 | 81 if( SubVisible++%2 ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID ); |
8864 | 82 else wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID ); |
6623 | 83 } |
1693 | 84 msButton=0; |
85 mplSubMoved=0; | |
86 break; | |
87 } | |
88 } |