From: Good Guy Date: Sun, 10 Mar 2019 04:07:08 +0000 (-0700) Subject: preview mode mods, powerpc signal handler tweak, default wdws for 3 or more screens X-Git-Tag: 2019-08~87 X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=3932d2c16e903573db3cacdb3102dea9639c6ca4;p=goodguy%2Fcinelerra.git preview mode mods, powerpc signal handler tweak, default wdws for 3 or more screens --- diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 13e802a8..b949e9cd 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -1609,8 +1609,10 @@ void AWindowGUI::start_vicon_drawing() if( !vicon_thread->interrupted ) return; switch( vicon_drawing ) { case AVICON_FULL_PLAY: // all vicons, viewing, target - case AVICON_MOUSE_OVER: // one vicon, viewing, target break; + case AVICON_MOUSE_OVER: // one vicon, viewing, target + if( vicon_thread->solo ) break; + // fall thru case AVICON_SRC_TARGET: // no vicons, no view, target case AVICON_NO_PLAY: // no vicons, no view, no target return; @@ -2775,7 +2777,8 @@ int AWindowAssets::selection_changed() deactivate_selection(); } - else if( get_button_down() ) { + else if( get_button_down() && + mwindow->edl->session->assetlist_format != ASSETS_TEXT ) { if( (item = (AssetPicon*)get_selection(0, 0)) != 0 ) { switch( folder ) { case AW_MEDIA_FOLDER: @@ -2978,9 +2981,9 @@ int AWindowAssets::column_resize_event() return 1; } -int AWindowAssets::focus_in_event() +int AWindowAssets::cursor_enter_event() { - int ret = BC_ListBox::focus_in_event(); + int ret = BC_ListBox::cursor_enter_event(); switch( gui->vicon_drawing ) { case AVICON_FULL_PLAY: gui->start_vicon_drawing(); @@ -2994,6 +2997,13 @@ int AWindowAssets::focus_in_event() return ret; } +int AWindowAssets::cursor_leave_event() +{ + if( !gui->vicon_thread->viewing ) + gui->stop_vicon_drawing(); + return BC_ListBox::cursor_leave_event(); +} + int AWindowAssets::focus_out_event() { gui->stop_vicon_drawing(); @@ -3027,10 +3037,13 @@ int AWindowAssets::mouse_over_event(int no) case AVICON_MOUSE_OVER: if( !vicon ) break; gui->vicon_thread->solo = vicon; + gui->start_vicon_drawing(); + // fall thru + case AVICON_SRC_TARGET: + if( !vicon ) break; if( gui->vicon_thread->viewing ) gui->vicon_thread->set_view_popup(vicon); break; - case AVICON_SRC_TARGET: case AVICON_NO_PLAY: default: break; @@ -3284,6 +3297,7 @@ int AVIconDrawingItem::handle_event() AWindowGUI *agui = avicon->agui; agui->stop_vicon_drawing(); agui->vicon_thread->set_view_popup(0); + agui->vicon_thread->solo = 0; agui->vicon_drawing = id; agui->start_vicon_drawing(); return 1; diff --git a/cinelerra-5.1/cinelerra/awindowgui.h b/cinelerra-5.1/cinelerra/awindowgui.h index 35fdb923..878aa455 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.h +++ b/cinelerra-5.1/cinelerra/awindowgui.h @@ -402,7 +402,8 @@ public: int drag_stop_event(); int button_press_event(); int column_resize_event(); - int focus_in_event(); + int cursor_enter_event(); + int cursor_leave_event(); int focus_out_event(); void update_vicon_area(); int mouse_over_event(int no); diff --git a/cinelerra-5.1/cinelerra/mainsession.C b/cinelerra-5.1/cinelerra/mainsession.C index f1b1974e..e40f343e 100644 --- a/cinelerra-5.1/cinelerra/mainsession.C +++ b/cinelerra-5.1/cinelerra/mainsession.C @@ -201,9 +201,42 @@ void MainSession::default_window_positions(int window_config) int border_bottom = display_info.get_bottom_border(); int dual_head = screens > 1 ? 1 : 0; - int right_w = root_w; + int left_w = 0, right_w = root_w; + int xin_screens = display_info.get_xinerama_screens(); + if( xin_screens > 1 ) { + dual_head = 1; + int x, y, w, h; + for( int s=0; s 0 ) { + for( int s=0; s 1.8) { + if( screens < 2 && (float)root_w / root_h > 1.8 ) { dual_head = 1; switch( root_h ) { case 600: right_w = 800; break; diff --git a/cinelerra-5.1/guicast/bcdisplayinfo.C b/cinelerra-5.1/guicast/bcdisplayinfo.C index 5bbe991c..e94ee750 100644 --- a/cinelerra-5.1/guicast/bcdisplayinfo.C +++ b/cinelerra-5.1/guicast/bcdisplayinfo.C @@ -46,11 +46,14 @@ int BC_DisplayInfo::auto_reposition_y = -1; BC_DisplayInfo::BC_DisplayInfo(const char *display_name, int show_error) { screen = -1; + xinerama_screens = -1; + xinerama_info = 0; init_window(display_name, show_error); } BC_DisplayInfo::~BC_DisplayInfo() { + if( xinerama_info ) XFree(xinerama_info); #ifndef SINGLE_THREAD XCloseDisplay(display); #endif @@ -62,6 +65,47 @@ void BC_DisplayInfo::parse_geometry(char *geom, int *x, int *y, int *width, int XParseGeometry(geom, x, y, (unsigned int*)width, (unsigned int*)height); } + +int BC_DisplayInfo::get_xinerama_screens() +{ + if( xinerama_screens < 0 ) { + xinerama_screens = 0; + if( XineramaIsActive(display) ) + xinerama_info = XineramaQueryScreens(display, &xinerama_screens); + } + return xinerama_screens; +} + +int BC_DisplayInfo::xinerama_geometry(int screen, int &x, int &y, int &w, int &h) +{ + int screens = get_xinerama_screens(); + if( !screens ) return 1; + if( screen >= 0 ) { + int k = screens; + while( --k >= 0 && xinerama_info[k].screen_number != screen ); + if( k < 0 ) return 1; + x = xinerama_info[k].x_org; w = xinerama_info[k].width; + y = xinerama_info[k].y_org; h = xinerama_info[k].height; + } + else { + int sx0 = INT_MAX, sx1 = INT_MIN; + int sy0 = INT_MAX, sy1 = INT_MIN; + for( int i=0; i x0 ) sx0 = x0; + if( sx1 < x1 ) sx1 = x1; + int y0 = xinerama_info[i].y_org; + int y1 = y0 + xinerama_info[i].height; + if( sy0 > y0 ) sy0 = y0; + if( sy1 < y1 ) sy1 = y1; + } + x = sx0; w = sx1 - sx0; + y = sy0; h = sy1 - sy0; + } + return 0; +} + static void get_top_coords(Display *display, Window win, int &px,int &py, int &tx,int &ty) { Window *pcwin = 0; unsigned int ncwin = 0; diff --git a/cinelerra-5.1/guicast/bcdisplayinfo.h b/cinelerra-5.1/guicast/bcdisplayinfo.h index 54f74660..9e4b651c 100644 --- a/cinelerra-5.1/guicast/bcdisplayinfo.h +++ b/cinelerra-5.1/guicast/bcdisplayinfo.h @@ -25,6 +25,7 @@ #include #include #include +#include class BC_DisplayInfo { @@ -50,6 +51,8 @@ public: static const char *host_display_name(const char *name); void init_window(const char *display_name, int show_error=0); int get_screen() { return screen; } + int get_xinerama_screens(); + int xinerama_geometry(int screen, int &x, int &y, int &w, int &h); private: static void init_borders(); @@ -65,6 +68,8 @@ private: static int auto_reposition_y; int default_depth; char *display_name; + XineramaScreenInfo *xinerama_info; + int xinerama_screens; }; #endif diff --git a/cinelerra-5.1/guicast/bcsignals.C b/cinelerra-5.1/guicast/bcsignals.C index ed50cfb1..59597ffa 100644 --- a/cinelerra-5.1/guicast/bcsignals.C +++ b/cinelerra-5.1/guicast/bcsignals.C @@ -385,10 +385,20 @@ const char* BC_Signals::sig_to_str(int number) #if __i386__ #define IP eip +#define sigregs_t sigcontext #endif + #if __x86_64__ #define IP rip +#define sigregs_t sigcontext +#endif + +#if __powerpc__ || __powerpc64__ || __powerpc64le__ +#include +#define IP nip +#define sigregs_t pt_regs #endif + #ifndef IP #error gotta have IP #endif @@ -406,7 +416,7 @@ static void handle_dump(int n, siginfo_t * info, void *sc) // if( uid != 0 ) return; ucontext_t *uc = (ucontext_t *)sc; int pid = getpid(), tid = gettid(); - struct sigcontext *c = (struct sigcontext *)&uc->uc_mcontext; + struct sigregs_t *c = (struct sigregs_t *)&uc->uc_mcontext; uint8_t *ip = (uint8_t *)c->IP; fprintf(stderr,"** %s at %p in pid %d, tid %d\n", n==SIGSEGV? "segv" : n==SIGINT? "intr" : "trap", diff --git a/cinelerra-5.1/guicast/bcwindowbase.C b/cinelerra-5.1/guicast/bcwindowbase.C index 1810abc3..23e5bec4 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.C +++ b/cinelerra-5.1/guicast/bcwindowbase.C @@ -959,42 +959,25 @@ if( debug && event->type != ClientMessage ) { switch(event->type) { case ClientMessage: // Clear the resize buffer - if(resize_events) dispatch_resize_event(last_resize_w, last_resize_h); + if( resize_events ) + dispatch_resize_event(last_resize_w, last_resize_h); // Clear the motion buffer since this can clear the window - if(motion_events) - { + if( motion_events ) dispatch_motion_event(); - } ptr = (XClientMessageEvent*)event; - - - if(ptr->message_type == ProtoXAtom && - (Atom)ptr->data.l[0] == DelWinXAtom) - { + if( ptr->message_type == ProtoXAtom && + (Atom)ptr->data.l[0] == DelWinXAtom ) { close_event(); } - else - if(ptr->message_type == RepeaterXAtom) - { + else if( ptr->message_type == RepeaterXAtom ) { dispatch_repeat_event(ptr->data.l[0]); -// Make sure the repeater still exists. -// for(int i = 0; i < repeaters.total; i++) -// { -// if(repeaters.values[i]->repeat_id == ptr->data.l[0]) -// { -// dispatch_repeat_event_master(ptr->data.l[0]); -// break; -// } -// } } - else - if(ptr->message_type == SetDoneXAtom) - { + else if( ptr->message_type == SetDoneXAtom ) { done = 1; - } else - { // We currently use X marshalling for xatom events, we can switch to something else later - receive_custom_xatoms((xatom_event *)ptr); + } + else { + receive_custom_xatoms((xatom_event *)ptr); } break;